This new module contains utilities that help to introspect parts that constitute the inner parts of osbuild, i.e. its stages and assembler (which is also considered a type of stage in this context). It contains the `StageInfo` class that can that contains meta-information about the individual stage, such as a short information (`info`), a longer description (`desc`) and its JSON schema. A new Schema class represents schema data and has a `validation` method that can be used to validate that json data conforms to said schema. A `Index` class can be used to obtain `StageInfo` and `Schema` for entities identified via `klass` and `name`. A top level `validate` method is introduced that can validate manifest data. Internally it uses the `jsonschema` package so add that as a requirement and Install this dependency in the CI.
107 lines
2.8 KiB
YAML
107 lines
2.8 KiB
YAML
name: Runtime Tests
|
|
|
|
on: [pull_request, push]
|
|
|
|
#
|
|
# We set `PYTHONUNBUFFERED` to get more immediate and ordered output from
|
|
# python programs. This should not be necessary if all relevant output used the
|
|
# unbuffered stderr, but that is not entirely under our control.
|
|
#
|
|
env:
|
|
PYTHONUNBUFFERED: 1
|
|
|
|
jobs:
|
|
runtime_tests:
|
|
name: "Runtime Pipeline Execution Tests"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Clone Repository"
|
|
uses: actions/checkout@v2
|
|
- name: "Install Dependencies"
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get -y install \
|
|
nbd-client \
|
|
qemu-utils \
|
|
rpm \
|
|
systemd-container \
|
|
tar \
|
|
yum
|
|
- name: "Set up Python"
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.7
|
|
- name: Install Python Packages
|
|
run: pip install jsonschema
|
|
- name: "Run Pipeline Tests"
|
|
run: sudo env "PATH=$PATH" make test-runtime
|
|
|
|
noop_pipeline_tests:
|
|
name: "Noop-Pipeline Tests"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Clone Repository"
|
|
uses: actions/checkout@v2
|
|
- name: "Install Dependencies"
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get -y install \
|
|
systemd-container
|
|
- name: "Set up Python"
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.7
|
|
- name: Install Python Packages
|
|
run: pip install jsonschema
|
|
- name: "Run Noop-Pipeline Tests"
|
|
run: |
|
|
for i in {0..2} ; do
|
|
sudo env "PATH=$PATH" python3 -m osbuild --libdir . samples/noop.json
|
|
done
|
|
|
|
assembler_tests:
|
|
name: "Assembler Tests"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Clone Repository"
|
|
uses: actions/checkout@v2
|
|
- name: "Install Dependencies"
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get -y install \
|
|
nbd-client \
|
|
qemu-utils \
|
|
rpm \
|
|
systemd-container \
|
|
tar \
|
|
yum
|
|
- name: "Set up Python"
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.7
|
|
- name: Install Python Packages
|
|
run: pip install jsonschema
|
|
- name: "Run Assembler Tests"
|
|
run: sudo env "PATH=$PATH" python3 -m unittest -v test.test_assemblers
|
|
|
|
stage_tests:
|
|
name: "Stage Tests"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Clone Repository"
|
|
uses: actions/checkout@v2
|
|
- name: "Install Dependencies"
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get -y install \
|
|
systemd-container \
|
|
tar \
|
|
yum
|
|
- name: "Set up Python"
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.7
|
|
- name: Install Python Packages
|
|
run: pip install jsonschema
|
|
- name: "Run Stage Tests"
|
|
run: sudo env "PATH=$PATH" python3 -m unittest -v test.test_stages
|