-
Notifications
You must be signed in to change notification settings - Fork 153
100 lines (94 loc) · 3.53 KB
/
cloudbase_init_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
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]
jobs:
linux-unit-tests:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: [ "3.12"]
architecture: ["x64"]
steps:
- name: Checkout cloudbase-init repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Install python3 tox
shell: bash
run: |
python3 -m pip install tox setuptools --upgrade
- name: Run Cloudbase-Init unit tests with tox
shell: bash
run: |
tox run-parallel --parallel-live --parallel-no-spinner -e py3,pep8,cover,docs
windows-unit-tests:
runs-on: windows-latest
strategy:
matrix:
python-version: [ "3.8", "3.12"]
architecture: ["x64", "x86"]
steps:
- name: Checkout cloudbase-init repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Install python3 tox
shell: cmd
run: |
python3 -m pip install tox setuptools --upgrade
- name: Run Cloudbase-Init unit tests with tox
shell: cmd
run: |
tox -e py3,pep8
windows-functional-tests:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.12"]
architecture: ["x64", "x86"]
cloud: ["empty", "nocloud", "vmwareguest"]
steps:
- name: Checkout cloudbase-init repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Download external dependencies
shell: cmd
run: |
git clone %TEST_RESOURCES% -b %TEST_RESOURCES_BRANCH% test-resources
python -W ignore -m pip install --upgrade pip
- name: Install Cloudbase-Init
shell: cmd
run: |
python -W ignore -m pip install -c %UPPER_CONSTRAINTS% -U --force-reinstall -r requirements.txt
python -W ignore -m pip install .
- 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 {}
$errors = $(cat ./cloudbase-init.log | Where-Object {$_ -like "*error*"})
$pluginExecution = $(cat ./cloudbase-init.log | Where-Object {$_ -like "*Plugins execution done*"})
if ($errors -or !$pluginExecution) {
exit 1
}
Invoke-Pester test-resources/functional-tests -Output Detailed -FullNameFilter TestVerifyAfterAllPlugins