Skip to content

Commit

Permalink
Merge pull request #180 from palantirnet/run-behat-inside-ddev
Browse files Browse the repository at this point in the history
Change the behat command to use depending on whether ddev is available.
  • Loading branch information
becw authored Jan 27, 2022
2 parents 5a9d7b5 + b6d9ed2 commit d917e82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion defaults/install/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

<!-- Target: behat -->
<target name="behat" description="Run the Behat tests.">
<property name="behat.command" value="vendor/bin/behat ${behat.args}" />
<property name="behat.command" value="${behat.bin} ${behat.args}" />
<echo msg="$> ${behat.command}" />
<exec command="${behat.command}" logoutput="true" checkreturn="true" />
</target>
Expand Down
7 changes: 5 additions & 2 deletions targets/the-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@
<!-- Use the project directory name as the project name, if it's not configured. -->
<basename property="projectname" file="${build.dir}" suffix="local" />

<!-- Configure the 'drush' Phing task. By default, we run the installed drush. -->
<!-- Configure binaries to run depending on whether we're inside of ddev or out. -->
<property name="drush.bin" value="${build.dir}/vendor/bin/drush" />
<!-- If this is a ddev project, and we're outside of ddev, run ddev's drush command instead. -->
<property name="behat.bin" value="${build.dir}/vendor/bin/behat" />

<!-- If this is a ddev project, and we're outside of ddev, run these commands within ddev. -->
<exec command="which ddev" returnProperty="which_ddev" />
<if>
<and>
Expand All @@ -99,6 +101,7 @@
</and>
<then>
<property name="drush.bin" value="ddev drush" override="true" />
<property name="behat.bin" value="ddev . vendor/bin/behat" override="true" />
</then>
</if>

Expand Down

0 comments on commit d917e82

Please sign in to comment.