From c55e573957508581e51ea1ef43e4770d80c9607e Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Wed, 5 Jun 2024 11:24:22 +0700 Subject: [PATCH 1/9] Run Playwright and dotnet tests in parallel in CI --- .github/workflows/integration-test.yaml | 35 +++++++++++++++---------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 92d38cdac..45be60a9e 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -48,6 +48,10 @@ jobs: name: Test ${{ inputs.runs-on }} for Mercurial ${{ inputs.hg-version }} on ${{ inputs.environment }} permissions: checks: write + strategy: + fail-fast: false + matrix: + test: [ dotnet, playwright ] environment: name: ${{ inputs.environment }} runs-on: ${{ inputs.runs-on }} @@ -70,38 +74,40 @@ jobs: pwsh #validate that powershell installed correctly # First we need to setup Node... - uses: actions/setup-node@v4 - if: ${{ inputs.run-playwright }} + if: ${{ matrix.test == 'playwright' && inputs.run-playwright }} with: node-version-file: 'frontend/package.json' # Then we can set up pnpm... - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 - if: ${{ inputs.run-playwright }} + if: ${{ matrix.test == 'playwright' && inputs.run-playwright }} with: package_json_file: 'frontend/package.json' - # Then we can have Noede set up package caching + # Then we can have Node set up package caching - uses: actions/setup-node@v4 - if: ${{ inputs.run-playwright }} + if: ${{ matrix.test == 'playwright' && inputs.run-playwright }} with: node-version-file: 'frontend/package.json' cache: 'pnpm' cache-dependency-path: 'frontend/pnpm-lock.yaml' - uses: actions/setup-dotnet@v4 + if: ${{ matrix.test == 'dotnet' }} env: DOTNET_INSTALL_DIR: ${{ inputs.runs-on == 'self-hosted' && '/opt/hostedtoolcache/dotnet' || '' }} #poor man's conditional with: dotnet-version: '8.x' - uses: MatteoH2O1999/setup-python@429b7dee8a48c31eb72ce0b420ea938ff51c2f11 # v3.2.1 id: python - if: ${{ inputs.runs-on != 'windows-latest' && !env.act && inputs.hg-version == '3' }} + if: ${{ matrix.test == 'dotnet' && inputs.runs-on != 'windows-latest' && !env.act && inputs.hg-version == '3' }} with: python-version: '2.7.18' cache-build: true allow-build: allow - name: Link python - if: ${{ inputs.runs-on != 'windows-latest' && inputs.hg-version == '3' }} + if: ${{ matrix.test == 'dotnet' && inputs.runs-on != 'windows-latest' && inputs.hg-version == '3' }} run: | sudo ln -s ${{ steps.python.outputs.python-path }} /usr/bin/python2 - name: Dotnet build + if: ${{ matrix.test == 'dotnet' }} # limit cpu count for self-hosted due to memory constraints run: dotnet build ${{ inputs.runs-on == 'self-hosted' && '-maxcpucount:2' || '' }} # TODO: Set up caching for /home/runner/.cache/ms-playwright so this doesn't take as long @@ -110,19 +116,20 @@ jobs: # TODO: Ditto for /var/cache/apt/archives/ - name: Playwright setup working-directory: frontend - if: ${{ inputs.run-playwright }} + if: ${{ matrix.test == 'playwright' && inputs.run-playwright }} run: pnpm install && pnpm pretest - name: Set up Playwright dependencies working-directory: frontend - if: ${{ inputs.run-playwright && inputs.runs-on == 'self-hosted' }} + if: ${{ matrix.test == 'playwright' && inputs.run-playwright && inputs.runs-on == 'self-hosted' }} run: sudo pnpm exec playwright install-deps - name: Build for tests + if: ${{ matrix.test == 'dotnet' }} run: "dotnet build /p:MercurialVersion=$MERCURIAL_VERSION" env: MERCURIAL_VERSION: ${{ inputs.hg-version }} - name: Integration tests (Playwright) - if: ${{ inputs.run-playwright }} + if: ${{ matrix.test == 'playwright' && inputs.run-playwright }} env: TEST_SERVER_HOSTNAME: ${{ vars.TEST_SERVER_HOSTNAME }} # this is not a typo, we need to use the lf domain because it has a cert that hg will validate @@ -134,7 +141,7 @@ jobs: run: pnpm test - name: Integration tests (.NET) - if: always() + if: ${{ matrix.test == 'dotnet' }} env: TEST_SERVER_HOSTNAME: ${{ vars.TEST_SERVER_HOSTNAME }} # this is not a typo, we need to use the lf domain because it has a cert that hg will validate @@ -150,22 +157,22 @@ jobs: - name: Password protect Playwright traces id: password_protect_test_results - if: ${{ always() && inputs.run-playwright }} + if: ${{ always() && matrix.test == 'playwright' && inputs.run-playwright }} shell: bash env: ZIP_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }} run: 7z a ./playwright-traces.7z -mx=0 -mmt=off ./frontend/test-results -p"$ZIP_PASSWORD" - name: Publish unit test results uses: EnricoMi/publish-unit-test-result-action/composite@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0 - if: ${{ always() && !env.act }} + if: ${{ always() && matrix.test == 'dotnet' && !env.act }} with: check_name: Integration Tests ${{ inputs.runs-on }} for Mercurial ${{ inputs.hg-version }} files: ./test-results/*.trx - name: Publish results to testspace - if: always() + if: ${{ always() && matrix.test == 'dotnet' }} run: testspace "[.Net Integration/$${{ inputs.runs-on }} HG ${{ inputs.hg-version }}]./test-results/*.trx" "[Playwright]./frontend/test-results/*.xml" - name: Upload playwright results - if: ${{ always() && steps.password_protect_test_results.outcome == 'success' }} + if: ${{ always() && matrix.test == 'playwright' && inputs.run-playwright && steps.password_protect_test_results.outcome == 'success' }} uses: actions/upload-artifact@v4 with: name: playwright-traces-${{ inputs.runs-on }}-hg-${{ inputs.hg-version }} From 76b9cdaac6d9b620cdad8ef10706fde619c543be Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Wed, 5 Jun 2024 11:52:20 +0700 Subject: [PATCH 2/9] Job names reflect dotnet or Playwright tests --- .github/workflows/integration-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 45be60a9e..6609d6da3 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -45,7 +45,7 @@ on: jobs: test: timeout-minutes: 120 - name: Test ${{ inputs.runs-on }} for Mercurial ${{ inputs.hg-version }} on ${{ inputs.environment }} + name: ${{ matrix.test }} tests for HG ${{ inputs.hg-version }} permissions: checks: write strategy: From 74c8b753e6515234080dc9b8daea3800eb9a7b2a Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Wed, 12 Jun 2024 15:12:56 +0700 Subject: [PATCH 3/9] Split into two separate jobs --- .github/workflows/integration-test.yaml | 131 ++++++++++++++---------- 1 file changed, 78 insertions(+), 53 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 6609d6da3..9618fa4af 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -42,16 +42,17 @@ on: default: true type: boolean +# TODO: Set up caching for /home/runner/.cache/ms-playwright +# TODO: Ditto for /home/runner/.pnpm-store/v3 +# TODO: Ditto for /home/runner/.nuget/packages +# TODO: Ditto for /var/cache/apt/archives/ + jobs: - test: + dotnet-test: timeout-minutes: 120 - name: ${{ matrix.test }} tests for HG ${{ inputs.hg-version }} + name: Dotnet tests on ${{ inputs.runs-on }} for Mercurial ${{ inputs.hg-version }} on ${{ inputs.environment }} permissions: checks: write - strategy: - fail-fast: false - matrix: - test: [ dotnet, playwright ] environment: name: ${{ inputs.environment }} runs-on: ${{ inputs.runs-on }} @@ -72,64 +73,32 @@ jobs: sudo apt-get install -f rm powershell_7.4.1-1.deb_amd64.deb pwsh #validate that powershell installed correctly - # First we need to setup Node... - - uses: actions/setup-node@v4 - if: ${{ matrix.test == 'playwright' && inputs.run-playwright }} - with: - node-version-file: 'frontend/package.json' - # Then we can set up pnpm... - - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 - if: ${{ matrix.test == 'playwright' && inputs.run-playwright }} - with: - package_json_file: 'frontend/package.json' - # Then we can have Node set up package caching - - uses: actions/setup-node@v4 - if: ${{ matrix.test == 'playwright' && inputs.run-playwright }} - with: - node-version-file: 'frontend/package.json' - cache: 'pnpm' - cache-dependency-path: 'frontend/pnpm-lock.yaml' - uses: actions/setup-dotnet@v4 - if: ${{ matrix.test == 'dotnet' }} env: DOTNET_INSTALL_DIR: ${{ inputs.runs-on == 'self-hosted' && '/opt/hostedtoolcache/dotnet' || '' }} #poor man's conditional with: dotnet-version: '8.x' - uses: MatteoH2O1999/setup-python@429b7dee8a48c31eb72ce0b420ea938ff51c2f11 # v3.2.1 id: python - if: ${{ matrix.test == 'dotnet' && inputs.runs-on != 'windows-latest' && !env.act && inputs.hg-version == '3' }} + if: ${{ inputs.runs-on != 'windows-latest' && !env.act && inputs.hg-version == '3' }} with: python-version: '2.7.18' cache-build: true allow-build: allow - name: Link python - if: ${{ matrix.test == 'dotnet' && inputs.runs-on != 'windows-latest' && inputs.hg-version == '3' }} + if: ${{ inputs.runs-on != 'windows-latest' && inputs.hg-version == '3' }} run: | sudo ln -s ${{ steps.python.outputs.python-path }} /usr/bin/python2 - name: Dotnet build - if: ${{ matrix.test == 'dotnet' }} # limit cpu count for self-hosted due to memory constraints run: dotnet build ${{ inputs.runs-on == 'self-hosted' && '-maxcpucount:2' || '' }} - # TODO: Set up caching for /home/runner/.cache/ms-playwright so this doesn't take as long - # TODO: Ditto for /home/runner/.pnpm-store/v3 - # TODO: Ditto for /home/runner/.nuget/packages - # TODO: Ditto for /var/cache/apt/archives/ - - name: Playwright setup - working-directory: frontend - if: ${{ matrix.test == 'playwright' && inputs.run-playwright }} - run: pnpm install && pnpm pretest - - name: Set up Playwright dependencies - working-directory: frontend - if: ${{ matrix.test == 'playwright' && inputs.run-playwright && inputs.runs-on == 'self-hosted' }} - run: sudo pnpm exec playwright install-deps - name: Build for tests - if: ${{ matrix.test == 'dotnet' }} run: "dotnet build /p:MercurialVersion=$MERCURIAL_VERSION" env: MERCURIAL_VERSION: ${{ inputs.hg-version }} - - name: Integration tests (Playwright) - if: ${{ matrix.test == 'playwright' && inputs.run-playwright }} + - name: Integration tests (.NET) + if: ${{ matrix.test == 'dotnet' }} env: TEST_SERVER_HOSTNAME: ${{ vars.TEST_SERVER_HOSTNAME }} # this is not a typo, we need to use the lf domain because it has a cert that hg will validate @@ -137,11 +106,65 @@ jobs: TEST_RESUMABLE_HG_HOSTNAME: ${{ vars.TEST_RESUMABLE_HG_HOSTNAME }} TEST_PROJECT_CODE: 'sena-3' TEST_DEFAULT_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }} + # 1.5gb max heap size, must be in hex https://learn.microsoft.com/en-us/dotnet/core/runtime-config/garbage-collector#heap-limit + # the self hosted runner only has 2gb so this should prevent it from running out of memory + DOTNET_GCHeapHardLimit: '0x2CB417800' + + run: dotnet test --output ./bin --logger trx --results-directory ./test-results --filter Category=Integration + + playwright-test: + timeout-minutes: 120 + name: Playwright tests on ${{ inputs.runs-on }} for Mercurial ${{ inputs.hg-version }} on ${{ inputs.environment }} + permissions: + checks: write + environment: + name: ${{ inputs.environment }} + runs-on: ${{ inputs.runs-on }} + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - uses: testspace-com/setup-testspace@v1.0.6 + with: + domain: ${{ github.repository_owner }} + - name: Setup self-hosted dependencies + if: ${{ inputs.run-playwright && inputs.runs-on == 'self-hosted' }} + run: | + sudo apt-get update + sudo apt-get install -y p7zip-full iputils-ping python3-venv wget zlib1g-dev libssl-dev #needed by setup python + wget -q https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell_7.4.1-1.deb_amd64.deb + sudo dpkg -i powershell_7.4.1-1.deb_amd64.deb + sudo apt-get install -f + rm powershell_7.4.1-1.deb_amd64.deb + pwsh #validate that powershell installed correctly + # First we need to setup Node... + - uses: actions/setup-node@v4 + if: ${{ inputs.run-playwright }} + with: + node-version-file: 'frontend/package.json' + # Then we can set up pnpm... + - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + if: ${{ inputs.run-playwright }} + with: + package_json_file: 'frontend/package.json' + # Then we can have Node set up package caching + - uses: actions/setup-node@v4 + if: ${{ inputs.run-playwright }} + with: + node-version-file: 'frontend/package.json' + cache: 'pnpm' + cache-dependency-path: 'frontend/pnpm-lock.yaml' + - name: Playwright setup working-directory: frontend - run: pnpm test + if: ${{ inputs.run-playwright }} + run: pnpm install && pnpm pretest + - name: Set up Playwright dependencies + working-directory: frontend + if: ${{ inputs.run-playwright && inputs.runs-on == 'self-hosted' }} + run: sudo pnpm exec playwright install-deps - - name: Integration tests (.NET) - if: ${{ matrix.test == 'dotnet' }} + - name: Integration tests (Playwright) + if: ${{ inputs.run-playwright }} env: TEST_SERVER_HOSTNAME: ${{ vars.TEST_SERVER_HOSTNAME }} # this is not a typo, we need to use the lf domain because it has a cert that hg will validate @@ -149,30 +172,32 @@ jobs: TEST_RESUMABLE_HG_HOSTNAME: ${{ vars.TEST_RESUMABLE_HG_HOSTNAME }} TEST_PROJECT_CODE: 'sena-3' TEST_DEFAULT_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }} - # 1.5gb max heap size, must be in hex https://learn.microsoft.com/en-us/dotnet/core/runtime-config/garbage-collector#heap-limit - # the self hosted runner only has 2gb so this should prevent it from running out of memory - DOTNET_GCHeapHardLimit: '0x2CB417800' + working-directory: frontend + run: pnpm test - run: dotnet test --output ./bin --logger trx --results-directory ./test-results --filter Category=Integration + publish-results: + needs: [ dotnet-test, playwright-test ] + runs-on: ${{ inputs.runs-on }} + steps: - name: Password protect Playwright traces id: password_protect_test_results - if: ${{ always() && matrix.test == 'playwright' && inputs.run-playwright }} + if: ${{ always() && inputs.run-playwright }} shell: bash env: ZIP_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }} run: 7z a ./playwright-traces.7z -mx=0 -mmt=off ./frontend/test-results -p"$ZIP_PASSWORD" - name: Publish unit test results uses: EnricoMi/publish-unit-test-result-action/composite@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0 - if: ${{ always() && matrix.test == 'dotnet' && !env.act }} + if: ${{ always() && !env.act }} with: check_name: Integration Tests ${{ inputs.runs-on }} for Mercurial ${{ inputs.hg-version }} files: ./test-results/*.trx - name: Publish results to testspace - if: ${{ always() && matrix.test == 'dotnet' }} + if: always() run: testspace "[.Net Integration/$${{ inputs.runs-on }} HG ${{ inputs.hg-version }}]./test-results/*.trx" "[Playwright]./frontend/test-results/*.xml" - name: Upload playwright results - if: ${{ always() && matrix.test == 'playwright' && inputs.run-playwright && steps.password_protect_test_results.outcome == 'success' }} + if: ${{ always() && inputs.run-playwright && steps.password_protect_test_results.outcome == 'success' }} uses: actions/upload-artifact@v4 with: name: playwright-traces-${{ inputs.runs-on }}-hg-${{ inputs.hg-version }} From d330cbc35d944f94b84802bb83b9bbd588ec26b4 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Wed, 12 Jun 2024 16:20:02 +0700 Subject: [PATCH 4/9] Ensure publish step always runs even after failures It's test failures when we need this step the most, in fact. --- .github/workflows/integration-test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 9618fa4af..e4dce06b8 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -178,6 +178,7 @@ jobs: publish-results: needs: [ dotnet-test, playwright-test ] + if: ${{ always() }} runs-on: ${{ inputs.runs-on }} steps: - name: Password protect Playwright traces From 1d0e2fe905e0fac1f7264edf831f162bbb2440aa Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Wed, 12 Jun 2024 16:33:58 +0700 Subject: [PATCH 5/9] Simpler publishing of test results If we do it in a final job, we'd have to use upload-artifact and download-artifact to transfer the files between jobs. Simpler to just run the testspace upload step twice. --- .github/workflows/integration-test.yaml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index e4dce06b8..623df5f71 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -111,6 +111,15 @@ jobs: DOTNET_GCHeapHardLimit: '0x2CB417800' run: dotnet test --output ./bin --logger trx --results-directory ./test-results --filter Category=Integration + - name: Publish unit test results + uses: EnricoMi/publish-unit-test-result-action/composite@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0 + if: ${{ always() && !env.act }} + with: + check_name: Integration Tests ${{ inputs.runs-on }} for Mercurial ${{ inputs.hg-version }} + files: ./test-results/*.trx + - name: Publish results to testspace + if: always() + run: testspace "[.Net Integration/$${{ inputs.runs-on }} HG ${{ inputs.hg-version }}]./test-results/*.trx" playwright-test: timeout-minutes: 120 @@ -174,13 +183,6 @@ jobs: TEST_DEFAULT_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }} working-directory: frontend run: pnpm test - - - publish-results: - needs: [ dotnet-test, playwright-test ] - if: ${{ always() }} - runs-on: ${{ inputs.runs-on }} - steps: - name: Password protect Playwright traces id: password_protect_test_results if: ${{ always() && inputs.run-playwright }} @@ -188,15 +190,9 @@ jobs: env: ZIP_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }} run: 7z a ./playwright-traces.7z -mx=0 -mmt=off ./frontend/test-results -p"$ZIP_PASSWORD" - - name: Publish unit test results - uses: EnricoMi/publish-unit-test-result-action/composite@8885e273a4343cd7b48eaa72428dea0c3067ea98 # v2.14.0 - if: ${{ always() && !env.act }} - with: - check_name: Integration Tests ${{ inputs.runs-on }} for Mercurial ${{ inputs.hg-version }} - files: ./test-results/*.trx - name: Publish results to testspace if: always() - run: testspace "[.Net Integration/$${{ inputs.runs-on }} HG ${{ inputs.hg-version }}]./test-results/*.trx" "[Playwright]./frontend/test-results/*.xml" + run: testspace "[Playwright]./frontend/test-results/*.xml" - name: Upload playwright results if: ${{ always() && inputs.run-playwright && steps.password_protect_test_results.outcome == 'success' }} uses: actions/upload-artifact@v4 From 3c0ba1f7478f92195920640399702b433ac9d0e8 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 13 Jun 2024 09:57:22 +0700 Subject: [PATCH 6/9] Remove stray matrix.test conditional --- .github/workflows/integration-test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 623df5f71..5c42d9fdb 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -98,7 +98,6 @@ jobs: MERCURIAL_VERSION: ${{ inputs.hg-version }} - name: Integration tests (.NET) - if: ${{ matrix.test == 'dotnet' }} env: TEST_SERVER_HOSTNAME: ${{ vars.TEST_SERVER_HOSTNAME }} # this is not a typo, we need to use the lf domain because it has a cert that hg will validate From c31294d76a228023573066595bdfdaa13e749478 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 13 Jun 2024 09:58:43 +0700 Subject: [PATCH 7/9] Move inputs.run-playwright test to job --- .github/workflows/integration-test.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 5c42d9fdb..58b1a86ff 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -121,6 +121,7 @@ jobs: run: testspace "[.Net Integration/$${{ inputs.runs-on }} HG ${{ inputs.hg-version }}]./test-results/*.trx" playwright-test: + if: ${{ inputs.run-playwright }} timeout-minutes: 120 name: Playwright tests on ${{ inputs.runs-on }} for Mercurial ${{ inputs.hg-version }} on ${{ inputs.environment }} permissions: @@ -136,7 +137,7 @@ jobs: with: domain: ${{ github.repository_owner }} - name: Setup self-hosted dependencies - if: ${{ inputs.run-playwright && inputs.runs-on == 'self-hosted' }} + if: ${{ inputs.runs-on == 'self-hosted' }} run: | sudo apt-get update sudo apt-get install -y p7zip-full iputils-ping python3-venv wget zlib1g-dev libssl-dev #needed by setup python @@ -147,32 +148,27 @@ jobs: pwsh #validate that powershell installed correctly # First we need to setup Node... - uses: actions/setup-node@v4 - if: ${{ inputs.run-playwright }} with: node-version-file: 'frontend/package.json' # Then we can set up pnpm... - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 - if: ${{ inputs.run-playwright }} with: package_json_file: 'frontend/package.json' # Then we can have Node set up package caching - uses: actions/setup-node@v4 - if: ${{ inputs.run-playwright }} with: node-version-file: 'frontend/package.json' cache: 'pnpm' cache-dependency-path: 'frontend/pnpm-lock.yaml' - name: Playwright setup working-directory: frontend - if: ${{ inputs.run-playwright }} run: pnpm install && pnpm pretest - name: Set up Playwright dependencies working-directory: frontend - if: ${{ inputs.run-playwright && inputs.runs-on == 'self-hosted' }} + if: ${{ inputs.runs-on == 'self-hosted' }} run: sudo pnpm exec playwright install-deps - name: Integration tests (Playwright) - if: ${{ inputs.run-playwright }} env: TEST_SERVER_HOSTNAME: ${{ vars.TEST_SERVER_HOSTNAME }} # this is not a typo, we need to use the lf domain because it has a cert that hg will validate @@ -184,7 +180,7 @@ jobs: run: pnpm test - name: Password protect Playwright traces id: password_protect_test_results - if: ${{ always() && inputs.run-playwright }} + if: ${{ always() }} shell: bash env: ZIP_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }} @@ -193,7 +189,7 @@ jobs: if: always() run: testspace "[Playwright]./frontend/test-results/*.xml" - name: Upload playwright results - if: ${{ always() && inputs.run-playwright && steps.password_protect_test_results.outcome == 'success' }} + if: ${{ always() && steps.password_protect_test_results.outcome == 'success' }} uses: actions/upload-artifact@v4 with: name: playwright-traces-${{ inputs.runs-on }}-hg-${{ inputs.hg-version }} From ae43cc9ff8623a8de2f0ee4619e5575a98da8099 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 13 Jun 2024 10:00:15 +0700 Subject: [PATCH 8/9] Add optional run-dotnet input, like run-playwright --- .github/workflows/integration-test.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 58b1a86ff..a80cf372d 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -16,6 +16,11 @@ on: required: false default: '3' type: string + run-dotnet: + description: 'Whether to run dotnet tests' + required: false + default: true + type: boolean run-playwright: description: 'Whether to run Playwright tests' required: false @@ -36,6 +41,11 @@ on: required: false default: '3' type: string + run-dotnet: + description: 'Whether to run dotnet tests' + required: false + default: true + type: boolean run-playwright: description: 'Whether to run Playwright tests' required: false @@ -49,6 +59,7 @@ on: jobs: dotnet-test: + if: ${{ inputs.run-dotnet }} timeout-minutes: 120 name: Dotnet tests on ${{ inputs.runs-on }} for Mercurial ${{ inputs.hg-version }} on ${{ inputs.environment }} permissions: From dddad71a9ded808778cf40fba0b0deb6a83e0603 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 13 Jun 2024 10:04:16 +0700 Subject: [PATCH 9/9] Switch to Mercurial 6 as default We've switched the Testing.csproj to build Mercurial 6 as default, it's time to switch the CI test to run Mercurial 6 by default as well. --- .github/workflows/integration-test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index a80cf372d..757a7f741 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -12,9 +12,9 @@ on: required: true type: string hg-version: - description: 'The version of hg to test (3 or 6, default 3)' + description: 'The version of hg to test (3 or 6, default 6)' required: false - default: '3' + default: '6' type: string run-dotnet: description: 'Whether to run dotnet tests' @@ -37,9 +37,9 @@ on: required: true type: string hg-version: - description: 'The version of hg to test (3 or 6, default 3)' + description: 'The version of hg to test (3 or 6, default 6)' required: false - default: '3' + default: '6' type: string run-dotnet: description: 'Whether to run dotnet tests'