From 0f344fcbb4f15e0d28a8f864617985e61c912d80 Mon Sep 17 00:00:00 2001 From: Zack Katz Date: Mon, 17 Feb 2025 16:21:28 -0500 Subject: [PATCH] Persist test suites and install docker-compose in test jobs to fix configuration error - Modify Prepare Workspace Artifact step to copy wordpress-latest-tests-lib (if it exists) to persist the configured test suites. - Add steps to install docker-compose in run_php_74_unit_tests and run_php_80_unit_tests jobs. - Re-create and export the .env file in docker-unit-tests after workspace extraction so that the tests can be run. - This fixes the error "Run 'configure_test_suites' before running tests" by ensuring that wp-tests-config.php is available in the test environment. --- .github/workflows/deploy.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f471421e0d..796e764420 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -44,8 +44,9 @@ jobs: - name: Authenticate GitHub for Composer env: GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} - run: composer config --global --auth github-oauth.github.com $GH_ACCESS_TOKEN + run: composer config --global --auth github-oauth.github.com "$GH_ACCESS_TOKEN" + # Ensure test_dependencies directory exists before caching - name: Ensure test_dependencies directory exists run: mkdir -p $HOME/test_dependencies @@ -70,11 +71,17 @@ jobs: GH_AUTH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} run: bash $HOME/tooling/docker-unit-tests/docker-unit-tests.sh prepare_all + # Persist workspace artifact including test suites - name: Prepare Workspace Artifact run: | mkdir -p workspace_artifact cp -R $HOME/tooling workspace_artifact/ cp -R $HOME/test_dependencies workspace_artifact/ + if [ -d "$HOME/wordpress-latest-tests-lib" ]; then + cp -R $HOME/wordpress-latest-tests-lib workspace_artifact/ + else + echo "wordpress-latest-tests-lib not found" + fi - name: Save Workspace uses: actions/upload-artifact@v4 @@ -111,6 +118,7 @@ jobs: rsync -a /tmp/workspace/ $HOME/ fi + # Ensure .env file in docker-unit-tests exists (re-create if necessary) - name: Ensure .env file in docker-unit-tests exists run: | mkdir -p "$HOME/tooling/docker-unit-tests"