diff --git a/docs/_Sidebar.md b/docs/_Sidebar.md index e7886ebf..fa32db27 100644 --- a/docs/_Sidebar.md +++ b/docs/_Sidebar.md @@ -48,6 +48,7 @@ - [Database sync](/roles/sync/database_sync) - [Database sync - MySQL](/roles/sync/database_sync/database_sync-mysql) - [Tests](/roles/tests) + - [Behat tests](/roles/tests/tests_behat) - [Diffy tests](/roles/tests/tests_diffy) - [LHCI tests](/roles/tests/tests_lhci) - [PHP CodeSniffer tests](/roles/tests/tests_phpcs) diff --git a/docs/roles/_init.md b/docs/roles/_init.md index 4cb48dbb..2f3f43ee 100644 --- a/docs/roles/_init.md +++ b/docs/roles/_init.md @@ -20,8 +20,10 @@ bin_directory: "/home/{{ deploy_user }}/.bin" cleanup_history_depth: 50 install_php_cachetool: true # set to false if you don't need cachetool, e.g. for a nodejs app ce_deploy_version: 1.x +ce_provision_version: 2.x # the version of ce-provision to grab files from when roles are shared lock_file: /tmp/ce-deploy-lock provision_lock_file: /tmp/ce-provision-lock # must match _init.lock_file in ce-provision +skip_build_path_check: false # by default we're checking if track number matches # Application specific variables. drupal: drush_verbose_output: false diff --git a/docs/roles/deploy_code.md b/docs/roles/deploy_code.md index 07edef0b..9e7ae31a 100644 --- a/docs/roles/deploy_code.md +++ b/docs/roles/deploy_code.md @@ -89,6 +89,7 @@ Deploying code with autoscaling clusters relies on [cloud-init](https://cloudini _ce_provision_data_dir: /home/deploy/ce-deploy/data deploy_code: + ce_provision_version: "{{ ce_provision_version }}" # used to determine version of ce-provision to fetch roles from # Feature branching config. feature_branch: enabled: false diff --git a/docs/roles/deploy_container.md b/docs/roles/deploy_container.md index 06669888..82395126 100644 --- a/docs/roles/deploy_container.md +++ b/docs/roles/deploy_container.md @@ -43,11 +43,13 @@ It is worth noting that even if you put your containers on private subnets and c ```yaml --- deploy_container: + ce_provision_version: "{{ ce_provision_version }}" # used to determine version of ce-provision to fetch roles from action: create # can also be destroy container_name: example-container container_tag: latest # tag will take format container_name:container_tag container_force_build: true # force Docker to build and tag a new image docker_registry_name: index.docker.io/example # combines with container_name to make the full registry name, docker_registry_name/container_name + # docker_registry_url: "https://index.docker.io/v1/" docker_registry_user: example docker_registry_pass: asdf1234 docker_base_command: "docker image build" @@ -63,6 +65,7 @@ deploy_container: # Note, you can if you wish make more restrictive roles and policies aws_ecs: enabled: false + service_type: web_app # other options: scheduled_task, e.g. a cron job region: eu-west-1 aws_profile: example tags: {} @@ -71,14 +74,14 @@ deploy_container: zone: example.com aws_profile: example2 # might not be the same account vpc_name: example - #vpc_id: vpc-XXXXXXX # optionally specify VPC ID to use + # vpc_id: vpc-XXXXXXX # optionally specify VPC ID to use security_groups: [] # list of security groups, accepts names or IDs cluster_name: example-cluster family_name: example-task-definition task_definition_revision: "" # integer, but must be presented as a string for Jinja2 task_definition_force_create: false # creates a task definition revision every time if set to true task_execution_role_arn: "arn:aws:iam::000000000000:role/ecsTaskExecutionRole" # ARN of the IAM role to run the task as, must have access to the ECR repository if applicable - #task_role_arn: "" # required if you set service_enable_ssm to true + # task_role_arn: "" # required if you set service_enable_ssm to true task_count: 1 task_minimum_count: 1 task_maximum_count: 4 @@ -111,23 +114,23 @@ deploy_container: memory: 1024 launch_type: FARGATE network_mode: awsvpc - #volumes: [] # list of additional volumes to attach + # volumes: [] # list of additional volumes to attach target_group_name: example # can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen target_group_protocol: http target_group_port: 8080 # ports lower than 1024 will require the app to be configured to run as a privileged user in the Dockerfile target_group_wait_timeout: 200 # how long to wait for target group events to complete targets: [] # typically we do not specify targets at this point, this will be handled automatically by the ECS service - #- Id: 10.0.0.2 - # Port: 80 - # AvailabilityZone: all + # - Id: 10.0.0.2 + # Port: 80 + # AvailabilityZone: all health_check: protocol: http path: / response_codes: "200" - # optional additional healthcheck settings - #interval: 60 - #healthy_threshold_count: 3 - #unhealthy_threshold_count: 5 + ## optional additional healthcheck settings + # interval: 60 + # healthy_threshold_count: 3 + # unhealthy_threshold_count: 5 # Requires the deploy IAM user to have the managed AWSCertificateManagerFullAccess and AmazonRoute53FullAccess policies attached acm: # see https://github.com/codeenigma/ce-provision/tree/1.x/roles/aws/aws_acm create_cert: false diff --git a/docs/roles/tests/tests_behat.md b/docs/roles/tests/tests_behat.md new file mode 100644 index 00000000..dc57bba8 --- /dev/null +++ b/docs/roles/tests/tests_behat.md @@ -0,0 +1,25 @@ +# Behat tests +[Behat](https://behat.org/) is an open source [Behaviour Driven Development](https://en.wikipedia.org/wiki/Behavior-driven_development) tool for building software that is often used for functional testing. + + + + + +## Default variables +```yaml +--- +behat: + install: false # set to true if you want ce-deploy to attempt to composer install Behat + tags: "~@javascript" # behat tags to run + verbose: false # set to true for verbose output + bin: "{{ deploy_path }}/vendor/bin/behat" # location of Behat + # List of outputs to create, defaults to 'pretty' to STDOUT + outputs: + - format: pretty # options are pretty, progress or junit + output: std # see docs for more information, supports output filepath or various formats + config_file: "{{ deploy_path }}/tests/behat/behat.yml" # path to config file + working_dir: "{{ deploy_path }}" # path to execute composer from + +``` + + diff --git a/docs/roles/tests/tests_diffy.md b/docs/roles/tests/tests_diffy.md index ad51fd7f..beb270dd 100644 --- a/docs/roles/tests/tests_diffy.md +++ b/docs/roles/tests/tests_diffy.md @@ -27,6 +27,8 @@ diffy: main_env: dev # name of the 'good' environment to compare against (must be pre-configured in diffy) test_env: custom # name of the environment to be compared (usually diffy's default 'custom' environment) test_env_url: "" # set a base URL to use against the diffy 'custom' environment + bin: "{{ deploy_path }}/vendor/bin/diffy" # location of diffy + working_dir: "{{ deploy_path }}" # path to execute composer and related binaries from ``` diff --git a/docs/roles/tests/tests_phpcs.md b/docs/roles/tests/tests_phpcs.md index a5916a17..dd3f4870 100644 --- a/docs/roles/tests/tests_phpcs.md +++ b/docs/roles/tests/tests_phpcs.md @@ -59,12 +59,13 @@ See the installation documentation on packagist: https://packagist.org/packages/ ```yaml --- phpcs: - install: false # set to true if you want ce-deploy to attempt to composer install PHP CodeSniffer + install: false # set to true if you want ce-deploy to attempt to composer install PHP CodeSniffer install_drupal_coder: false # set to true to install the Coder module for Drupal, which provides a Drupal standard for CodeSniffer bin: "{{ deploy_path }}/vendor/bin/phpcs" # location of phpcs standard: "" # optionally set the path to an installed standard, for example "vendor/drupal/coder/coder_sniffer/Drupal" for the Coder module for Drupal extensions: "" # set optional extensions, for example for Drupal you could set "php,module,inc,theme,install" - defaults to "php,inc/php,js,css" test_paths: [] # list of paths to test against + working_dir: "{{ deploy_path }}" # path to execute composer from ``` diff --git a/docs/roles/tests/tests_phpunit.md b/docs/roles/tests/tests_phpunit.md index 943ea495..bc5c64e2 100644 --- a/docs/roles/tests/tests_phpunit.md +++ b/docs/roles/tests/tests_phpunit.md @@ -34,6 +34,7 @@ phpunit: target: ../modules # directory or file to test, defaults to Drupal's modules directory bin: "{{ deploy_path }}/vendor/bin/phpunit" # location of phpunit tests_path: "{{ deploy_path }}/{{ webroot }}/core" # directory containing the PHPUnit 'tests' directory, defaults to Drupal's core directory + working_dir: "{{ deploy_path }}" # path to execute composer from ``` diff --git a/roles/_init/README.md b/roles/_init/README.md index 4cb48dbb..2f3f43ee 100644 --- a/roles/_init/README.md +++ b/roles/_init/README.md @@ -20,8 +20,10 @@ bin_directory: "/home/{{ deploy_user }}/.bin" cleanup_history_depth: 50 install_php_cachetool: true # set to false if you don't need cachetool, e.g. for a nodejs app ce_deploy_version: 1.x +ce_provision_version: 2.x # the version of ce-provision to grab files from when roles are shared lock_file: /tmp/ce-deploy-lock provision_lock_file: /tmp/ce-provision-lock # must match _init.lock_file in ce-provision +skip_build_path_check: false # by default we're checking if track number matches # Application specific variables. drupal: drush_verbose_output: false diff --git a/roles/deploy_code/README.md b/roles/deploy_code/README.md index 07edef0b..9e7ae31a 100644 --- a/roles/deploy_code/README.md +++ b/roles/deploy_code/README.md @@ -89,6 +89,7 @@ Deploying code with autoscaling clusters relies on [cloud-init](https://cloudini _ce_provision_data_dir: /home/deploy/ce-deploy/data deploy_code: + ce_provision_version: "{{ ce_provision_version }}" # used to determine version of ce-provision to fetch roles from # Feature branching config. feature_branch: enabled: false diff --git a/roles/deploy_container/README.md b/roles/deploy_container/README.md index 06669888..82395126 100644 --- a/roles/deploy_container/README.md +++ b/roles/deploy_container/README.md @@ -43,11 +43,13 @@ It is worth noting that even if you put your containers on private subnets and c ```yaml --- deploy_container: + ce_provision_version: "{{ ce_provision_version }}" # used to determine version of ce-provision to fetch roles from action: create # can also be destroy container_name: example-container container_tag: latest # tag will take format container_name:container_tag container_force_build: true # force Docker to build and tag a new image docker_registry_name: index.docker.io/example # combines with container_name to make the full registry name, docker_registry_name/container_name + # docker_registry_url: "https://index.docker.io/v1/" docker_registry_user: example docker_registry_pass: asdf1234 docker_base_command: "docker image build" @@ -63,6 +65,7 @@ deploy_container: # Note, you can if you wish make more restrictive roles and policies aws_ecs: enabled: false + service_type: web_app # other options: scheduled_task, e.g. a cron job region: eu-west-1 aws_profile: example tags: {} @@ -71,14 +74,14 @@ deploy_container: zone: example.com aws_profile: example2 # might not be the same account vpc_name: example - #vpc_id: vpc-XXXXXXX # optionally specify VPC ID to use + # vpc_id: vpc-XXXXXXX # optionally specify VPC ID to use security_groups: [] # list of security groups, accepts names or IDs cluster_name: example-cluster family_name: example-task-definition task_definition_revision: "" # integer, but must be presented as a string for Jinja2 task_definition_force_create: false # creates a task definition revision every time if set to true task_execution_role_arn: "arn:aws:iam::000000000000:role/ecsTaskExecutionRole" # ARN of the IAM role to run the task as, must have access to the ECR repository if applicable - #task_role_arn: "" # required if you set service_enable_ssm to true + # task_role_arn: "" # required if you set service_enable_ssm to true task_count: 1 task_minimum_count: 1 task_maximum_count: 4 @@ -111,23 +114,23 @@ deploy_container: memory: 1024 launch_type: FARGATE network_mode: awsvpc - #volumes: [] # list of additional volumes to attach + # volumes: [] # list of additional volumes to attach target_group_name: example # can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen target_group_protocol: http target_group_port: 8080 # ports lower than 1024 will require the app to be configured to run as a privileged user in the Dockerfile target_group_wait_timeout: 200 # how long to wait for target group events to complete targets: [] # typically we do not specify targets at this point, this will be handled automatically by the ECS service - #- Id: 10.0.0.2 - # Port: 80 - # AvailabilityZone: all + # - Id: 10.0.0.2 + # Port: 80 + # AvailabilityZone: all health_check: protocol: http path: / response_codes: "200" - # optional additional healthcheck settings - #interval: 60 - #healthy_threshold_count: 3 - #unhealthy_threshold_count: 5 + ## optional additional healthcheck settings + # interval: 60 + # healthy_threshold_count: 3 + # unhealthy_threshold_count: 5 # Requires the deploy IAM user to have the managed AWSCertificateManagerFullAccess and AmazonRoute53FullAccess policies attached acm: # see https://github.com/codeenigma/ce-provision/tree/1.x/roles/aws/aws_acm create_cert: false diff --git a/roles/live_symlink/defaults/main.yml b/roles/live_symlink/defaults/main.yml index 8bf22492..daea7ab3 100644 --- a/roles/live_symlink/defaults/main.yml +++ b/roles/live_symlink/defaults/main.yml @@ -1,8 +1,7 @@ --- deploy_user: 'deploy' live_symlink: - # Either update (for successful builds) or revert. - operation: update + revert_on_fail: true # Specify any additional directory symlink to create, with src (target) and dest (link). # src: can be either absolute or relative to the dest (eg. '/var/my_data', '/home/deploy/simplesaml', '../../../myconfig') # dest: can only be relative to the root of your repository (eg. 'www/themes/myassets', 'var/cache') diff --git a/roles/live_symlink/tasks/main.yml b/roles/live_symlink/tasks/main.yml index 63225e16..2682e55c 100644 --- a/roles/live_symlink/tasks/main.yml +++ b/roles/live_symlink/tasks/main.yml @@ -4,7 +4,9 @@ - ansible.builtin.set_fact: _live_symlink_build_target: "{{ deploy_base_path }}/{{ project_name }}_{{ build_type }}_build_{{ previous_build_number }}" - when: deploy_operation == 'revert' + when: + - deploy_operation == 'revert' + - live_symlink.revert_on_fail - ansible.builtin.set_fact: _live_symlink_dest_target: "{{ live_symlink_dest }}" diff --git a/roles/tests/tests_behat/README.md b/roles/tests/tests_behat/README.md new file mode 100644 index 00000000..dc57bba8 --- /dev/null +++ b/roles/tests/tests_behat/README.md @@ -0,0 +1,25 @@ +# Behat tests +[Behat](https://behat.org/) is an open source [Behaviour Driven Development](https://en.wikipedia.org/wiki/Behavior-driven_development) tool for building software that is often used for functional testing. + + + + + +## Default variables +```yaml +--- +behat: + install: false # set to true if you want ce-deploy to attempt to composer install Behat + tags: "~@javascript" # behat tags to run + verbose: false # set to true for verbose output + bin: "{{ deploy_path }}/vendor/bin/behat" # location of Behat + # List of outputs to create, defaults to 'pretty' to STDOUT + outputs: + - format: pretty # options are pretty, progress or junit + output: std # see docs for more information, supports output filepath or various formats + config_file: "{{ deploy_path }}/tests/behat/behat.yml" # path to config file + working_dir: "{{ deploy_path }}" # path to execute composer from + +``` + + diff --git a/roles/tests/tests_behat/defaults/main.yml b/roles/tests/tests_behat/defaults/main.yml new file mode 100644 index 00000000..1962957f --- /dev/null +++ b/roles/tests/tests_behat/defaults/main.yml @@ -0,0 +1,12 @@ +--- +behat: + install: false # set to true if you want ce-deploy to attempt to composer install Behat + tags: "~@javascript" # behat tags to run + verbose: false # set to true for verbose output + bin: "{{ deploy_path }}/vendor/bin/behat" # location of Behat + # List of outputs to create, defaults to 'pretty' to STDOUT + outputs: + - format: pretty # options are pretty, progress or junit + output: std # see docs for more information, supports output filepath or various formats + config_file: "{{ deploy_path }}/tests/behat/behat.yml" # path to config file + working_dir: "{{ deploy_path }}" # path to execute composer from diff --git a/roles/tests/tests_behat/tasks/main.yml b/roles/tests/tests_behat/tasks/main.yml new file mode 100644 index 00000000..ae11605d --- /dev/null +++ b/roles/tests/tests_behat/tasks/main.yml @@ -0,0 +1,29 @@ +--- +- name: Reset the _behat_outputs var. + ansible.builtin.set_fact: + _behat_outputs: "" + +- name: Install Behat with composer. + ansible.builtin.import_role: + name: composer + when: behat.install + vars: + composer: + command: require + args: behat/behat + working_dir: "{{ behat.working_dir }}" + +- name: Build Behat outputs string. + ansible.builtin.set_fact: + _behat_outputs: "{{ _behat_outputs }} -f {{ item.format }} -o {{ item.output }}" + with_items: "{{ behat.outputs }}" + +- name: Add verbosity if requested. + ansible.builtin.set_fact: + _behat_outputs: "{{ _behat_outputs }} -v" + when: behat.verbose + +- name: Run Behat command. + ansible.builtin.command: + cmd: "{{ behat.bin }} --config={{ behat.config_file }} --tags={{ behat.tags }} {{ _behat_outputs }}" + when: behat.outputs | length > 0 diff --git a/roles/tests/tests_diffy/README.md b/roles/tests/tests_diffy/README.md index ad51fd7f..beb270dd 100644 --- a/roles/tests/tests_diffy/README.md +++ b/roles/tests/tests_diffy/README.md @@ -27,6 +27,8 @@ diffy: main_env: dev # name of the 'good' environment to compare against (must be pre-configured in diffy) test_env: custom # name of the environment to be compared (usually diffy's default 'custom' environment) test_env_url: "" # set a base URL to use against the diffy 'custom' environment + bin: "{{ deploy_path }}/vendor/bin/diffy" # location of diffy + working_dir: "{{ deploy_path }}" # path to execute composer and related binaries from ``` diff --git a/roles/tests/tests_diffy/defaults/main.yml b/roles/tests/tests_diffy/defaults/main.yml index 27298fc7..75a08973 100644 --- a/roles/tests/tests_diffy/defaults/main.yml +++ b/roles/tests/tests_diffy/defaults/main.yml @@ -6,3 +6,5 @@ diffy: main_env: dev # name of the 'good' environment to compare against (must be pre-configured in diffy) test_env: custom # name of the environment to be compared (usually diffy's default 'custom' environment) test_env_url: "" # set a base URL to use against the diffy 'custom' environment + bin: "{{ deploy_path }}/vendor/bin/diffy" # location of diffy + working_dir: "{{ deploy_path }}" # path to execute composer and related binaries from diff --git a/roles/tests/tests_diffy/tasks/main.yml b/roles/tests/tests_diffy/tasks/main.yml index 8a3b9d65..e16dea5c 100644 --- a/roles/tests/tests_diffy/tasks/main.yml +++ b/roles/tests/tests_diffy/tasks/main.yml @@ -7,14 +7,15 @@ composer: command: require args: diffywebsite/diffy-php + working_dir: "{{ diffy.working_dir }}" - name: Login to diffy. ansible.builtin.command: - cmd: "{{ deploy_path }}/vendor/bin/diffy auth:login {{ diffy.key }}" + cmd: "{{ diffy.bin }} auth:login {{ diffy.key }}" - name: Run diffy with environment URL set. ansible.builtin.command: - cmd: "{{ deploy_path }}/vendor/bin/diffy project:compare {{ diffy.project_id }} {{ diffy.main_env }} {{ diffy.test_env }} --env2Url={{ diffy.test_env_url }}" + cmd: "{{ diffy.bin }} project:compare {{ diffy.project_id }} {{ diffy.main_env }} {{ diffy.test_env }} --env2Url={{ diffy.test_env_url }}" register: _diffy_report_id_with_env when: diffy.test_env_url | length > 0 @@ -25,7 +26,7 @@ - name: Run diffy. ansible.builtin.command: - cmd: "{{ deploy_path }}/vendor/bin/diffy project:compare {{ diffy.project_id }} {{ diffy.main_env }} {{ diffy.test_env }}" + cmd: "{{ diffy.bin }} project:compare {{ diffy.project_id }} {{ diffy.main_env }} {{ diffy.test_env }}" register: _diffy_report_id_no_env when: diffy.test_env_url | length == 0 diff --git a/roles/tests/tests_phpcs/README.md b/roles/tests/tests_phpcs/README.md index a5916a17..dd3f4870 100644 --- a/roles/tests/tests_phpcs/README.md +++ b/roles/tests/tests_phpcs/README.md @@ -59,12 +59,13 @@ See the installation documentation on packagist: https://packagist.org/packages/ ```yaml --- phpcs: - install: false # set to true if you want ce-deploy to attempt to composer install PHP CodeSniffer + install: false # set to true if you want ce-deploy to attempt to composer install PHP CodeSniffer install_drupal_coder: false # set to true to install the Coder module for Drupal, which provides a Drupal standard for CodeSniffer bin: "{{ deploy_path }}/vendor/bin/phpcs" # location of phpcs standard: "" # optionally set the path to an installed standard, for example "vendor/drupal/coder/coder_sniffer/Drupal" for the Coder module for Drupal extensions: "" # set optional extensions, for example for Drupal you could set "php,module,inc,theme,install" - defaults to "php,inc/php,js,css" test_paths: [] # list of paths to test against + working_dir: "{{ deploy_path }}" # path to execute composer from ``` diff --git a/roles/tests/tests_phpcs/defaults/main.yml b/roles/tests/tests_phpcs/defaults/main.yml index 25c529bd..0dbaaa00 100644 --- a/roles/tests/tests_phpcs/defaults/main.yml +++ b/roles/tests/tests_phpcs/defaults/main.yml @@ -1,8 +1,9 @@ --- phpcs: - install: false # set to true if you want ce-deploy to attempt to composer install PHP CodeSniffer + install: false # set to true if you want ce-deploy to attempt to composer install PHP CodeSniffer install_drupal_coder: false # set to true to install the Coder module for Drupal, which provides a Drupal standard for CodeSniffer bin: "{{ deploy_path }}/vendor/bin/phpcs" # location of phpcs standard: "" # optionally set the path to an installed standard, for example "vendor/drupal/coder/coder_sniffer/Drupal" for the Coder module for Drupal extensions: "" # set optional extensions, for example for Drupal you could set "php,module,inc,theme,install" - defaults to "php,inc/php,js,css" test_paths: [] # list of paths to test against + working_dir: "{{ deploy_path }}" # path to execute composer from diff --git a/roles/tests/tests_phpcs/tasks/main.yml b/roles/tests/tests_phpcs/tasks/main.yml index df42490e..e1a7fb47 100644 --- a/roles/tests/tests_phpcs/tasks/main.yml +++ b/roles/tests/tests_phpcs/tasks/main.yml @@ -7,6 +7,7 @@ composer: command: require args: drupal/coder + working_dir: "{{ phpcs.working_dir }}" - name: Install PHP CodeSniffer with composer. ansible.builtin.import_role: @@ -16,6 +17,7 @@ composer: command: require args: dealerdirect/phpcodesniffer-composer-installer + working_dir: "{{ phpcs.working_dir }}" - name: Set base phpcs command. ansible.builtin.set_fact: @@ -35,5 +37,5 @@ - name: Execute phpcs tests. ansible.builtin.command: cmd: "{{ _phpcs_command }} {{ phpcs.test_paths | join(' ') }}" - chdir: "{{ deploy_path }}" + chdir: "{{ phpcs.working_dir }}" when: phpcs.test_paths | length > 0 diff --git a/roles/tests/tests_phpunit/README.md b/roles/tests/tests_phpunit/README.md index 943ea495..bc5c64e2 100644 --- a/roles/tests/tests_phpunit/README.md +++ b/roles/tests/tests_phpunit/README.md @@ -34,6 +34,7 @@ phpunit: target: ../modules # directory or file to test, defaults to Drupal's modules directory bin: "{{ deploy_path }}/vendor/bin/phpunit" # location of phpunit tests_path: "{{ deploy_path }}/{{ webroot }}/core" # directory containing the PHPUnit 'tests' directory, defaults to Drupal's core directory + working_dir: "{{ deploy_path }}" # path to execute composer from ``` diff --git a/roles/tests/tests_phpunit/defaults/main.yml b/roles/tests/tests_phpunit/defaults/main.yml index 1f00f0fa..06c52987 100644 --- a/roles/tests/tests_phpunit/defaults/main.yml +++ b/roles/tests/tests_phpunit/defaults/main.yml @@ -5,3 +5,4 @@ phpunit: target: ../modules # directory or file to test, defaults to Drupal's modules directory bin: "{{ deploy_path }}/vendor/bin/phpunit" # location of phpunit tests_path: "{{ deploy_path }}/{{ webroot }}/core" # directory containing the PHPUnit 'tests' directory, defaults to Drupal's core directory + working_dir: "{{ deploy_path }}" # path to execute composer from diff --git a/roles/tests/tests_phpunit/tasks/main.yml b/roles/tests/tests_phpunit/tasks/main.yml index d35d1d13..423dd441 100644 --- a/roles/tests/tests_phpunit/tasks/main.yml +++ b/roles/tests/tests_phpunit/tasks/main.yml @@ -7,6 +7,7 @@ composer: command: require args: phpunit/phpunit + working_dir: "{{ phpunit.working_dir }}" - name: Generate phpunit.xml file from provided file. ansible.builtin.template: