From e2f4df829d0f7c0aacb6f0cb38f3bace2bcac6e1 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:05:43 +0200 Subject: [PATCH 01/80] Cleanup formatting --- .github/workflows/coverage-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 5bf4c621d61..2a5170486cf 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -4,7 +4,6 @@ on: pull_request: jobs: - test-coverage: runs-on: ubuntu-latest steps: @@ -41,4 +40,4 @@ jobs: - name: Ping statistics server with test results run: | curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo Coverage Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} + php ping.php "Monorepo Coverage Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} From 4313f6d82834976d4c1be79e80caf0c276b1c9d9 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:05:53 +0200 Subject: [PATCH 02/80] Initial parallel coverage testing workflow --- .github/workflows/coverage-tests.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 2a5170486cf..7cd5fc156ba 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -1,4 +1,4 @@ -name: ๐Ÿงช Coverage Tests +name: ๐Ÿงช Parallel Coverage Tests on: pull_request: @@ -29,13 +29,33 @@ jobs: - name: Set environment to testing run: echo "ENV=testing" > .env - - name: Execute tests (Unit and Feature tests) via PHPUnit with coverage - run: vendor/bin/pest --coverage --coverage-clover clover.xml --log-junit report.xml + - name: Prepare test directories + run: | + mkdir unit_tests feature_tests + cp -R . unit_tests/ + cp -R . feature_tests/ + + - name: Execute Unit Tests + run: | + cd unit_tests + vendor/bin/pest --coverage --coverage-clover ../unit-clover.xml --log-junit ../unit-report.xml tests/Unit + + - name: Execute Feature Tests + run: | + cd feature_tests + vendor/bin/pest --coverage --coverage-clover ../feature-clover.xml --log-junit ../feature-report.xml tests/Feature + + - name: Install phpcov + run: composer global require phpunit/phpcov + + - name: Merge coverage reports + run: phpcov merge --clover merged-clover.xml unit-clover.xml feature-clover.xml - name: "Publish coverage report to Codecov" uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} + files: ./merged-clover.xml - name: Ping statistics server with test results run: | From a154e3e1411072aca5c117b9f9a80a07120cba25 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:11:56 +0200 Subject: [PATCH 03/80] Fix copying syntax --- .github/workflows/coverage-tests.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 7cd5fc156ba..b6f10b151db 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -12,28 +12,35 @@ jobs: php-version: "8.1" coverage: xdebug extensions: fileinfo - - uses: actions/checkout@v4 + + - name: Checkout code + uses: actions/checkout@v4 + with: + path: src - name: Cache Composer packages id: composer-cache uses: actions/cache@v4 with: - path: vendor + path: src/vendor key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-php- - name: Install Composer Dependencies - run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + run: | + cd src + composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - name: Set environment to testing - run: echo "ENV=testing" > .env + run: | + cd src + echo "ENV=testing" > .env - name: Prepare test directories run: | - mkdir unit_tests feature_tests - cp -R . unit_tests/ - cp -R . feature_tests/ + cp -R src unit_tests + cp -R src feature_tests - name: Execute Unit Tests run: | From 95bc60062c72d9df4651d2ea6655e172882bb0c3 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:16:09 +0200 Subject: [PATCH 04/80] Fix testsuite syntax --- .github/workflows/coverage-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index b6f10b151db..f0c57f4bffd 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -45,12 +45,12 @@ jobs: - name: Execute Unit Tests run: | cd unit_tests - vendor/bin/pest --coverage --coverage-clover ../unit-clover.xml --log-junit ../unit-report.xml tests/Unit + vendor/bin/pest --coverage --coverage-clover ../unit-clover.xml --log-junit ../unit-report.xml --testsuite=UnitFramework - name: Execute Feature Tests run: | cd feature_tests - vendor/bin/pest --coverage --coverage-clover ../feature-clover.xml --log-junit ../feature-report.xml tests/Feature + vendor/bin/pest --coverage --coverage-clover ../feature-clover.xml --log-junit ../feature-report.xml --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" - name: Install phpcov run: composer global require phpunit/phpcov From a8b1465d2ffc64d9cdfb33c4be0026d3420efe13 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:22:43 +0200 Subject: [PATCH 05/80] Execute tests in parallel --- .github/workflows/coverage-tests.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index f0c57f4bffd..475e1f4f5f0 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -42,15 +42,22 @@ jobs: cp -R src unit_tests cp -R src feature_tests - - name: Execute Unit Tests + - name: Execute Tests in Parallel run: | - cd unit_tests - vendor/bin/pest --coverage --coverage-clover ../unit-clover.xml --log-junit ../unit-report.xml --testsuite=UnitFramework - - - name: Execute Feature Tests - run: | - cd feature_tests - vendor/bin/pest --coverage --coverage-clover ../feature-clover.xml --log-junit ../feature-report.xml --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" + # Start unit tests in the background + ( + cd unit_tests + vendor/bin/pest --coverage --coverage-clover ../unit-clover.xml --log-junit ../unit-report.xml --testsuite=UnitFramework + ) & + + # Start feature tests in the background + ( + cd feature_tests + vendor/bin/pest --coverage --coverage-clover ../feature-clover.xml --log-junit ../feature-report.xml --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" + ) & + + # Wait for both background processes to finish + wait - name: Install phpcov run: composer global require phpunit/phpcov From 110d34241fe9bf392627c8b66425b3ddb739c057 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:27:28 +0200 Subject: [PATCH 06/80] Fix coverage merging --- .github/workflows/coverage-tests.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 475e1f4f5f0..eae3a427f2f 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -44,32 +44,35 @@ jobs: - name: Execute Tests in Parallel run: | + mkdir -p coverage # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --coverage --coverage-clover ../unit-clover.xml --log-junit ../unit-report.xml --testsuite=UnitFramework + vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework ) & # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --coverage --coverage-clover ../feature-clover.xml --log-junit ../feature-report.xml --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" + vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" ) & # Wait for both background processes to finish wait - - name: Install phpcov - run: composer global require phpunit/phpcov + - name: Download phpcov + run: wget https://phar.phpunit.de/phpcov.phar - name: Merge coverage reports - run: phpcov merge --clover merged-clover.xml unit-clover.xml feature-clover.xml + run: | + php phpcov.phar merge --clover=coverage.xml coverage + cp coverage.xml coverage/ - name: "Publish coverage report to Codecov" uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} - files: ./merged-clover.xml + files: ./coverage.xml - name: Ping statistics server with test results run: | From 5563f0ad929a46a5602b27bc45725b62a51877aa Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:29:12 +0200 Subject: [PATCH 07/80] Run coverage tests on PHP 8.3 --- .github/workflows/coverage-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index eae3a427f2f..f7ee9478846 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -9,7 +9,7 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: "8.1" + php-version: "8.3" coverage: xdebug extensions: fileinfo From fc4cf2fded65252a6926f8b7915f10f9ce07671e Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:31:58 +0200 Subject: [PATCH 08/80] Create custom output formatter --- .github/workflows/coverage-tests.yml | 44 ++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index f7ee9478846..db551f2f7a5 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -42,24 +42,64 @@ jobs: cp -R src unit_tests cp -R src feature_tests + - name: Create custom output formatter + run: | + cat << EOF > formatter.sh + #!/bin/bash + unit_progress="" + feature_progress="" + + update_progress() { + local suite=\$1 + local result=\$2 + if [ "\$suite" = "unit" ]; then + unit_progress+="\$result" + else + feature_progress+="\$result" + fi + echo -ne "\rUnit: \$unit_progress" + echo -ne "\nFeature: \$feature_progress" + echo -ne "\033[1A" # Move cursor up one line + } + + while IFS= read -r line; do + if [[ \$line == *"[x]"* ]]; then + update_progress "\$1" "X" + elif [[ \$line == *"[โœ“]"* ]]; then + update_progress "\$1" "O" + fi + done + + echo # Print a newline at the end + EOF + chmod +x formatter.sh + - name: Execute Tests in Parallel run: | mkdir -p coverage # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework + vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework | tee unit_output.log | ../formatter.sh unit ) & # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" + vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" | tee feature_output.log | ../formatter.sh feature ) & # Wait for both background processes to finish wait + - name: Print Unit Test Output + if: always() + run: cat unit_tests/unit_output.log + + - name: Print Feature Test Output + if: always() + run: cat feature_tests/feature_output.log + - name: Download phpcov run: wget https://phar.phpunit.de/phpcov.phar From fed72912c498ebf8156d484e41152eb7ac96d1d3 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:35:28 +0200 Subject: [PATCH 09/80] Force unbuffered output --- .github/workflows/coverage-tests.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index db551f2f7a5..92700d006b7 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -42,6 +42,9 @@ jobs: cp -R src unit_tests cp -R src feature_tests + - name: Install expect package + run: sudo apt-get install -y expect + - name: Create custom output formatter run: | cat << EOF > formatter.sh @@ -57,12 +60,13 @@ jobs: else feature_progress+="\$result" fi - echo -ne "\rUnit: \$unit_progress" - echo -ne "\nFeature: \$feature_progress" - echo -ne "\033[1A" # Move cursor up one line + printf "\rUnit: %-50s" "\$unit_progress" + printf "\nFeature: %-50s" "\$feature_progress" + printf "\033[1A" # Move cursor up one line } while IFS= read -r line; do + echo "\$line" >> "\$1_output.log" if [[ \$line == *"[x]"* ]]; then update_progress "\$1" "X" elif [[ \$line == *"[โœ“]"* ]]; then @@ -80,13 +84,13 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework | tee unit_output.log | ../formatter.sh unit + unbuffer vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework | unbuffer -p ../formatter.sh unit ) & # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" | tee feature_output.log | ../formatter.sh feature + unbuffer vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" | unbuffer -p ../formatter.sh feature ) & # Wait for both background processes to finish @@ -94,11 +98,11 @@ jobs: - name: Print Unit Test Output if: always() - run: cat unit_tests/unit_output.log + run: cat unit_output.log - name: Print Feature Test Output if: always() - run: cat feature_tests/feature_output.log + run: cat feature_output.log - name: Download phpcov run: wget https://phar.phpunit.de/phpcov.phar From 9b66f5e1c21caaadc540ac07da5c3d449e405b6a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:36:44 +0200 Subject: [PATCH 10/80] Revert "Force unbuffered output" This reverts commit 87c2215cbbdec497f5a64ffb02d32cddcd61a8e1. --- .github/workflows/coverage-tests.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 92700d006b7..db551f2f7a5 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -42,9 +42,6 @@ jobs: cp -R src unit_tests cp -R src feature_tests - - name: Install expect package - run: sudo apt-get install -y expect - - name: Create custom output formatter run: | cat << EOF > formatter.sh @@ -60,13 +57,12 @@ jobs: else feature_progress+="\$result" fi - printf "\rUnit: %-50s" "\$unit_progress" - printf "\nFeature: %-50s" "\$feature_progress" - printf "\033[1A" # Move cursor up one line + echo -ne "\rUnit: \$unit_progress" + echo -ne "\nFeature: \$feature_progress" + echo -ne "\033[1A" # Move cursor up one line } while IFS= read -r line; do - echo "\$line" >> "\$1_output.log" if [[ \$line == *"[x]"* ]]; then update_progress "\$1" "X" elif [[ \$line == *"[โœ“]"* ]]; then @@ -84,13 +80,13 @@ jobs: # Start unit tests in the background ( cd unit_tests - unbuffer vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework | unbuffer -p ../formatter.sh unit + vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework | tee unit_output.log | ../formatter.sh unit ) & # Start feature tests in the background ( cd feature_tests - unbuffer vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" | unbuffer -p ../formatter.sh feature + vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" | tee feature_output.log | ../formatter.sh feature ) & # Wait for both background processes to finish @@ -98,11 +94,11 @@ jobs: - name: Print Unit Test Output if: always() - run: cat unit_output.log + run: cat unit_tests/unit_output.log - name: Print Feature Test Output if: always() - run: cat feature_output.log + run: cat feature_tests/feature_output.log - name: Download phpcov run: wget https://phar.phpunit.de/phpcov.phar From 1ce1ba524f9de0db72e9bdd7b40b073bd77c52b2 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:37:42 +0200 Subject: [PATCH 11/80] Capture all output --- .github/workflows/coverage-tests.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index db551f2f7a5..3b37d3117a5 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -63,6 +63,7 @@ jobs: } while IFS= read -r line; do + echo "\$line" >> "\$1_full_output.log" if [[ \$line == *"[x]"* ]]; then update_progress "\$1" "X" elif [[ \$line == *"[โœ“]"* ]]; then @@ -80,13 +81,13 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework | tee unit_output.log | ../formatter.sh unit + vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | ../formatter.sh unit ) & # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" | tee feature_output.log | ../formatter.sh feature + vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | ../formatter.sh feature ) & # Wait for both background processes to finish @@ -94,11 +95,11 @@ jobs: - name: Print Unit Test Output if: always() - run: cat unit_tests/unit_output.log + run: cat unit_full_output.log - name: Print Feature Test Output if: always() - run: cat feature_tests/feature_output.log + run: cat feature_full_output.log - name: Download phpcov run: wget https://phar.phpunit.de/phpcov.phar From c74bff27924721fc4729f6741ad56473afcd9a0c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:39:00 +0200 Subject: [PATCH 12/80] Revert "Capture all output" This reverts commit 81dacb3f709913485467799e4324d39dffe20c55. --- .github/workflows/coverage-tests.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 3b37d3117a5..db551f2f7a5 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -63,7 +63,6 @@ jobs: } while IFS= read -r line; do - echo "\$line" >> "\$1_full_output.log" if [[ \$line == *"[x]"* ]]; then update_progress "\$1" "X" elif [[ \$line == *"[โœ“]"* ]]; then @@ -81,13 +80,13 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | ../formatter.sh unit + vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework | tee unit_output.log | ../formatter.sh unit ) & # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | ../formatter.sh feature + vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" | tee feature_output.log | ../formatter.sh feature ) & # Wait for both background processes to finish @@ -95,11 +94,11 @@ jobs: - name: Print Unit Test Output if: always() - run: cat unit_full_output.log + run: cat unit_tests/unit_output.log - name: Print Feature Test Output if: always() - run: cat feature_full_output.log + run: cat feature_tests/feature_output.log - name: Download phpcov run: wget https://phar.phpunit.de/phpcov.phar From 95d56626a8fdcbf5e6c82f00a421d7f482b5e083 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:39:04 +0200 Subject: [PATCH 13/80] Revert "Create custom output formatter " This reverts commit 68fad88f8e96c4a52bb1c2e2026dab8e7d9935c4. --- .github/workflows/coverage-tests.yml | 44 ++-------------------------- 1 file changed, 2 insertions(+), 42 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index db551f2f7a5..f7ee9478846 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -42,64 +42,24 @@ jobs: cp -R src unit_tests cp -R src feature_tests - - name: Create custom output formatter - run: | - cat << EOF > formatter.sh - #!/bin/bash - unit_progress="" - feature_progress="" - - update_progress() { - local suite=\$1 - local result=\$2 - if [ "\$suite" = "unit" ]; then - unit_progress+="\$result" - else - feature_progress+="\$result" - fi - echo -ne "\rUnit: \$unit_progress" - echo -ne "\nFeature: \$feature_progress" - echo -ne "\033[1A" # Move cursor up one line - } - - while IFS= read -r line; do - if [[ \$line == *"[x]"* ]]; then - update_progress "\$1" "X" - elif [[ \$line == *"[โœ“]"* ]]; then - update_progress "\$1" "O" - fi - done - - echo # Print a newline at the end - EOF - chmod +x formatter.sh - - name: Execute Tests in Parallel run: | mkdir -p coverage # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework | tee unit_output.log | ../formatter.sh unit + vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework ) & # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" | tee feature_output.log | ../formatter.sh feature + vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" ) & # Wait for both background processes to finish wait - - name: Print Unit Test Output - if: always() - run: cat unit_tests/unit_output.log - - - name: Print Feature Test Output - if: always() - run: cat feature_tests/feature_output.log - - name: Download phpcov run: wget https://phar.phpunit.de/phpcov.phar From 95e3b646758dc93fd4d5eeb01f462d14af5e18e2 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:42:41 +0200 Subject: [PATCH 14/80] Prefix output lines --- .github/workflows/coverage-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index f7ee9478846..e34d89c5852 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -48,13 +48,13 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework + vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed 's/^/[UNIT] /' & ) & # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" + vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed 's/^/[FEATURE] /' & ) & # Wait for both background processes to finish From 0255c7332d03f2a0ecd519cb1703a1f19e93219a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:47:09 +0200 Subject: [PATCH 15/80] Retain formatting lost by sed prefixer --- .github/workflows/coverage-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index e34d89c5852..bfa2e7da478 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -48,13 +48,13 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed 's/^/[UNIT] /' & + vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT]\x1b[0m /' & ) & # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed 's/^/[FEATURE] /' & + vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & ) & # Wait for both background processes to finish From 8f2bf282e2d62242de5a09c92ff81abd0ad52c21 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:49:12 +0200 Subject: [PATCH 16/80] Set colors to always --- .github/workflows/coverage-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index bfa2e7da478..949cfab7f8a 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -48,13 +48,13 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT]\x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT]\x1b[0m /' & ) & # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & ) & # Wait for both background processes to finish From b1f4269460f029c1e008715c11b77ff07e19e29c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:50:58 +0200 Subject: [PATCH 17/80] Merge the Junit XML reports --- .github/workflows/coverage-tests.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 949cfab7f8a..11d07e784b7 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -48,13 +48,13 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT]\x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --log-junit=../coverage/unit.xml --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT]\x1b[0m /' & ) & # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --log-junit=../coverage/feature.xml --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & ) & # Wait for both background processes to finish @@ -68,6 +68,15 @@ jobs: php phpcov.phar merge --clover=coverage.xml coverage cp coverage.xml coverage/ + - name: Download JUnit merger script + run: | + wget https://gist.githubusercontent.com/cgoldberg/4320815/raw/efcf6830f516f79b82e7bd631b076363eda3ed99/merge_junit_results.py + chmod +x merge_junit_results.py + + - name: Merge JUnit XML reports + run: | + python merge_junit_results.py coverage/unit.xml coverage/feature.xml > report.xml + - name: "Publish coverage report to Codecov" uses: codecov/codecov-action@v4 with: From 825a13d7de6198d387ff6354232f5e958bf2d61d Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:54:13 +0200 Subject: [PATCH 18/80] Match indentation --- .github/workflows/coverage-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 11d07e784b7..eb4cc0426c2 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -48,7 +48,7 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --log-junit=../coverage/unit.xml --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT]\x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --log-junit=../coverage/unit.xml --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT] \x1b[0m /' & ) & # Start feature tests in the background From 288311e79269c47d1f0a4d461eee13f35b4c8fa5 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 11:57:05 +0200 Subject: [PATCH 19/80] Add debugging --- .github/workflows/coverage-tests.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index eb4cc0426c2..3778cef9219 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -48,7 +48,7 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --log-junit=../coverage/unit.xml --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT] \x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --log-junit=../coverage/unit.xml --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT]\x1b[0m /' & ) & # Start feature tests in the background @@ -60,13 +60,23 @@ jobs: # Wait for both background processes to finish wait + - name: Debug - List coverage directory + run: | + ls -la coverage + echo "Current working directory: $(pwd)" + - name: Download phpcov run: wget https://phar.phpunit.de/phpcov.phar - name: Merge coverage reports run: | - php phpcov.phar merge --clover=coverage.xml coverage - cp coverage.xml coverage/ + php phpcov.phar merge --clover=coverage.xml coverage || echo "phpcov merge failed" + [ -f coverage.xml ] && cp coverage.xml coverage/ || echo "coverage.xml not created" + + - name: Debug - Check merged coverage + run: | + [ -f coverage.xml ] && echo "coverage.xml exists" || echo "coverage.xml does not exist" + [ -f coverage/coverage.xml ] && echo "coverage/coverage.xml exists" || echo "coverage/coverage.xml does not exist" - name: Download JUnit merger script run: | @@ -75,7 +85,11 @@ jobs: - name: Merge JUnit XML reports run: | - python merge_junit_results.py coverage/unit.xml coverage/feature.xml > report.xml + python merge_junit_results.py coverage/unit.xml coverage/feature.xml > report.xml || echo "JUnit merge failed" + + - name: Debug - Check merged JUnit report + run: | + [ -f report.xml ] && echo "report.xml exists" || echo "report.xml does not exist" - name: "Publish coverage report to Codecov" uses: codecov/codecov-action@v4 @@ -86,4 +100,4 @@ jobs: - name: Ping statistics server with test results run: | curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo Coverage Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} + php ping.php "Monorepo Coverage Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} \ No newline at end of file From f64b2b434d3d834fc47d4b1279c731764f202667 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 12:03:04 +0200 Subject: [PATCH 20/80] Add debug --- monorepo/scripts/ping-openanalytics-testrunner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monorepo/scripts/ping-openanalytics-testrunner.php b/monorepo/scripts/ping-openanalytics-testrunner.php index 095c66b6d6b..02005b50359 100644 --- a/monorepo/scripts/ping-openanalytics-testrunner.php +++ b/monorepo/scripts/ping-openanalytics-testrunner.php @@ -62,7 +62,7 @@ $data['commit'] = shell_exec('git rev-parse HEAD'); $data['branch'] = $branch ?? shell_exec('git branch --show-current'); $data['runner_os'] = php_uname('s'); - +var_dump($data); curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data)); $resp = curl_exec($curl); From 7778626ece5ced989b3eb49f8580217120b0e24f Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 12:12:46 +0200 Subject: [PATCH 21/80] Revert "Add debugging" This reverts commit 780f2cc9ffb1caa06f2e0b60cfce27723a98ac6f. --- .github/workflows/coverage-tests.yml | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 3778cef9219..eb4cc0426c2 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -48,7 +48,7 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --log-junit=../coverage/unit.xml --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT]\x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --log-junit=../coverage/unit.xml --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT] \x1b[0m /' & ) & # Start feature tests in the background @@ -60,23 +60,13 @@ jobs: # Wait for both background processes to finish wait - - name: Debug - List coverage directory - run: | - ls -la coverage - echo "Current working directory: $(pwd)" - - name: Download phpcov run: wget https://phar.phpunit.de/phpcov.phar - name: Merge coverage reports run: | - php phpcov.phar merge --clover=coverage.xml coverage || echo "phpcov merge failed" - [ -f coverage.xml ] && cp coverage.xml coverage/ || echo "coverage.xml not created" - - - name: Debug - Check merged coverage - run: | - [ -f coverage.xml ] && echo "coverage.xml exists" || echo "coverage.xml does not exist" - [ -f coverage/coverage.xml ] && echo "coverage/coverage.xml exists" || echo "coverage/coverage.xml does not exist" + php phpcov.phar merge --clover=coverage.xml coverage + cp coverage.xml coverage/ - name: Download JUnit merger script run: | @@ -85,11 +75,7 @@ jobs: - name: Merge JUnit XML reports run: | - python merge_junit_results.py coverage/unit.xml coverage/feature.xml > report.xml || echo "JUnit merge failed" - - - name: Debug - Check merged JUnit report - run: | - [ -f report.xml ] && echo "report.xml exists" || echo "report.xml does not exist" + python merge_junit_results.py coverage/unit.xml coverage/feature.xml > report.xml - name: "Publish coverage report to Codecov" uses: codecov/codecov-action@v4 @@ -100,4 +86,4 @@ jobs: - name: Ping statistics server with test results run: | curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo Coverage Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} \ No newline at end of file + php ping.php "Monorepo Coverage Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} From 1134fe50a8b2ac9c9e8f465e50d0cb0ee2a098bf Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 12:18:36 +0200 Subject: [PATCH 22/80] Revert "Add debug" This reverts commit 6eed65f49f012575ef6329277628460c8a5006b5. --- monorepo/scripts/ping-openanalytics-testrunner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monorepo/scripts/ping-openanalytics-testrunner.php b/monorepo/scripts/ping-openanalytics-testrunner.php index 02005b50359..095c66b6d6b 100644 --- a/monorepo/scripts/ping-openanalytics-testrunner.php +++ b/monorepo/scripts/ping-openanalytics-testrunner.php @@ -62,7 +62,7 @@ $data['commit'] = shell_exec('git rev-parse HEAD'); $data['branch'] = $branch ?? shell_exec('git branch --show-current'); $data['runner_os'] = php_uname('s'); -var_dump($data); + curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data)); $resp = curl_exec($curl); From 16da9a4df6a2601158347771519a705ec1247ed1 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 12:20:26 +0200 Subject: [PATCH 23/80] Revert "Merge the Junit XML reports" This reverts commit a1bfa077e76025a9d37f153af081496f6fa45e10. --- .github/workflows/coverage-tests.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index eb4cc0426c2..c6951454ef8 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -48,13 +48,12 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --log-junit=../coverage/unit.xml --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT] \x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT] \x1b[0m /' & ) & - # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --log-junit=../coverage/feature.xml --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & ) & # Wait for both background processes to finish @@ -68,15 +67,6 @@ jobs: php phpcov.phar merge --clover=coverage.xml coverage cp coverage.xml coverage/ - - name: Download JUnit merger script - run: | - wget https://gist.githubusercontent.com/cgoldberg/4320815/raw/efcf6830f516f79b82e7bd631b076363eda3ed99/merge_junit_results.py - chmod +x merge_junit_results.py - - - name: Merge JUnit XML reports - run: | - python merge_junit_results.py coverage/unit.xml coverage/feature.xml > report.xml - - name: "Publish coverage report to Codecov" uses: codecov/codecov-action@v4 with: From 6ac0bd763d4ac01168fecdcc6e3e0ef713ef8c66 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 12:21:36 +0200 Subject: [PATCH 24/80] Manually merge the Junit XML reports --- .github/workflows/coverage-tests.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index c6951454ef8..6616c5afdcf 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -48,12 +48,12 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT] \x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --log-junit=../coverage/unit.junit.xml --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT] \x1b[0m /' & ) & # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --log-junit=../coverage/feature.junit.xml --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & ) & # Wait for both background processes to finish @@ -67,6 +67,14 @@ jobs: php phpcov.phar merge --clover=coverage.xml coverage cp coverage.xml coverage/ + - name: Merge JUnit XML reports + run: | + echo '' > report.xml + echo '' >> report.xml + sed -n '//p' coverage/unit.junit.xml >> report.xml + sed -n '//p' coverage/feature.junit.xml >> report.xml + echo '' >> report.xml + - name: "Publish coverage report to Codecov" uses: codecov/codecov-action@v4 with: From 25636f4b6903c986570d2814e3e9b5ff7422cb2d Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 12:23:35 +0200 Subject: [PATCH 25/80] Revert "Manually merge the Junit XML reports" This reverts commit 6009bfa8cac9b4810e8b980a08cea4e15f9b0c06. --- .github/workflows/coverage-tests.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 6616c5afdcf..c6951454ef8 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -48,12 +48,12 @@ jobs: # Start unit tests in the background ( cd unit_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --log-junit=../coverage/unit.junit.xml --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT] \x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT] \x1b[0m /' & ) & # Start feature tests in the background ( cd feature_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --log-junit=../coverage/feature.junit.xml --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & + vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & ) & # Wait for both background processes to finish @@ -67,14 +67,6 @@ jobs: php phpcov.phar merge --clover=coverage.xml coverage cp coverage.xml coverage/ - - name: Merge JUnit XML reports - run: | - echo '' > report.xml - echo '' >> report.xml - sed -n '//p' coverage/unit.junit.xml >> report.xml - sed -n '//p' coverage/feature.junit.xml >> report.xml - echo '' >> report.xml - - name: "Publish coverage report to Codecov" uses: codecov/codecov-action@v4 with: From 66731ea7c7c88a46d1753e9f257a475dbf7d3bd7 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 12:28:33 +0200 Subject: [PATCH 26/80] Manually generate the Junit XML report --- .github/workflows/coverage-tests.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index c6951454ef8..ba44f655b89 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -67,6 +67,26 @@ jobs: php phpcov.phar merge --clover=coverage.xml coverage cp coverage.xml coverage/ + - name: Create fake JUnit XML + run: | + php -r ' + $coverage = simplexml_load_file("coverage.xml"); + $metrics = $coverage->project->metrics; + + $junit = new SimpleXMLElement(""); + $testsuite = $junit->addChild("testsuite"); + $testsuite->addAttribute("name", "All Tests"); + $testsuite->addAttribute("tests", (string)$metrics["elements"]); + $testsuite->addAttribute("assertions", (string)$metrics["coveredelements"]); + $testsuite->addAttribute("errors", "0"); + $testsuite->addAttribute("warnings", "0"); + $testsuite->addAttribute("failures", (string)($metrics["elements"] - $metrics["coveredelements"])); + $testsuite->addAttribute("skipped", "0"); + $testsuite->addAttribute("time", "0"); + + $junit->asXML("report.xml"); + ' + - name: "Publish coverage report to Codecov" uses: codecov/codecov-action@v4 with: From 876c71b8ff58fd1e372945f36e916bb61531a324 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 12:34:23 +0200 Subject: [PATCH 27/80] Test workflow issue --- .github/workflows/coverage-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index ba44f655b89..212defb345d 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -49,12 +49,12 @@ jobs: ( cd unit_tests vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT] \x1b[0m /' & - ) & + ) # Start feature tests in the background ( cd feature_tests vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & - ) & + ) # Wait for both background processes to finish wait From f5b64db329bdd30f623bb82db1d66b99ff1d08fc Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 12:34:26 +0200 Subject: [PATCH 28/80] Revert "Test workflow issue" This reverts commit 887108db4adbdd80921618a91ec254e12e4b49c2. --- .github/workflows/coverage-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 212defb345d..ba44f655b89 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -49,12 +49,12 @@ jobs: ( cd unit_tests vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT] \x1b[0m /' & - ) + ) & # Start feature tests in the background ( cd feature_tests vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & - ) + ) & # Wait for both background processes to finish wait From 9f9d91770f5e7be20833e1590431f1e076494616 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 13:55:52 +0200 Subject: [PATCH 29/80] Use a more robust approach with named pipes --- .github/workflows/coverage-tests.yml | 43 ++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index ba44f655b89..17e97e96e1a 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -45,19 +45,38 @@ jobs: - name: Execute Tests in Parallel run: | mkdir -p coverage - # Start unit tests in the background - ( - cd unit_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed -E $'s/^/\x1b[36m[UNIT] \x1b[0m /' & - ) & - # Start feature tests in the background - ( - cd feature_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E $'s/^/\x1b[35m[FEATURE]\x1b[0m /' & - ) & + # Create named pipes + mkfifo unit_pipe feature_pipe - # Wait for both background processes to finish - wait + # Function to run tests and signal completion + run_tests() { + local suite=$1 + local pipe=$2 + cd ${suite}_tests + vendor/bin/pest --colors=always --coverage-php=../coverage/${suite}.cov --testsuite=$3 2>&1 | \ + sed -E "s/^/[${suite^^}] /" + echo "done" > $pipe + } + + # Start tests in background + run_tests unit unit_pipe UnitFramework & + run_tests feature feature_pipe "FeatureHyde,FeatureFramework,Publications,Realtime Compiler" & + + # Wait for both test suites to complete + while true; do + if [ -z "$(jobs -p)" ]; then + break + fi + if read -r -t 1 line < unit_pipe; then + [ "$line" = "done" ] && pkill -P $$ sed + fi + if read -r -t 1 line < feature_pipe; then + [ "$line" = "done" ] && pkill -P $$ sed + fi + done + + # Clean up pipes + rm unit_pipe feature_pipe - name: Download phpcov run: wget https://phar.phpunit.de/phpcov.phar From b5cf579596f967d37cf88b0882c0c984d1cdb810 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 13:59:06 +0200 Subject: [PATCH 30/80] Refactor and add debugging --- .github/workflows/coverage-tests.yml | 55 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 17e97e96e1a..76e1113456e 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -45,38 +45,37 @@ jobs: - name: Execute Tests in Parallel run: | mkdir -p coverage - # Create named pipes - mkfifo unit_pipe feature_pipe - # Function to run tests and signal completion - run_tests() { - local suite=$1 - local pipe=$2 - cd ${suite}_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/${suite}.cov --testsuite=$3 2>&1 | \ - sed -E "s/^/[${suite^^}] /" - echo "done" > $pipe - } + echo "Starting Unit Tests..." + ( + cd unit_tests + vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed -E 's/^/[UNIT] /' + echo "[UNIT] Tests completed" + ) > unit_output.log 2>&1 & - # Start tests in background - run_tests unit unit_pipe UnitFramework & - run_tests feature feature_pipe "FeatureHyde,FeatureFramework,Publications,Realtime Compiler" & + echo "Starting Feature Tests..." + ( + cd feature_tests + vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E 's/^/[FEATURE] /' + echo "[FEATURE] Tests completed" + ) > feature_output.log 2>&1 & - # Wait for both test suites to complete - while true; do - if [ -z "$(jobs -p)" ]; then - break - fi - if read -r -t 1 line < unit_pipe; then - [ "$line" = "done" ] && pkill -P $$ sed - fi - if read -r -t 1 line < feature_pipe; then - [ "$line" = "done" ] && pkill -P $$ sed - fi - done + echo "Waiting for tests to complete..." + wait + echo "All tests completed" - # Clean up pipes - rm unit_pipe feature_pipe + echo "Unit Test Output:" + cat unit_output.log + + echo "Feature Test Output:" + cat feature_output.log + + - name: Check Coverage Files + run: | + echo "Checking coverage files..." + ls -l coverage/ + [ -f coverage/unit.cov ] && echo "Unit coverage file exists" || echo "Unit coverage file is missing" + [ -f coverage/feature.cov ] && echo "Feature coverage file exists" || echo "Feature coverage file is missing" - name: Download phpcov run: wget https://phar.phpunit.de/phpcov.phar From f528fe27f282ebb1c0b527d5bc755dec2a50e917 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:04:21 +0200 Subject: [PATCH 31/80] Remove debug and add live output --- .github/workflows/coverage-tests.yml | 40 +++++++++------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 76e1113456e..6225c40c880 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -46,36 +46,20 @@ jobs: run: | mkdir -p coverage - echo "Starting Unit Tests..." - ( - cd unit_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/unit.cov --testsuite=UnitFramework 2>&1 | sed -E 's/^/[UNIT] /' - echo "[UNIT] Tests completed" - ) > unit_output.log 2>&1 & + # Function to run tests + run_tests() { + local suite=$1 + local testsuite=$2 + cd ${suite}_tests + vendor/bin/pest --colors=always --coverage-php=../coverage/${suite}.cov --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}] /" + } - echo "Starting Feature Tests..." - ( - cd feature_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/feature.cov --testsuite=FeatureHyde,FeatureFramework,Publications,"Realtime Compiler" 2>&1 | sed -E 's/^/[FEATURE] /' - echo "[FEATURE] Tests completed" - ) > feature_output.log 2>&1 & + # Run tests in parallel and combine output + (run_tests unit UnitFramework) & + (run_tests feature "FeatureHyde,FeatureFramework,Publications,Realtime Compiler") & - echo "Waiting for tests to complete..." + # Wait for all background jobs to finish wait - echo "All tests completed" - - echo "Unit Test Output:" - cat unit_output.log - - echo "Feature Test Output:" - cat feature_output.log - - - name: Check Coverage Files - run: | - echo "Checking coverage files..." - ls -l coverage/ - [ -f coverage/unit.cov ] && echo "Unit coverage file exists" || echo "Unit coverage file is missing" - [ -f coverage/feature.cov ] && echo "Feature coverage file exists" || echo "Feature coverage file is missing" - name: Download phpcov run: wget https://phar.phpunit.de/phpcov.phar @@ -114,4 +98,4 @@ jobs: - name: Ping statistics server with test results run: | curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo Coverage Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} + php ping.php "Monorepo Coverage Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} \ No newline at end of file From ceac4c8f3663f02e279af7d0e5420a82eea49f2f Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:11:53 +0200 Subject: [PATCH 32/80] Fix paths in the the merged coverage report --- .github/workflows/coverage-tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 6225c40c880..bc37069f74b 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -66,7 +66,11 @@ jobs: - name: Merge coverage reports run: | - php phpcov.phar merge --clover=coverage.xml coverage + # Merge coverage reports + php phpcov.phar merge --clover=raw_coverage.xml coverage + + # Fix paths in the coverage report + sed 's/\.\/[^\/]*\/packages/\.\/packages/g' raw_coverage.xml > coverage.xml cp coverage.xml coverage/ - name: Create fake JUnit XML From c2412aee953694b083c0f47498c4d7cd2af896b6 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:14:35 +0200 Subject: [PATCH 33/80] Move back Git directory to root --- .github/workflows/coverage-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index bc37069f74b..469e1b4f1c7 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -41,6 +41,7 @@ jobs: run: | cp -R src unit_tests cp -R src feature_tests + mv src/.git . - name: Execute Tests in Parallel run: | From 8e17b70003862d1b1f6ac7cb60cc27ce02a1c6af Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:17:55 +0200 Subject: [PATCH 34/80] Cleanup workflow --- .github/workflows/coverage-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 469e1b4f1c7..b87cac968d3 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -74,7 +74,7 @@ jobs: sed 's/\.\/[^\/]*\/packages/\.\/packages/g' raw_coverage.xml > coverage.xml cp coverage.xml coverage/ - - name: Create fake JUnit XML + - name: Create JUnit XML run: | php -r ' $coverage = simplexml_load_file("coverage.xml"); @@ -103,4 +103,4 @@ jobs: - name: Ping statistics server with test results run: | curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo Coverage Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} \ No newline at end of file + php ping.php "Monorepo Coverage Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} From aa834fd6ef7b2208504e03d79bb497e60e5f8f1d Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:18:00 +0200 Subject: [PATCH 35/80] Update file path --- .github/workflows/coverage-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index b87cac968d3..ba9426a286b 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -98,7 +98,7 @@ jobs: uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml + files: ./coverage/coverage.xml - name: Ping statistics server with test results run: | From e39fa7782e3c5e8480d933a19daaac3f3bca6d00 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:18:28 +0200 Subject: [PATCH 36/80] Add debug --- .github/workflows/coverage-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index ba9426a286b..415e5ef7bd9 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -102,5 +102,6 @@ jobs: - name: Ping statistics server with test results run: | + cat report.xml curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php php ping.php "Monorepo Coverage Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} From 8e8bcf2d43302aabed1c813b6ed1149b829fa7c4 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:27:02 +0200 Subject: [PATCH 37/80] Reset coverage testing workflow See https://github.com/hydephp/develop/pull/1928#issuecomment-2265242371 --- .github/workflows/coverage-tests.yml | 80 +++------------------------- 1 file changed, 8 insertions(+), 72 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 415e5ef7bd9..2a5170486cf 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -1,4 +1,4 @@ -name: ๐Ÿงช Parallel Coverage Tests +name: ๐Ÿงช Coverage Tests on: pull_request: @@ -9,99 +9,35 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: "8.3" + php-version: "8.1" coverage: xdebug extensions: fileinfo - - - name: Checkout code - uses: actions/checkout@v4 - with: - path: src + - uses: actions/checkout@v4 - name: Cache Composer packages id: composer-cache uses: actions/cache@v4 with: - path: src/vendor + path: vendor key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-php- - name: Install Composer Dependencies - run: | - cd src - composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - name: Set environment to testing - run: | - cd src - echo "ENV=testing" > .env + run: echo "ENV=testing" > .env - - name: Prepare test directories - run: | - cp -R src unit_tests - cp -R src feature_tests - mv src/.git . - - - name: Execute Tests in Parallel - run: | - mkdir -p coverage - - # Function to run tests - run_tests() { - local suite=$1 - local testsuite=$2 - cd ${suite}_tests - vendor/bin/pest --colors=always --coverage-php=../coverage/${suite}.cov --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}] /" - } - - # Run tests in parallel and combine output - (run_tests unit UnitFramework) & - (run_tests feature "FeatureHyde,FeatureFramework,Publications,Realtime Compiler") & - - # Wait for all background jobs to finish - wait - - - name: Download phpcov - run: wget https://phar.phpunit.de/phpcov.phar - - - name: Merge coverage reports - run: | - # Merge coverage reports - php phpcov.phar merge --clover=raw_coverage.xml coverage - - # Fix paths in the coverage report - sed 's/\.\/[^\/]*\/packages/\.\/packages/g' raw_coverage.xml > coverage.xml - cp coverage.xml coverage/ - - - name: Create JUnit XML - run: | - php -r ' - $coverage = simplexml_load_file("coverage.xml"); - $metrics = $coverage->project->metrics; - - $junit = new SimpleXMLElement(""); - $testsuite = $junit->addChild("testsuite"); - $testsuite->addAttribute("name", "All Tests"); - $testsuite->addAttribute("tests", (string)$metrics["elements"]); - $testsuite->addAttribute("assertions", (string)$metrics["coveredelements"]); - $testsuite->addAttribute("errors", "0"); - $testsuite->addAttribute("warnings", "0"); - $testsuite->addAttribute("failures", (string)($metrics["elements"] - $metrics["coveredelements"])); - $testsuite->addAttribute("skipped", "0"); - $testsuite->addAttribute("time", "0"); - - $junit->asXML("report.xml"); - ' + - name: Execute tests (Unit and Feature tests) via PHPUnit with coverage + run: vendor/bin/pest --coverage --coverage-clover clover.xml --log-junit report.xml - name: "Publish coverage report to Codecov" uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage/coverage.xml - name: Ping statistics server with test results run: | - cat report.xml curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php php ping.php "Monorepo Coverage Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} From 845a51051017762521398d45889dced866a0a925 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:31:05 +0200 Subject: [PATCH 38/80] Initial parallel smoke testing --- .github/workflows/smoke-tests.yml | 35 ++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index fd1d806244e..66d9d43ed93 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -2,7 +2,7 @@ # In order to get even quicker feedback, we also ping our Continuous Integration server to get a status check # as soon as we know the outcome, as the GitHub Actions Pull Request UI takes a little bit to update. -name: ๐Ÿ”ฅ Smoke Tests +name: ๐Ÿ”ฅ Parallel Smoke Tests on: pull_request: @@ -29,9 +29,38 @@ jobs: - name: Install Composer Dependencies run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - name: Run smoke tests + - name: Prepare test directories + run: | + mkdir unit_tests feature_tests + cp -R . unit_tests/ + cp -R . feature_tests/ + + - name: Run Parallel Smoke Tests id: smoke-tests - run: vendor/bin/pest --stop-on-failure --log-junit report.xml + run: | + run_tests() { + local suite=$1 + local testsuite=$2 + cd ${suite}_tests + ../vendor/bin/pest --stop-on-failure --log-junit ../${suite}_report.xml --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}] /" + } + + (run_tests unit UnitFramework) & + (run_tests feature "FeatureHyde,FeatureFramework,Publications,Realtime Compiler") & + + wait + + - name: Combine Test Reports + if: always() + run: | + php -r ' + $unit = simplexml_load_file("unit_report.xml"); + $feature = simplexml_load_file("feature_report.xml"); + $combined = new SimpleXMLElement(""); + foreach ($unit->testsuite as $suite) $combined->addChild("testsuite", $suite); + foreach ($feature->testsuite as $suite) $combined->addChild("testsuite", $suite); + $combined->asXML("report.xml"); + ' - name: Ping continuous integration server with test status if: always() && github.event.repository.full_name == 'hydephp/develop' From edcbdb4d27323247d8b19198d79e2fafb6f5b774 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:36:27 +0200 Subject: [PATCH 39/80] Remove CI server integration --- .github/workflows/smoke-tests.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 66d9d43ed93..f70ea578874 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -62,32 +62,6 @@ jobs: $combined->asXML("report.xml"); ' - - name: Ping continuous integration server with test status - if: always() && github.event.repository.full_name == 'hydephp/develop' - run: | - bearerToken="${{ secrets.CI_SERVER_TOKEN }}" - commit="${{ github.event.pull_request.head.sha }}" - url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - - # If bearerToken is not set, we we exit early as we are probably running on a fork - if [ -z "$bearerToken" ]; then - echo "Exiting early as bearerToken is not set" - exit 0 - fi - - if [ ${{ steps.smoke-tests.outcome }} == "failure" ]; then - status=false - else - status=true - fi - - curl -X POST --fail-with-body \ - -H "Authorization: Bearer $bearerToken" \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -d '{"commit":"'"$commit"'", "status":'$status', "url":"'"$url"'"}' \ - https://ci.hydephp.com/api/test-run-reports - - name: Ping statistics server with test results run: | curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php From ddad3b0fd4c116a055b80558bd6def7df1655833 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:36:49 +0200 Subject: [PATCH 40/80] Use rsync --- .github/workflows/smoke-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index f70ea578874..8c621c61f4b 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,9 +31,9 @@ jobs: - name: Prepare test directories run: | - mkdir unit_tests feature_tests - cp -R . unit_tests/ - cp -R . feature_tests/ + mkdir -p unit_tests feature_tests + rsync -av --exclude='unit_tests' --exclude='feature_tests' . unit_tests/ + rsync -av --exclude='unit_tests' --exclude='feature_tests' . feature_tests/ - name: Run Parallel Smoke Tests id: smoke-tests From 9dd8a360744badf66ab52dd95bea800ed0b7eb75 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:40:39 +0200 Subject: [PATCH 41/80] Adapt the parallel coverage workflow implementation --- .github/workflows/smoke-tests.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 8c621c61f4b..7b60c9870a9 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,36 +31,34 @@ jobs: - name: Prepare test directories run: | - mkdir -p unit_tests feature_tests - rsync -av --exclude='unit_tests' --exclude='feature_tests' . unit_tests/ - rsync -av --exclude='unit_tests' --exclude='feature_tests' . feature_tests/ + cp -R . unit_tests + cp -R . feature_tests - - name: Run Parallel Smoke Tests - id: smoke-tests + - name: Execute Tests in Parallel run: | + # Function to run tests run_tests() { local suite=$1 local testsuite=$2 cd ${suite}_tests - ../vendor/bin/pest --stop-on-failure --log-junit ../${suite}_report.xml --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}] /" + vendor/bin/pest --colors=always --stop-on-failure --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}] /" } + # Run tests in parallel and combine output (run_tests unit UnitFramework) & (run_tests feature "FeatureHyde,FeatureFramework,Publications,Realtime Compiler") & + # Wait for all background jobs to finish wait - - name: Combine Test Reports - if: always() + - name: Create JUnit XML run: | - php -r ' - $unit = simplexml_load_file("unit_report.xml"); - $feature = simplexml_load_file("feature_report.xml"); - $combined = new SimpleXMLElement(""); - foreach ($unit->testsuite as $suite) $combined->addChild("testsuite", $suite); - foreach ($feature->testsuite as $suite) $combined->addChild("testsuite", $suite); - $combined->asXML("report.xml"); - ' + echo ' + + + + + ' > report.xml - name: Ping statistics server with test results run: | From ea437df8048697ceb921b6733e0d95bc6b6c2899 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:43:03 +0200 Subject: [PATCH 42/80] Fix checkout paths --- .github/workflows/smoke-tests.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 7b60c9870a9..d1f65226239 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -12,27 +12,33 @@ jobs: run-smoke-tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 + with: + path: src - name: Validate composer.json and composer.lock - run: composer validate --strict --no-check-all + run: | + cd src && composer validate --strict --no-check-all - name: Cache Composer packages id: composer-cache uses: actions/cache@v4 with: - path: vendor + path: src/vendor key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-php- - name: Install Composer Dependencies - run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + run: | + cd src && composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - name: Prepare test directories run: | - cp -R . unit_tests - cp -R . feature_tests + cp -R src unit_tests + cp -R src feature_tests + mv src/.git . - name: Execute Tests in Parallel run: | From 57e415a22b3973ecac2a19fbba7a8f0d77a5df20 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:44:57 +0200 Subject: [PATCH 43/80] Cleanup formatting --- .github/workflows/smoke-tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index d1f65226239..1e28d75ca3b 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -1,14 +1,9 @@ -# This workflow is especially helpful for pull requests to quickly see if the other tests will definitely fail. -# In order to get even quicker feedback, we also ping our Continuous Integration server to get a status check -# as soon as we know the outcome, as the GitHub Actions Pull Request UI takes a little bit to update. - name: ๐Ÿ”ฅ Parallel Smoke Tests on: pull_request: jobs: - run-smoke-tests: runs-on: ubuntu-latest steps: From 4092e04b0d1e2f2eb17d1994777d934539a31e6b Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 14:53:32 +0200 Subject: [PATCH 44/80] Merge Junit XML reports --- .github/workflows/smoke-tests.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 1e28d75ca3b..f9fa1484239 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -37,12 +37,14 @@ jobs: - name: Execute Tests in Parallel run: | + mkdir -p test_results + # Function to run tests run_tests() { local suite=$1 local testsuite=$2 cd ${suite}_tests - vendor/bin/pest --colors=always --stop-on-failure --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}] /" + vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}] /" } # Run tests in parallel and combine output @@ -52,14 +54,26 @@ jobs: # Wait for all background jobs to finish wait - - name: Create JUnit XML + - name: Merge JUnit XML Reports run: | - echo ' - - - - - ' > report.xml + php -r ' + $files = glob("test_results/*_junit.xml"); + $totalTests = $totalAssertions = $totalTime = 0; + foreach ($files as $file) { + $xml = simplexml_load_file($file); + $totalTests += (int)$xml->testsuite["tests"]; + $totalAssertions += (int)$xml->testsuite["assertions"]; + $totalTime += (float)$xml->testsuite["time"]; + } + $output = sprintf( + "\n\n \n \n", + "H:\\monorepo\\phpunit.xml.dist", + $totalTests, + $totalAssertions, + $totalTime + ); + file_put_contents("report.xml", $output); + ' - name: Ping statistics server with test results run: | From 60b36f0cfb40ec12d544e68ba1fc60df5bf8c4c2 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:04:07 +0200 Subject: [PATCH 45/80] Dynamic padding --- .github/workflows/smoke-tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index f9fa1484239..b0b9551c318 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -43,8 +43,12 @@ jobs: run_tests() { local suite=$1 local testsuite=$2 + local padding="" + if [ "$suite" == "unit" ]; then + padding=" " + fi cd ${suite}_tests - vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}] /" + vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}]${padding} /" } # Run tests in parallel and combine output From ada3c8cb5ff6b9610012bdc532100abe93f0f29c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:05:31 +0200 Subject: [PATCH 46/80] Run all feature test suites in parallel --- .github/workflows/smoke-tests.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index b0b9551c318..21e95eb9adb 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,8 +31,9 @@ jobs: - name: Prepare test directories run: | - cp -R src unit_tests - cp -R src feature_tests + for suite in unit feature_hyde feature_framework publications realtime_compiler; do + cp -R src ${suite}_tests + done mv src/.git . - name: Execute Tests in Parallel @@ -46,14 +47,19 @@ jobs: local padding="" if [ "$suite" == "unit" ]; then padding=" " + elif [ "$suite" == "feature_hyde" ] || [ "$suite" == "publications" ]; then + padding=" " fi cd ${suite}_tests vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}]${padding} /" } - # Run tests in parallel and combine output + # Run tests in parallel (run_tests unit UnitFramework) & - (run_tests feature "FeatureHyde,FeatureFramework,Publications,Realtime Compiler") & + (run_tests feature_hyde FeatureHyde) & + (run_tests feature_framework FeatureFramework) & + (run_tests publications Publications) & + (run_tests realtime_compiler "Realtime Compiler") & # Wait for all background jobs to finish wait From 881a9964e196fb85d27767f9a0221bdd4d762b46 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:09:59 +0200 Subject: [PATCH 47/80] Improved live output --- .github/workflows/smoke-tests.yml | 42 +++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 21e95eb9adb..068f3e71c5d 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -40,29 +40,51 @@ jobs: run: | mkdir -p test_results - # Function to run tests + # Function to run tests and update progress run_tests() { local suite=$1 local testsuite=$2 local padding="" if [ "$suite" == "unit" ]; then - padding=" " - elif [ "$suite" == "feature_hyde" ] || [ "$suite" == "publications" ]; then - padding=" " + padding=" " + elif [ "$suite" == "feature_hyde" ]; then + padding=" " + elif [ "$suite" == "feature_framework" ]; then + padding=" " + elif [ "$suite" == "publications" ]; then + padding=" " + elif [ "$suite" == "realtime_compiler" ]; then + padding=" " fi cd ${suite}_tests - vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}]${padding} /" + vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" > "../test_results/${suite}_output.txt" 2>&1 & + local pid=$! + echo -n "[${suite^^}]${padding}" + while kill -0 $pid 2>/dev/null; do + echo -n "." + sleep 0.1 + done + echo "" + wait $pid } # Run tests in parallel - (run_tests unit UnitFramework) & - (run_tests feature_hyde FeatureHyde) & - (run_tests feature_framework FeatureFramework) & - (run_tests publications Publications) & - (run_tests realtime_compiler "Realtime Compiler") & + run_tests unit UnitFramework & + run_tests feature_hyde FeatureHyde & + run_tests feature_framework FeatureFramework & + run_tests publications Publications & + run_tests realtime_compiler "Realtime Compiler" & # Wait for all background jobs to finish wait + + echo "Tests completed. Full output:" + echo "============================" + for suite in unit feature_hyde feature_framework publications realtime_compiler; do + echo "[${suite^^}] Output:" + cat "test_results/${suite}_output.txt" + echo "============================" + done - name: Merge JUnit XML Reports run: | From f08bc16b3bd3d2129e1d9d867887490f52270822 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:13:38 +0200 Subject: [PATCH 48/80] Fix live output formatting --- .github/workflows/smoke-tests.yml | 35 ++++++++----------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 068f3e71c5d..d71f85a15b9 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -40,7 +40,7 @@ jobs: run: | mkdir -p test_results - # Function to run tests and update progress + # Function to run tests run_tests() { local suite=$1 local testsuite=$2 @@ -49,42 +49,25 @@ jobs: padding=" " elif [ "$suite" == "feature_hyde" ]; then padding=" " - elif [ "$suite" == "feature_framework" ]; then - padding=" " elif [ "$suite" == "publications" ]; then padding=" " - elif [ "$suite" == "realtime_compiler" ]; then + elif [ "$suite" == "feature_framework" ]; then padding=" " fi cd ${suite}_tests - vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" > "../test_results/${suite}_output.txt" 2>&1 & - local pid=$! - echo -n "[${suite^^}]${padding}" - while kill -0 $pid 2>/dev/null; do - echo -n "." - sleep 0.1 - done - echo "" - wait $pid + echo "[${suite^^}]${padding}" # Print the header + vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E 's/^/ /' # Indent the output } # Run tests in parallel - run_tests unit UnitFramework & - run_tests feature_hyde FeatureHyde & - run_tests feature_framework FeatureFramework & - run_tests publications Publications & - run_tests realtime_compiler "Realtime Compiler" & + (run_tests unit UnitFramework) & + (run_tests feature_hyde FeatureHyde) & + (run_tests feature_framework FeatureFramework) & + (run_tests publications Publications) & + (run_tests realtime_compiler "Realtime Compiler") & # Wait for all background jobs to finish wait - - echo "Tests completed. Full output:" - echo "============================" - for suite in unit feature_hyde feature_framework publications realtime_compiler; do - echo "[${suite^^}] Output:" - cat "test_results/${suite}_output.txt" - echo "============================" - done - name: Merge JUnit XML Reports run: | From 974e318226888ada35d41fab9bd1d09eb77a412c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:24:41 +0200 Subject: [PATCH 49/80] Try to fix formatting --- .github/workflows/smoke-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index d71f85a15b9..d3e8cbc333f 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -55,8 +55,7 @@ jobs: padding=" " fi cd ${suite}_tests - echo "[${suite^^}]${padding}" # Print the header - vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E 's/^/ /' # Indent the output + vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}]${padding}/" | sed -E "s/$/\n/" } # Run tests in parallel From d5142e3fb9fbd89df02a6fb43a0b6f58a5ee5b9c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:27:18 +0200 Subject: [PATCH 50/80] Revert "Try to fix formatting" This reverts commit c34993dc46f9d631ea468b3abe5316ad21de4ac3. --- .github/workflows/smoke-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index d3e8cbc333f..d71f85a15b9 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -55,7 +55,8 @@ jobs: padding=" " fi cd ${suite}_tests - vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}]${padding}/" | sed -E "s/$/\n/" + echo "[${suite^^}]${padding}" # Print the header + vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E 's/^/ /' # Indent the output } # Run tests in parallel From 7affb09302f0e82b595563f520027802f845accd Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:27:21 +0200 Subject: [PATCH 51/80] Revert "Fix live output formatting" This reverts commit ac1024ca09c6665d664cdefc621120f58e674d8c. --- .github/workflows/smoke-tests.yml | 35 +++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index d71f85a15b9..068f3e71c5d 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -40,7 +40,7 @@ jobs: run: | mkdir -p test_results - # Function to run tests + # Function to run tests and update progress run_tests() { local suite=$1 local testsuite=$2 @@ -49,25 +49,42 @@ jobs: padding=" " elif [ "$suite" == "feature_hyde" ]; then padding=" " + elif [ "$suite" == "feature_framework" ]; then + padding=" " elif [ "$suite" == "publications" ]; then padding=" " - elif [ "$suite" == "feature_framework" ]; then + elif [ "$suite" == "realtime_compiler" ]; then padding=" " fi cd ${suite}_tests - echo "[${suite^^}]${padding}" # Print the header - vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E 's/^/ /' # Indent the output + vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" > "../test_results/${suite}_output.txt" 2>&1 & + local pid=$! + echo -n "[${suite^^}]${padding}" + while kill -0 $pid 2>/dev/null; do + echo -n "." + sleep 0.1 + done + echo "" + wait $pid } # Run tests in parallel - (run_tests unit UnitFramework) & - (run_tests feature_hyde FeatureHyde) & - (run_tests feature_framework FeatureFramework) & - (run_tests publications Publications) & - (run_tests realtime_compiler "Realtime Compiler") & + run_tests unit UnitFramework & + run_tests feature_hyde FeatureHyde & + run_tests feature_framework FeatureFramework & + run_tests publications Publications & + run_tests realtime_compiler "Realtime Compiler" & # Wait for all background jobs to finish wait + + echo "Tests completed. Full output:" + echo "============================" + for suite in unit feature_hyde feature_framework publications realtime_compiler; do + echo "[${suite^^}] Output:" + cat "test_results/${suite}_output.txt" + echo "============================" + done - name: Merge JUnit XML Reports run: | From a132456c58380f29d8d78d63af6c1c8c7c4f4327 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:27:25 +0200 Subject: [PATCH 52/80] Revert "Improved live output" This reverts commit c40063f2a5aba6faca5aba7cadf46440511e5fbe. --- .github/workflows/smoke-tests.yml | 42 ++++++++----------------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 068f3e71c5d..21e95eb9adb 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -40,51 +40,29 @@ jobs: run: | mkdir -p test_results - # Function to run tests and update progress + # Function to run tests run_tests() { local suite=$1 local testsuite=$2 local padding="" if [ "$suite" == "unit" ]; then - padding=" " - elif [ "$suite" == "feature_hyde" ]; then - padding=" " - elif [ "$suite" == "feature_framework" ]; then - padding=" " - elif [ "$suite" == "publications" ]; then - padding=" " - elif [ "$suite" == "realtime_compiler" ]; then - padding=" " + padding=" " + elif [ "$suite" == "feature_hyde" ] || [ "$suite" == "publications" ]; then + padding=" " fi cd ${suite}_tests - vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" > "../test_results/${suite}_output.txt" 2>&1 & - local pid=$! - echo -n "[${suite^^}]${padding}" - while kill -0 $pid 2>/dev/null; do - echo -n "." - sleep 0.1 - done - echo "" - wait $pid + vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}]${padding} /" } # Run tests in parallel - run_tests unit UnitFramework & - run_tests feature_hyde FeatureHyde & - run_tests feature_framework FeatureFramework & - run_tests publications Publications & - run_tests realtime_compiler "Realtime Compiler" & + (run_tests unit UnitFramework) & + (run_tests feature_hyde FeatureHyde) & + (run_tests feature_framework FeatureFramework) & + (run_tests publications Publications) & + (run_tests realtime_compiler "Realtime Compiler") & # Wait for all background jobs to finish wait - - echo "Tests completed. Full output:" - echo "============================" - for suite in unit feature_hyde feature_framework publications realtime_compiler; do - echo "[${suite^^}] Output:" - cat "test_results/${suite}_output.txt" - echo "============================" - done - name: Merge JUnit XML Reports run: | From 60a8150c1e24bfc0a7e31c02ad012654cc19bb9a Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:28:10 +0200 Subject: [PATCH 53/80] Improved live output --- .github/workflows/smoke-tests.yml | 65 ++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 9 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 21e95eb9adb..6aa8c20963a 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -40,7 +40,7 @@ jobs: run: | mkdir -p test_results - # Function to run tests + # Function to run tests and update progress run_tests() { local suite=$1 local testsuite=$2 @@ -51,18 +51,65 @@ jobs: padding=" " fi cd ${suite}_tests - vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}]${padding} /" + vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | tee "../test_results/${suite}_output.log" | while IFS= read -r line; do + echo "." >> "../test_results/${suite}_progress.txt" + done & } - # Run tests in parallel - (run_tests unit UnitFramework) & - (run_tests feature_hyde FeatureHyde) & - (run_tests feature_framework FeatureFramework) & - (run_tests publications Publications) & - (run_tests realtime_compiler "Realtime Compiler") & + # Start all test suites + run_tests unit UnitFramework + run_tests feature_hyde FeatureHyde + run_tests feature_framework FeatureFramework + run_tests publications Publications + run_tests realtime_compiler "Realtime Compiler" - # Wait for all background jobs to finish + # Function to display progress + display_progress() { + while true; do + clear + echo "Test Progress:" + echo "[UNIT] $(cat test_results/unit_progress.txt 2>/dev/null || echo '')" + echo "[FEATURE_HYDE] $(cat test_results/feature_hyde_progress.txt 2>/dev/null || echo '')" + echo "[FEATURE_FRAMEWORK] $(cat test_results/feature_framework_progress.txt 2>/dev/null || echo '')" + echo "[PUBLICATIONS] $(cat test_results/publications_progress.txt 2>/dev/null || echo '')" + echo "[REALTIME_COMPILER] $(cat test_results/realtime_compiler_progress.txt 2>/dev/null || echo '')" + sleep 1 + done + } + + # Start progress display in background + display_progress & + display_pid=$! + + # Wait for all test suites to finish wait + + # Stop progress display + kill $display_pid + + # Display final progress + clear + echo "Final Test Progress:" + echo "[UNIT] $(cat test_results/unit_progress.txt 2>/dev/null || echo '')" + echo "[FEATURE_HYDE] $(cat test_results/feature_hyde_progress.txt 2>/dev/null || echo '')" + echo "[FEATURE_FRAMEWORK] $(cat test_results/feature_framework_progress.txt 2>/dev/null || echo '')" + echo "[PUBLICATIONS] $(cat test_results/publications_progress.txt 2>/dev/null || echo '')" + echo "[REALTIME_COMPILER] $(cat test_results/realtime_compiler_progress.txt 2>/dev/null || echo '')" + + - name: Display Unit Tests Output + run: cat test_results/unit_output.log + + - name: Display Feature Hyde Tests Output + run: cat test_results/feature_hyde_output.log + + - name: Display Feature Framework Tests Output + run: cat test_results/feature_framework_output.log + + - name: Display Publications Tests Output + run: cat test_results/publications_output.log + + - name: Display Realtime Compiler Tests Output + run: cat test_results/realtime_compiler_output.log - name: Merge JUnit XML Reports run: | From f4f15f84576e36659d30cfc9a7012a93e5e2ed68 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:31:28 +0200 Subject: [PATCH 54/80] Try to fix output --- .github/workflows/smoke-tests.yml | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 6aa8c20963a..209b9a947a4 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,7 +31,7 @@ jobs: - name: Prepare test directories run: | - for suite in unit feature_hyde feature_framework publications realtime_compiler; do + for suite in unit featurehyde featureframework publications realtimecompiler; do cp -R src ${suite}_tests done mv src/.git . @@ -46,8 +46,8 @@ jobs: local testsuite=$2 local padding="" if [ "$suite" == "unit" ]; then - padding=" " - elif [ "$suite" == "feature_hyde" ] || [ "$suite" == "publications" ]; then + padding=" " + elif [ "$suite" == "featurehyde" ] || [ "$suite" == "publications" ]; then padding=" " fi cd ${suite}_tests @@ -58,10 +58,10 @@ jobs: # Start all test suites run_tests unit UnitFramework - run_tests feature_hyde FeatureHyde - run_tests feature_framework FeatureFramework + run_tests featurehyde FeatureHyde + run_tests featureframework FeatureFramework run_tests publications Publications - run_tests realtime_compiler "Realtime Compiler" + run_tests realtimecompiler "Realtime Compiler" # Function to display progress display_progress() { @@ -69,10 +69,10 @@ jobs: clear echo "Test Progress:" echo "[UNIT] $(cat test_results/unit_progress.txt 2>/dev/null || echo '')" - echo "[FEATURE_HYDE] $(cat test_results/feature_hyde_progress.txt 2>/dev/null || echo '')" - echo "[FEATURE_FRAMEWORK] $(cat test_results/feature_framework_progress.txt 2>/dev/null || echo '')" + echo "[FEATURE_HYDE] $(cat test_results/featurehyde_progress.txt 2>/dev/null || echo '')" + echo "[FEATURE_FRAMEWORK] $(cat test_results/featureframework_progress.txt 2>/dev/null || echo '')" echo "[PUBLICATIONS] $(cat test_results/publications_progress.txt 2>/dev/null || echo '')" - echo "[REALTIME_COMPILER] $(cat test_results/realtime_compiler_progress.txt 2>/dev/null || echo '')" + echo "[REALTIME_COMPILER] $(cat test_results/realtimecompiler_progress.txt 2>/dev/null || echo '')" sleep 1 done } @@ -91,25 +91,25 @@ jobs: clear echo "Final Test Progress:" echo "[UNIT] $(cat test_results/unit_progress.txt 2>/dev/null || echo '')" - echo "[FEATURE_HYDE] $(cat test_results/feature_hyde_progress.txt 2>/dev/null || echo '')" - echo "[FEATURE_FRAMEWORK] $(cat test_results/feature_framework_progress.txt 2>/dev/null || echo '')" + echo "[FEATURE_HYDE] $(cat test_results/featurehyde_progress.txt 2>/dev/null || echo '')" + echo "[FEATURE_FRAMEWORK] $(cat test_results/featureframework_progress.txt 2>/dev/null || echo '')" echo "[PUBLICATIONS] $(cat test_results/publications_progress.txt 2>/dev/null || echo '')" - echo "[REALTIME_COMPILER] $(cat test_results/realtime_compiler_progress.txt 2>/dev/null || echo '')" + echo "[REALTIME_COMPILER] $(cat test_results/realtimecompiler_progress.txt 2>/dev/null || echo '')" - name: Display Unit Tests Output run: cat test_results/unit_output.log - name: Display Feature Hyde Tests Output - run: cat test_results/feature_hyde_output.log + run: cat test_results/featurehyde_output.log - name: Display Feature Framework Tests Output - run: cat test_results/feature_framework_output.log + run: cat test_results/featureframework_output.log - name: Display Publications Tests Output run: cat test_results/publications_output.log - name: Display Realtime Compiler Tests Output - run: cat test_results/realtime_compiler_output.log + run: cat test_results/realtimecompiler_output.log - name: Merge JUnit XML Reports run: | @@ -135,4 +135,4 @@ jobs: - name: Ping statistics server with test results run: | curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} + php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} \ No newline at end of file From 663bfb8731a1a91a4c4a79a0233ad4120a0b52b7 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:34:05 +0200 Subject: [PATCH 55/80] Revert "Try to fix output" This reverts commit d0d46108e356acb85b1cb0d9fb45afc6d0472070. --- .github/workflows/smoke-tests.yml | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 209b9a947a4..6aa8c20963a 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,7 +31,7 @@ jobs: - name: Prepare test directories run: | - for suite in unit featurehyde featureframework publications realtimecompiler; do + for suite in unit feature_hyde feature_framework publications realtime_compiler; do cp -R src ${suite}_tests done mv src/.git . @@ -46,8 +46,8 @@ jobs: local testsuite=$2 local padding="" if [ "$suite" == "unit" ]; then - padding=" " - elif [ "$suite" == "featurehyde" ] || [ "$suite" == "publications" ]; then + padding=" " + elif [ "$suite" == "feature_hyde" ] || [ "$suite" == "publications" ]; then padding=" " fi cd ${suite}_tests @@ -58,10 +58,10 @@ jobs: # Start all test suites run_tests unit UnitFramework - run_tests featurehyde FeatureHyde - run_tests featureframework FeatureFramework + run_tests feature_hyde FeatureHyde + run_tests feature_framework FeatureFramework run_tests publications Publications - run_tests realtimecompiler "Realtime Compiler" + run_tests realtime_compiler "Realtime Compiler" # Function to display progress display_progress() { @@ -69,10 +69,10 @@ jobs: clear echo "Test Progress:" echo "[UNIT] $(cat test_results/unit_progress.txt 2>/dev/null || echo '')" - echo "[FEATURE_HYDE] $(cat test_results/featurehyde_progress.txt 2>/dev/null || echo '')" - echo "[FEATURE_FRAMEWORK] $(cat test_results/featureframework_progress.txt 2>/dev/null || echo '')" + echo "[FEATURE_HYDE] $(cat test_results/feature_hyde_progress.txt 2>/dev/null || echo '')" + echo "[FEATURE_FRAMEWORK] $(cat test_results/feature_framework_progress.txt 2>/dev/null || echo '')" echo "[PUBLICATIONS] $(cat test_results/publications_progress.txt 2>/dev/null || echo '')" - echo "[REALTIME_COMPILER] $(cat test_results/realtimecompiler_progress.txt 2>/dev/null || echo '')" + echo "[REALTIME_COMPILER] $(cat test_results/realtime_compiler_progress.txt 2>/dev/null || echo '')" sleep 1 done } @@ -91,25 +91,25 @@ jobs: clear echo "Final Test Progress:" echo "[UNIT] $(cat test_results/unit_progress.txt 2>/dev/null || echo '')" - echo "[FEATURE_HYDE] $(cat test_results/featurehyde_progress.txt 2>/dev/null || echo '')" - echo "[FEATURE_FRAMEWORK] $(cat test_results/featureframework_progress.txt 2>/dev/null || echo '')" + echo "[FEATURE_HYDE] $(cat test_results/feature_hyde_progress.txt 2>/dev/null || echo '')" + echo "[FEATURE_FRAMEWORK] $(cat test_results/feature_framework_progress.txt 2>/dev/null || echo '')" echo "[PUBLICATIONS] $(cat test_results/publications_progress.txt 2>/dev/null || echo '')" - echo "[REALTIME_COMPILER] $(cat test_results/realtimecompiler_progress.txt 2>/dev/null || echo '')" + echo "[REALTIME_COMPILER] $(cat test_results/realtime_compiler_progress.txt 2>/dev/null || echo '')" - name: Display Unit Tests Output run: cat test_results/unit_output.log - name: Display Feature Hyde Tests Output - run: cat test_results/featurehyde_output.log + run: cat test_results/feature_hyde_output.log - name: Display Feature Framework Tests Output - run: cat test_results/featureframework_output.log + run: cat test_results/feature_framework_output.log - name: Display Publications Tests Output run: cat test_results/publications_output.log - name: Display Realtime Compiler Tests Output - run: cat test_results/realtimecompiler_output.log + run: cat test_results/realtime_compiler_output.log - name: Merge JUnit XML Reports run: | @@ -135,4 +135,4 @@ jobs: - name: Ping statistics server with test results run: | curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} \ No newline at end of file + php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} From eb3ff8738f66d2b7d2bcb684e77cb6165cd22d96 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:34:09 +0200 Subject: [PATCH 56/80] Revert "Improved live output" This reverts commit a2a5335bb7d38879329499e0d5a6e317be6f07d2. --- .github/workflows/smoke-tests.yml | 65 +++++-------------------------- 1 file changed, 9 insertions(+), 56 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 6aa8c20963a..21e95eb9adb 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -40,7 +40,7 @@ jobs: run: | mkdir -p test_results - # Function to run tests and update progress + # Function to run tests run_tests() { local suite=$1 local testsuite=$2 @@ -51,65 +51,18 @@ jobs: padding=" " fi cd ${suite}_tests - vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | tee "../test_results/${suite}_output.log" | while IFS= read -r line; do - echo "." >> "../test_results/${suite}_progress.txt" - done & + vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}]${padding} /" } - # Start all test suites - run_tests unit UnitFramework - run_tests feature_hyde FeatureHyde - run_tests feature_framework FeatureFramework - run_tests publications Publications - run_tests realtime_compiler "Realtime Compiler" + # Run tests in parallel + (run_tests unit UnitFramework) & + (run_tests feature_hyde FeatureHyde) & + (run_tests feature_framework FeatureFramework) & + (run_tests publications Publications) & + (run_tests realtime_compiler "Realtime Compiler") & - # Function to display progress - display_progress() { - while true; do - clear - echo "Test Progress:" - echo "[UNIT] $(cat test_results/unit_progress.txt 2>/dev/null || echo '')" - echo "[FEATURE_HYDE] $(cat test_results/feature_hyde_progress.txt 2>/dev/null || echo '')" - echo "[FEATURE_FRAMEWORK] $(cat test_results/feature_framework_progress.txt 2>/dev/null || echo '')" - echo "[PUBLICATIONS] $(cat test_results/publications_progress.txt 2>/dev/null || echo '')" - echo "[REALTIME_COMPILER] $(cat test_results/realtime_compiler_progress.txt 2>/dev/null || echo '')" - sleep 1 - done - } - - # Start progress display in background - display_progress & - display_pid=$! - - # Wait for all test suites to finish + # Wait for all background jobs to finish wait - - # Stop progress display - kill $display_pid - - # Display final progress - clear - echo "Final Test Progress:" - echo "[UNIT] $(cat test_results/unit_progress.txt 2>/dev/null || echo '')" - echo "[FEATURE_HYDE] $(cat test_results/feature_hyde_progress.txt 2>/dev/null || echo '')" - echo "[FEATURE_FRAMEWORK] $(cat test_results/feature_framework_progress.txt 2>/dev/null || echo '')" - echo "[PUBLICATIONS] $(cat test_results/publications_progress.txt 2>/dev/null || echo '')" - echo "[REALTIME_COMPILER] $(cat test_results/realtime_compiler_progress.txt 2>/dev/null || echo '')" - - - name: Display Unit Tests Output - run: cat test_results/unit_output.log - - - name: Display Feature Hyde Tests Output - run: cat test_results/feature_hyde_output.log - - - name: Display Feature Framework Tests Output - run: cat test_results/feature_framework_output.log - - - name: Display Publications Tests Output - run: cat test_results/publications_output.log - - - name: Display Realtime Compiler Tests Output - run: cat test_results/realtime_compiler_output.log - name: Merge JUnit XML Reports run: | From 3726e0163c13c4856d6c1aaa4d4113fac701c4c9 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:36:30 +0200 Subject: [PATCH 57/80] Improved live output --- .github/workflows/smoke-tests.yml | 40 +++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 21e95eb9adb..b9ff44ea581 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -39,8 +39,9 @@ jobs: - name: Execute Tests in Parallel run: | mkdir -p test_results - - # Function to run tests + mkdir -p test_outputs + + # Function to run tests and update progress run_tests() { local suite=$1 local testsuite=$2 @@ -51,7 +52,23 @@ jobs: padding=" " fi cd ${suite}_tests - vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | sed -E "s/^/[${suite^^}]${padding} /" + vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | tee "../test_outputs/${suite}.log" | while IFS= read -r line + do + echo "." >> "../test_outputs/${suite}.progress" + tput cup 0 0 + echo -e "\033[2J" # Clear the screen + for s in unit feature_hyde feature_framework publications realtime_compiler; do + local p="" + if [ "$s" == "unit" ]; then + p=" " + elif [ "$s" == "feature_hyde" ] || [ "$s" == "publications" ]; then + p=" " + fi + echo -n "[${s^^}]${p} " + cat "../test_outputs/${s}.progress" 2>/dev/null || echo -n "" + echo "" + done + done } # Run tests in parallel @@ -64,6 +81,21 @@ jobs: # Wait for all background jobs to finish wait + - name: Display Unit Tests Output + run: cat test_outputs/unit.log + + - name: Display Feature Hyde Tests Output + run: cat test_outputs/feature_hyde.log + + - name: Display Feature Framework Tests Output + run: cat test_outputs/feature_framework.log + + - name: Display Publications Tests Output + run: cat test_outputs/publications.log + + - name: Display Realtime Compiler Tests Output + run: cat test_outputs/realtime_compiler.log + - name: Merge JUnit XML Reports run: | php -r ' @@ -88,4 +120,4 @@ jobs: - name: Ping statistics server with test results run: | curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} + php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} \ No newline at end of file From fa5a29abcc2c8d0e99f5e3c682f5927db0c1d641 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:37:47 +0200 Subject: [PATCH 58/80] Lower level updates --- .github/workflows/smoke-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index b9ff44ea581..8605bdec072 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -55,8 +55,7 @@ jobs: vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | tee "../test_outputs/${suite}.log" | while IFS= read -r line do echo "." >> "../test_outputs/${suite}.progress" - tput cup 0 0 - echo -e "\033[2J" # Clear the screen + echo -e "\n\n\n\n\n" # Print 5 newlines to separate outputs for s in unit feature_hyde feature_framework publications realtime_compiler; do local p="" if [ "$s" == "unit" ]; then From cd78f91110a3ac27ac1c80fb7e743863a3c98eb4 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:40:20 +0200 Subject: [PATCH 59/80] Simplify output --- .github/workflows/smoke-tests.yml | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 8605bdec072..aed31f1e565 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -41,33 +41,14 @@ jobs: mkdir -p test_results mkdir -p test_outputs - # Function to run tests and update progress + # Function to run tests run_tests() { local suite=$1 local testsuite=$2 - local padding="" - if [ "$suite" == "unit" ]; then - padding=" " - elif [ "$suite" == "feature_hyde" ] || [ "$suite" == "publications" ]; then - padding=" " - fi + echo "${suite^} tests started" cd ${suite}_tests - vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" 2>&1 | tee "../test_outputs/${suite}.log" | while IFS= read -r line - do - echo "." >> "../test_outputs/${suite}.progress" - echo -e "\n\n\n\n\n" # Print 5 newlines to separate outputs - for s in unit feature_hyde feature_framework publications realtime_compiler; do - local p="" - if [ "$s" == "unit" ]; then - p=" " - elif [ "$s" == "feature_hyde" ] || [ "$s" == "publications" ]; then - p=" " - fi - echo -n "[${s^^}]${p} " - cat "../test_outputs/${s}.progress" 2>/dev/null || echo -n "" - echo "" - done - done + vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" > "../test_outputs/${suite}.log" 2>&1 + echo "${suite^} tests completed" } # Run tests in parallel @@ -119,4 +100,4 @@ jobs: - name: Ping statistics server with test results run: | curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} \ No newline at end of file + php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} From 66c9d1f15f1dccd15c879bb3c02909a1c2541e84 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:43:31 +0200 Subject: [PATCH 60/80] Optimize directory setup --- .github/workflows/smoke-tests.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index aed31f1e565..e5a672d1a38 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,10 +31,29 @@ jobs: - name: Prepare test directories run: | + # Move .git directory out of src + mv src/.git . + + # Create a base test directory + mkdir base_test + + # Move essential files and directories + mv src/{composer.json,composer.lock,vendor,tests} base_test/ + + # Create symlinks for other directories + for dir in src/*; do + if [ -d "$dir" ]; then + ln -s "../src/$(basename $dir)" "base_test/$(basename $dir)" + fi + done + + # Create test suite directories for suite in unit feature_hyde feature_framework publications realtime_compiler; do - cp -R src ${suite}_tests + cp -R base_test ${suite}_tests done - mv src/.git . + + # Clean up + rm -rf base_test - name: Execute Tests in Parallel run: | From ecd4ffe60d56044ad1745c01f425f62442dbcb04 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:44:29 +0200 Subject: [PATCH 61/80] Revert "Optimize directory setup" This reverts commit 07522a15aee81bbd4b36808e54ea6b0369e7c443. --- .github/workflows/smoke-tests.yml | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index e5a672d1a38..aed31f1e565 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,29 +31,10 @@ jobs: - name: Prepare test directories run: | - # Move .git directory out of src - mv src/.git . - - # Create a base test directory - mkdir base_test - - # Move essential files and directories - mv src/{composer.json,composer.lock,vendor,tests} base_test/ - - # Create symlinks for other directories - for dir in src/*; do - if [ -d "$dir" ]; then - ln -s "../src/$(basename $dir)" "base_test/$(basename $dir)" - fi - done - - # Create test suite directories for suite in unit feature_hyde feature_framework publications realtime_compiler; do - cp -R base_test ${suite}_tests + cp -R src ${suite}_tests done - - # Clean up - rm -rf base_test + mv src/.git . - name: Execute Tests in Parallel run: | From 304d96437eab7a0fe1c4ce208f2f69a53d4dc4fa Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:47:39 +0200 Subject: [PATCH 62/80] Optimize directory setup --- .github/workflows/smoke-tests.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index aed31f1e565..b813db8d5c0 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,9 +31,31 @@ jobs: - name: Prepare test directories run: | + # Create a shared vendor directory + mkdir shared_vendor + mv src/vendor shared_vendor/vendor + + # Function to create test directory + create_test_dir() { + local suite=$1 + mkdir ${suite}_tests + cd ${suite}_tests + + # Copy necessary files and directories + cp -R ../src/{app,config,packages,resources,tests,composer.json,composer.lock,phpunit.xml.dist} . + + # Symlink the vendor directory + ln -s ../shared_vendor/vendor vendor + + cd .. + } + + # Create test directories for each suite for suite in unit feature_hyde feature_framework publications realtime_compiler; do - cp -R src ${suite}_tests + create_test_dir $suite done + + # Move .git directory to the root of the working directory mv src/.git . - name: Execute Tests in Parallel From 78793c6e4ce749e674f6f923f83773d48ea405a3 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:49:14 +0200 Subject: [PATCH 63/80] Fix setup syntax --- .github/workflows/smoke-tests.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index b813db8d5c0..30584c66c74 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,21 +31,17 @@ jobs: - name: Prepare test directories run: | - # Create a shared vendor directory - mkdir shared_vendor - mv src/vendor shared_vendor/vendor - # Function to create test directory create_test_dir() { local suite=$1 - mkdir ${suite}_tests + cp -R src ${suite}_tests cd ${suite}_tests - # Copy necessary files and directories - cp -R ../src/{app,config,packages,resources,tests,composer.json,composer.lock,phpunit.xml.dist} . + # Remove vendor directory + rm -rf vendor - # Symlink the vendor directory - ln -s ../shared_vendor/vendor vendor + # Create hard link to vendor directory + ln ../src/vendor vendor cd .. } From 621df92a849be83abb7d1803ae2608165296bab7 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:50:37 +0200 Subject: [PATCH 64/80] Revert "Fix setup syntax" This reverts commit abf8dae9ec1bcb26576c346bcfaae94db0052c30. --- .github/workflows/smoke-tests.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 30584c66c74..b813db8d5c0 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,17 +31,21 @@ jobs: - name: Prepare test directories run: | + # Create a shared vendor directory + mkdir shared_vendor + mv src/vendor shared_vendor/vendor + # Function to create test directory create_test_dir() { local suite=$1 - cp -R src ${suite}_tests + mkdir ${suite}_tests cd ${suite}_tests - # Remove vendor directory - rm -rf vendor + # Copy necessary files and directories + cp -R ../src/{app,config,packages,resources,tests,composer.json,composer.lock,phpunit.xml.dist} . - # Create hard link to vendor directory - ln ../src/vendor vendor + # Symlink the vendor directory + ln -s ../shared_vendor/vendor vendor cd .. } From 22e6dc640867a890b7f79901de4cb118eb0ed7e2 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:51:31 +0200 Subject: [PATCH 65/80] Revert "Optimize directory setup" This reverts commit e3b622c85395029a6ad838ea000c359acd77a146. --- .github/workflows/smoke-tests.yml | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index b813db8d5c0..aed31f1e565 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,31 +31,9 @@ jobs: - name: Prepare test directories run: | - # Create a shared vendor directory - mkdir shared_vendor - mv src/vendor shared_vendor/vendor - - # Function to create test directory - create_test_dir() { - local suite=$1 - mkdir ${suite}_tests - cd ${suite}_tests - - # Copy necessary files and directories - cp -R ../src/{app,config,packages,resources,tests,composer.json,composer.lock,phpunit.xml.dist} . - - # Symlink the vendor directory - ln -s ../shared_vendor/vendor vendor - - cd .. - } - - # Create test directories for each suite for suite in unit feature_hyde feature_framework publications realtime_compiler; do - create_test_dir $suite + cp -R src ${suite}_tests done - - # Move .git directory to the root of the working directory mv src/.git . - name: Execute Tests in Parallel From 617ca24624a876de65460674664577fcc5dc89e0 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:52:51 +0200 Subject: [PATCH 66/80] Time the directory setups --- .github/workflows/smoke-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index aed31f1e565..14455616088 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -32,9 +32,9 @@ jobs: - name: Prepare test directories run: | for suite in unit feature_hyde feature_framework publications realtime_compiler; do - cp -R src ${suite}_tests + time cp -R src ${suite}_tests done - mv src/.git . + time mv src/.git . - name: Execute Tests in Parallel run: | From 241a472a08a6587cd67c5ba5159266a65baeee17 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:55:25 +0200 Subject: [PATCH 67/80] Run directory setup in parallel --- .github/workflows/smoke-tests.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 14455616088..1771039368c 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,10 +31,20 @@ jobs: - name: Prepare test directories run: | + echo "Starting directory preparation" + start_time=$(date +%s%N) + for suite in unit feature_hyde feature_framework publications realtime_compiler; do - time cp -R src ${suite}_tests + cp -R src ${suite}_tests & done - time mv src/.git . + + wait + + mv src/.git . + + end_time=$(date +%s%N) + duration=$(( (end_time - start_time) / 1000000 )) + echo "Directory preparation completed in $duration milliseconds" - name: Execute Tests in Parallel run: | From e908729b3c0384740f5707813b53dadb7e9b3d16 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:57:22 +0200 Subject: [PATCH 68/80] Create symbolic links for other test directories --- .github/workflows/smoke-tests.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 1771039368c..a42c1688aa6 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -34,12 +34,15 @@ jobs: echo "Starting directory preparation" start_time=$(date +%s%N) + # Create a single copy of the source + cp -R src test_base + + # Create symbolic links for other test directories for suite in unit feature_hyde feature_framework publications realtime_compiler; do - cp -R src ${suite}_tests & + ln -s test_base ${suite}_tests done - wait - + # Move .git directory mv src/.git . end_time=$(date +%s%N) From 4336f240cad5abbe6c497f3c7cfdc3bd63ce9908 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 15:59:57 +0200 Subject: [PATCH 69/80] Remove stop on failure --- .github/workflows/smoke-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index a42c1688aa6..38e7003160f 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -60,7 +60,7 @@ jobs: local testsuite=$2 echo "${suite^} tests started" cd ${suite}_tests - vendor/bin/pest --colors=always --stop-on-failure --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" > "../test_outputs/${suite}.log" 2>&1 + vendor/bin/pest --colors=always --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" > "../test_outputs/${suite}.log" 2>&1 echo "${suite^} tests completed" } From c412684c87f3d78c286f9c146e4c82883f4dbaea Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 16:01:02 +0200 Subject: [PATCH 70/80] Fix formatting --- .github/workflows/smoke-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 38e7003160f..d3b235fd805 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -39,7 +39,7 @@ jobs: # Create symbolic links for other test directories for suite in unit feature_hyde feature_framework publications realtime_compiler; do - ln -s test_base ${suite}_tests + ln -s test_base ${suite}_tests done # Move .git directory From 347fe9e387ecee5bb58cdd8a2f823444474cc8a3 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 16:01:14 +0200 Subject: [PATCH 71/80] Fail when a test fails --- .github/workflows/smoke-tests.yml | 42 +++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index d3b235fd805..6b48a089c37 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -60,36 +60,57 @@ jobs: local testsuite=$2 echo "${suite^} tests started" cd ${suite}_tests - vendor/bin/pest --colors=always --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" > "../test_outputs/${suite}.log" 2>&1 - echo "${suite^} tests completed" + if vendor/bin/pest --colors=always --log-junit="../test_results/${suite}_junit.xml" --testsuite="$testsuite" > "../test_outputs/${suite}.log" 2>&1; then + echo "${suite^} tests completed successfully" + else + echo "${suite^} tests failed" + return 1 + fi } - # Run tests in parallel - (run_tests unit UnitFramework) & - (run_tests feature_hyde FeatureHyde) & - (run_tests feature_framework FeatureFramework) & - (run_tests publications Publications) & - (run_tests realtime_compiler "Realtime Compiler") & + # Run tests in parallel and capture exit codes + run_tests unit UnitFramework & pid1=$! + run_tests feature_hyde FeatureHyde & pid2=$! + run_tests feature_framework FeatureFramework & pid3=$! + run_tests publications Publications & pid4=$! + run_tests realtime_compiler "Realtime Compiler" & pid5=$! - # Wait for all background jobs to finish - wait + # Wait for all background jobs to finish and capture exit codes + wait $pid1 || echo "Unit tests failed" >> test_failures + wait $pid2 || echo "Feature Hyde tests failed" >> test_failures + wait $pid3 || echo "Feature Framework tests failed" >> test_failures + wait $pid4 || echo "Publications tests failed" >> test_failures + wait $pid5 || echo "Realtime Compiler tests failed" >> test_failures + + # Check if any tests failed + if [ -f test_failures ]; then + echo "The following test suites failed:" + cat test_failures + exit 1 + fi - name: Display Unit Tests Output + if: always() run: cat test_outputs/unit.log - name: Display Feature Hyde Tests Output + if: always() run: cat test_outputs/feature_hyde.log - name: Display Feature Framework Tests Output + if: always() run: cat test_outputs/feature_framework.log - name: Display Publications Tests Output + if: always() run: cat test_outputs/publications.log - name: Display Realtime Compiler Tests Output + if: always() run: cat test_outputs/realtime_compiler.log - name: Merge JUnit XML Reports + if: always() run: | php -r ' $files = glob("test_results/*_junit.xml"); @@ -111,6 +132,7 @@ jobs: ' - name: Ping statistics server with test results + if: always() run: | curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} From da0337c3b09ac7d146b40cfc81aa09633977dd02 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 16:02:10 +0200 Subject: [PATCH 72/80] Revert "Fix formatting" This reverts commit be572a23046f8a86a3e9ec96f58c843a1d511ea4. --- .github/workflows/smoke-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 6b48a089c37..db1e64e43dc 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -39,7 +39,7 @@ jobs: # Create symbolic links for other test directories for suite in unit feature_hyde feature_framework publications realtime_compiler; do - ln -s test_base ${suite}_tests + ln -s test_base ${suite}_tests done # Move .git directory From 562e50cc38843014749dafa62630c8d458a6ceda Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 16:02:13 +0200 Subject: [PATCH 73/80] Revert "Create symbolic links for other test directories" This reverts commit c3b13a5d22891dfa8cefaf139436d8277affc10b. --- .github/workflows/smoke-tests.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index db1e64e43dc..ffd3028f251 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -34,15 +34,12 @@ jobs: echo "Starting directory preparation" start_time=$(date +%s%N) - # Create a single copy of the source - cp -R src test_base - - # Create symbolic links for other test directories for suite in unit feature_hyde feature_framework publications realtime_compiler; do - ln -s test_base ${suite}_tests + cp -R src ${suite}_tests & done - # Move .git directory + wait + mv src/.git . end_time=$(date +%s%N) From 0ab60cf2a8dec3a5331e0ea0486c24042123e3c4 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 16:02:17 +0200 Subject: [PATCH 74/80] Revert "Run directory setup in parallel" This reverts commit e3c869cc7c0739a7c5c77647135c63b23c623275. --- .github/workflows/smoke-tests.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index ffd3028f251..e821199891a 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,20 +31,10 @@ jobs: - name: Prepare test directories run: | - echo "Starting directory preparation" - start_time=$(date +%s%N) - for suite in unit feature_hyde feature_framework publications realtime_compiler; do - cp -R src ${suite}_tests & + time cp -R src ${suite}_tests done - - wait - - mv src/.git . - - end_time=$(date +%s%N) - duration=$(( (end_time - start_time) / 1000000 )) - echo "Directory preparation completed in $duration milliseconds" + time mv src/.git . - name: Execute Tests in Parallel run: | From 9d44f4fe7b51caefa26340b8d5980420398ccfe3 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 16:04:37 +0200 Subject: [PATCH 75/80] Setup directories with parallel rsync --- .github/workflows/smoke-tests.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index e821199891a..b5409046c00 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -31,11 +31,21 @@ jobs: - name: Prepare test directories run: | + setup_directory() { + local suite=$1 + time rsync -a --delete src/ ${suite}_tests/ + } + for suite in unit feature_hyde feature_framework publications realtime_compiler; do - time cp -R src ${suite}_tests + setup_directory $suite & done + + wait + time mv src/.git . + echo "Directory setup completed" + - name: Execute Tests in Parallel run: | mkdir -p test_results From 281afeab7b927b99fad75dd432a60707bd6cf2c8 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 16:07:28 +0200 Subject: [PATCH 76/80] Setup directories with parallel copy --- .github/workflows/smoke-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index b5409046c00..dfb0e20a672 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -33,7 +33,7 @@ jobs: run: | setup_directory() { local suite=$1 - time rsync -a --delete src/ ${suite}_tests/ + time cp -R src/ ${suite}_tests/ } for suite in unit feature_hyde feature_framework publications realtime_compiler; do From abf8d92ac6140dd7f33e6a1e901d51d033978856 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 16:10:59 +0200 Subject: [PATCH 77/80] Create hard links for all suites --- .github/workflows/smoke-tests.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index dfb0e20a672..1f1a55c6e45 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -33,17 +33,18 @@ jobs: run: | setup_directory() { local suite=$1 - time cp -R src/ ${suite}_tests/ + mkdir -p "${suite}_tests" + cp -al src/ "${suite}_tests/" } - + + # Create hard links for all suites for suite in unit feature_hyde feature_framework publications realtime_compiler; do - setup_directory $suite & + setup_directory $suite done - - wait - - time mv src/.git . - + + # Move the .git directory out of src + mv src/.git . + echo "Directory setup completed" - name: Execute Tests in Parallel From d23e013d9a80131c60fd0b8848bbaeecf8ff73e3 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 16:12:22 +0200 Subject: [PATCH 78/80] Move Composer validation to coverage testing workflow --- .github/workflows/coverage-tests.yml | 3 +++ .github/workflows/smoke-tests.yml | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml index 2a5170486cf..9c113cda05b 100644 --- a/.github/workflows/coverage-tests.yml +++ b/.github/workflows/coverage-tests.yml @@ -14,6 +14,9 @@ jobs: extensions: fileinfo - uses: actions/checkout@v4 + - name: Validate composer.json and composer.lock + run: composer validate --strict --no-check-all + - name: Cache Composer packages id: composer-cache uses: actions/cache@v4 diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 1f1a55c6e45..8d5ca28ac60 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -12,10 +12,6 @@ jobs: with: path: src - - name: Validate composer.json and composer.lock - run: | - cd src && composer validate --strict --no-check-all - - name: Cache Composer packages id: composer-cache uses: actions/cache@v4 From b0af9e5e90b21de6764212244f5736105a1e77e4 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 16:15:21 +0200 Subject: [PATCH 79/80] Formatting --- .github/workflows/smoke-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 8d5ca28ac60..04a925221c1 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -30,12 +30,12 @@ jobs: setup_directory() { local suite=$1 mkdir -p "${suite}_tests" - cp -al src/ "${suite}_tests/" + cp -al src/. "${suite}_tests/" } # Create hard links for all suites for suite in unit feature_hyde feature_framework publications realtime_compiler; do - setup_directory $suite + setup_directory $suite done # Move the .git directory out of src From a180d59f2b68f5ea6b795e5e1fccf8f66309a5ed Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 2 Aug 2024 16:18:32 +0200 Subject: [PATCH 80/80] Cleanup workflow --- .github/workflows/smoke-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 04a925221c1..bfe37f4a11a 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -40,8 +40,6 @@ jobs: # Move the .git directory out of src mv src/.git . - - echo "Directory setup completed" - name: Execute Tests in Parallel run: |