From 7a61b1e69b2dde001ad03cd7b25997c8892a6adc Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Sat, 8 Aug 2020 17:17:51 +0200 Subject: [PATCH 1/4] Add TMT smoke test --- .fmf/version | 1 + plans/smoke.fmf | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 .fmf/version create mode 100644 plans/smoke.fmf diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/smoke.fmf b/plans/smoke.fmf new file mode 100644 index 0000000..5143f59 --- /dev/null +++ b/plans/smoke.fmf @@ -0,0 +1,7 @@ +summary: Run smoke test +provision: + how: container + image: fedora:latest +execute: + how: shell + script: python3 -c "import simpleline" From 36204c94e56181b3cfc4c99096283cfc7d75e63e Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Sat, 8 Aug 2020 17:22:41 +0200 Subject: [PATCH 2/4] Add unit tests to TMT --- plans/basic.fmf | 8 ++++++++ tests/units/main.fmf | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 plans/basic.fmf create mode 100644 tests/units/main.fmf diff --git a/plans/basic.fmf b/plans/basic.fmf new file mode 100644 index 0000000..e122b60 --- /dev/null +++ b/plans/basic.fmf @@ -0,0 +1,8 @@ +summary: Run unit tests +discover: + how: fmf +provision: + how: container + image: fedora:latest +execute: + how: shell diff --git a/tests/units/main.fmf b/tests/units/main.fmf new file mode 100644 index 0000000..2f5323a --- /dev/null +++ b/tests/units/main.fmf @@ -0,0 +1,6 @@ +summary: Run unit tests +description: Run all unit tests for the Simpleline project. +contact: Jiri Konecny +duration: 10m +path: tests/ +test: ./units/run_test.sh From a3a416da33c44df6a31b424cb1bc3cb27aae4bd4 Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Tue, 11 Aug 2020 14:32:06 +0200 Subject: [PATCH 3/4] Move existing TMT plans under pr-testing directory This configuration will work only for PR testing or gating. --- plans/{ => pr-tests}/basic.fmf | 1 + plans/{ => pr-tests}/smoke.fmf | 0 2 files changed, 1 insertion(+) rename plans/{ => pr-tests}/basic.fmf (80%) rename plans/{ => pr-tests}/smoke.fmf (100%) diff --git a/plans/basic.fmf b/plans/pr-tests/basic.fmf similarity index 80% rename from plans/basic.fmf rename to plans/pr-tests/basic.fmf index e122b60..f874662 100644 --- a/plans/basic.fmf +++ b/plans/pr-tests/basic.fmf @@ -1,6 +1,7 @@ summary: Run unit tests discover: how: fmf + filter: tag:sys-installed provision: how: container image: fedora:latest diff --git a/plans/smoke.fmf b/plans/pr-tests/smoke.fmf similarity index 100% rename from plans/smoke.fmf rename to plans/pr-tests/smoke.fmf From c8ef888fd7a82565f5a978eeb6adcd61c6195267 Mon Sep 17 00:00:00 2001 From: Jiri Konecny Date: Tue, 11 Aug 2020 14:33:09 +0200 Subject: [PATCH 4/4] Add new TMT plan and split tests for local and pr-tests PR-testing and Gating have to test unit-tests based on the installed package, however, when we are running these tests in local then we want to start the tests on source and not the installed package. Create two plans to solve this issue. --- plans/local/basic.fmf | 1 + plans/local/main.fmf | 8 ++++++++ tests/units/main.fmf | 14 ++++++++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 120000 plans/local/basic.fmf create mode 100644 plans/local/main.fmf diff --git a/plans/local/basic.fmf b/plans/local/basic.fmf new file mode 120000 index 0000000..a00dd90 --- /dev/null +++ b/plans/local/basic.fmf @@ -0,0 +1 @@ +../pr-tests/basic.fmf \ No newline at end of file diff --git a/plans/local/main.fmf b/plans/local/main.fmf new file mode 100644 index 0000000..dd50a59 --- /dev/null +++ b/plans/local/main.fmf @@ -0,0 +1,8 @@ +/basic: + summary+: ' (localhost)' + discover+: + filter: tag:local + prepare: + how: install + package: + - python3-gobject-base diff --git a/tests/units/main.fmf b/tests/units/main.fmf index 2f5323a..ba95450 100644 --- a/tests/units/main.fmf +++ b/tests/units/main.fmf @@ -2,5 +2,15 @@ summary: Run unit tests description: Run all unit tests for the Simpleline project. contact: Jiri Konecny duration: 10m -path: tests/ -test: ./units/run_test.sh + +/source: + summary+: ' (source)' + path: / + test: ./tests/units/run_test.sh + tag: local + +/system: + summary+: ' (system)' + path: tests/ + test: ./units/run_test.sh + tag: sys-installed