Skip to content

Commit 07cae6e

Browse files
committed
github_actions: add windows and functional testing
- add Linux unit testing for Python 3.8 and 3.11 (x64) - add Windows unit testing for Python 3.8 and 3.11 (x64 and x86) - add Windows functional testing for Python 3.11 (x64 and x86) Change-Id: If4ca5a10f62e320c598f0bac7e1ec2ec52862c21
1 parent 6b2372d commit 07cae6e

File tree

3 files changed

+95
-29
lines changed

3 files changed

+95
-29
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Cloudbase-Init tests
2+
3+
env:
4+
UPPER_CONSTRAINTS: "https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt"
5+
TEST_RESOURCES: "https://github.com/cloudbase/cloudbase-init-test-resources"
6+
7+
on: [push, pull_request]
8+
9+
jobs:
10+
linux-unit-tests:
11+
runs-on: ubuntu-22.04
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: [ "3.11"]
16+
architecture: ["x64"]
17+
18+
steps:
19+
- name: Checkout cloudbase-init repository
20+
uses: actions/checkout@v4
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
architecture: ${{ matrix.architecture }}
26+
- name: Install python3 tox
27+
shell: bash
28+
run: |
29+
python3 -m pip install tox setuptools --upgrade
30+
- name: Run Cloudbase-Init unit tests with tox
31+
shell: bash
32+
run: |
33+
tox run-parallel -e py3,pep8,cover,docs
34+
windows-unit-tests:
35+
runs-on: windows-latest
36+
strategy:
37+
matrix:
38+
python-version: [ "3.8", "3.11"]
39+
architecture: ["x64", "x86"]
40+
41+
steps:
42+
- name: Checkout cloudbase-init repository
43+
uses: actions/checkout@v4
44+
- name: Set up Python ${{ matrix.python-version }}
45+
uses: actions/setup-python@v4
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
architecture: ${{ matrix.architecture }}
49+
- name: Install python3 tox
50+
shell: cmd
51+
run: |
52+
python3 -m pip install tox setuptools --upgrade
53+
- name: Run Cloudbase-Init unit tests with tox
54+
shell: cmd
55+
run: |
56+
tox run-parallel -e py3,pep8
57+
windows-functional-tests:
58+
runs-on: windows-latest
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
python-version: [ "3.11"]
63+
architecture: ["x64", "x86"]
64+
cloud: ["empty"]
65+
66+
steps:
67+
- name: Checkout cloudbase-init repository
68+
uses: actions/checkout@v4
69+
- name: Set up Python ${{ matrix.python-version }}
70+
uses: actions/setup-python@v4
71+
with:
72+
python-version: ${{ matrix.python-version }}
73+
architecture: ${{ matrix.architecture }}
74+
- name: Download external dependencies
75+
shell: cmd
76+
run: |
77+
git clone %TEST_RESOURCES% test-resources
78+
python -W ignore -m pip install --upgrade pip
79+
- name: Install Cloudbase-Init
80+
shell: cmd
81+
run: |
82+
python -W ignore -m pip install -c %UPPER_CONSTRAINTS% -U --force-reinstall -r requirements.txt
83+
python -W ignore -m pip install .
84+
- name: Run Cloudbase-Init functional tests
85+
shell: powershell
86+
run: |
87+
try {
88+
& 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
89+
} catch {}
90+
$errors = $(cat ./cloudbase-init.log | Where-Object {$_ -like "*error*"})
91+
$pluginExecution = $(cat ./cloudbase-init.log | Where-Object {$_ -like "*Plugins execution done*"})
92+
if ($errors -or !$pluginExecution) {
93+
exit 1
94+
}

.github/workflows/unit_tests.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.stestr.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[DEFAULT]
2-
test_path=${OS_TEST_PATH:-./cloudbaseinit/tests}
2+
test_path=./cloudbaseinit/tests
33
top_dir=./

0 commit comments

Comments
 (0)