Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENT-10699: Fixed windows acceptance test workflow #5493

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 6 additions & 0 deletions tests/acceptance/00_basics/macros/if_triple.cf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ bundle agent init
template_method => "mustache";
}

bundle agent test
{
meta:
"test_skip_needs_work" string => "windows";
}

bundle agent check
{
methods:
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/01_vars/02_functions/packagesmatching.cf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ bundle agent test
{
meta:
"test_suppress_fail" string => "windows",
meta => { "redmine4741" };
meta => { "redmine4741", "ENT-10422" };

vars:
"all_packages" data => packagesmatching(".*", ".*", ".*", ".*");
Expand Down
3 changes: 0 additions & 3 deletions tests/acceptance/27_cf-secret/encrypt-decrypt-args.cf
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ bundle agent test
"description"
string => "Test cf-secret with different arguments/order";

"test_soft_fail" string => "windows",
meta => { "ENT-10405" };

vars:
"text" string => "This secret sauce should be encrypted and decrypted.";

Expand Down
Loading