Skip to content

Commit

Permalink
Improve and re-enable windows acceptance test workflow
Browse files Browse the repository at this point in the history
Ticket: ENT-10699
Changelog: none
  • Loading branch information
craigcomstock committed May 7, 2024
1 parent 28be128 commit da214fa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 21 additions & 8 deletions .github/workflows/windows_acceptance_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

0 comments on commit da214fa

Please sign in to comment.