Skip to content

Commit

Permalink
github_actions: use Pester to run functional tests
Browse files Browse the repository at this point in the history
During the functional tests, PowerShell Pester framework will be used to
make sure that the pre-functional test environment is as expected, then
Cloudbase-Init is run and the post-functional test environment is
checked to be as expected.

Change-Id: Ibe8ac6b6885f66887737a6932652ffd42b835413
Signed-off-by: Adrian Vladu <[email protected]>
  • Loading branch information
ader1990 committed Jun 20, 2024
1 parent 4fd9b57 commit 5b624b5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/cloudbase_init_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Cloudbase-Init tests
env:
UPPER_CONSTRAINTS: "https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt"
TEST_RESOURCES: "https://github.com/cloudbase/cloudbase-init-test-resources"
TEST_RESOURCES_BRANCH: "master"

on: [push, pull_request]

Expand Down Expand Up @@ -74,7 +75,7 @@ jobs:
- name: Download external dependencies
shell: cmd
run: |
git clone %TEST_RESOURCES% test-resources
git clone %TEST_RESOURCES% -b %TEST_RESOURCES_BRANCH% test-resources
python -W ignore -m pip install --upgrade pip
- name: Install Cloudbase-Init
shell: cmd
Expand All @@ -84,6 +85,10 @@ jobs:
- name: Run Cloudbase-Init functional tests
shell: powershell
run: |
Install-Module -Force -AllowClobber -Confirm:$false "Pester"
$ENV:CLOUD = "${{ matrix.cloud }}"
$ENV:TEST_ARCHITECTURE = "${{ matrix.architecture }}"
Invoke-Pester test-resources/functional-tests -Output Detailed -FullNameFilter TestVerifyBeforeAllPlugins
try {
& cmd /c "cloudbase-init.exe --noreset_service_password --config-file ./test-resources/${{ matrix.cloud }}/cloudbase-init.conf 2>&1" | Tee-Object -FilePath cloudbase-init.log
} catch {}
Expand All @@ -92,3 +97,4 @@ jobs:
if ($errors -or !$pluginExecution) {
exit 1
}
Invoke-Pester test-resources/functional-tests -Output Detailed -FullNameFilter TestVerifyAfterAllPlugins

0 comments on commit 5b624b5

Please sign in to comment.