From da214fa9593576926f11b553524958bc6680fee3 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Tue, 7 May 2024 13:42:56 -0500 Subject: [PATCH] Improve and re-enable windows acceptance test workflow Ticket: ENT-10699 Changelog: none --- .github/workflows/ci.yml | 9 ++---- .../workflows/windows_acceptance_tests.yml | 29 ++++++++++++++----- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53e1454bcb..1987d4a14a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,12 +17,9 @@ jobs: acceptance_tests: needs: unit_tests uses: ./.github/workflows/acceptance_tests.yml -# Disable win-acceptance tests for now due to two issues -# cf-agent.exe is not always installed "in-time" ENT-10699 -# job uses latest nightly instead of building the PR code ENT-10754 -# windows_acceptance_tests: -# needs: unit_tests -# uses: ./.github/workflows/windows_acceptance_tests.yml + windows_acceptance_tests: + needs: unit_tests + uses: ./.github/workflows/windows_acceptance_tests.yml macos_unit_tests: needs: unit_tests uses: ./.github/workflows/macos_unit_tests.yml diff --git a/.github/workflows/windows_acceptance_tests.yml b/.github/workflows/windows_acceptance_tests.yml index 1709a19a85..ad2184e2c4 100644 --- a/.github/workflows/windows_acceptance_tests.yml +++ b/.github/workflows/windows_acceptance_tests.yml @@ -38,25 +38,28 @@ jobs: run: "mv $HOME/.cfengine/cf-remote/packages/*.msi cfengine.msi" - name: install CFEngine - run: msiexec /i cfengine.msi + run: | + Get-Location # pwd + New-Item -Path "c:\" -Name "artifacts" -ItemType Directory + Start-Process msiexec.exe -Wait -ArgumentList '/quiet /qn /i cfengine.msi /L*V c:\tmp.log' + Get-Content c:\tmp.log | Set-Content -Encoding utf8 c:\artifacts\CFEngine-Install.log + file c:\artifacts\CFEngine-Install.log shell: pwsh - - name: give msiexec some time to finish in background - run: sleep 10 - - name: run cf-agent run: "'/c/Program Files/Cfengine/bin/cf-agent.exe' --version" - - name: expect an unknown synthax error in packagesmatching.cf, ENT-10422 - run: "cd tests/acceptance/01_vars/02_functions/ && mv packagesmatching.cf packagesmatching.x.cf" - # Note that msiexec install CFEngine onto the C: drive (/c/ partition), # but testall expects it to be on the same partition as where all tests are located (D: drive), # hence we just copy it over. - name: copy CFEngine to workdir partition run: 'cp -a "/c/Program Files/Cfengine" /d/a/' - - name: run all tests + - name: prune platform independent tests to make the job more efficient + run: 'Remove-Item -Recurse -Force 00_basics, 01_vars, 02_classes, 10_files, 14_reports, 15_control, 16_cf-serverd, 21_methods, 22_cf-runagent, 26_cf-net, 27_cf-secret, 28_inform_testing' + working-directory: "tests/acceptance" + shell: pwsh + - name: run the tests run: './testall --bindir="/d/a/Cfengine/bin" --extraclasses=EXTRA' working-directory: "tests/acceptance" env: @@ -67,4 +70,14 @@ jobs: - name: print test.log run: 'cat ./tests/acceptance/test.log || true' if: ${{ always() }} + - name: save test.log in artifacts + run: 'cp ./tests/acceptance/test.log /c/artifacts/test.log || true' + if: ${{ always() }} + + - name: save artifacts + if: success() || failure() + uses: actions/upload-artifact@v3 + with: + name: artifacts + path: c:\artifacts