From a3d1e3ff50c847cbf774455d0978d582b492b627 Mon Sep 17 00:00:00 2001 From: David Rheinsberg Date: Wed, 20 May 2020 16:28:52 +0200 Subject: [PATCH] test: import no-op test into the runtime-tests Add a new trivial runtime-test which simply runs a no-op pipeline. This is a fast, trivial test that simply verifies osbuild is properly setup and accessible. Remove the explicit no-op test from the CI, now that the test-suite has it as well. --- .github/workflows/runtime-tests.yml | 23 ---------------------- test/run/test_noop.py | 30 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 23 deletions(-) create mode 100644 test/run/test_noop.py diff --git a/.github/workflows/runtime-tests.yml b/.github/workflows/runtime-tests.yml index ee052280..f5c14a3b 100644 --- a/.github/workflows/runtime-tests.yml +++ b/.github/workflows/runtime-tests.yml @@ -33,29 +33,6 @@ jobs: with: run: python3 -m unittest -v test.test_boot - 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 diff --git a/test/run/test_noop.py b/test/run/test_noop.py new file mode 100644 index 00000000..0abaded4 --- /dev/null +++ b/test/run/test_noop.py @@ -0,0 +1,30 @@ +# +# Runtime Tests for No-op Pipelines +# + +import unittest + +from .. import test + + +class TestNoop(unittest.TestCase): + def setUp(self): + self.osbuild = test.OSBuild(self) + + def test_noop(self): + # + # Run a noop Pipeline. Run twice to verify the cache does not affect + # the operation (we do not have checkpoints, nor any stages that could + # be checkpointed). + # + # Then run the entire thing again, to verify our own `osbuild` executor + # tears things down properly and allows to be executed multiple times. + # + + with self.osbuild as osb: + osb.compile("{}") + osb.compile("{}") + + with self.osbuild as osb: + osb.compile("{}") + osb.compile("{}")