From 7831f4bd996d5bb88fd612a536cbf2ab866cd8f8 Mon Sep 17 00:00:00 2001 From: Petr Šplíchal Date: Jan 22 2019 10:19:20 +0000 Subject: Initial version of the ci.fmf examples This is an initial set of examples demonstrating how the Extensible Configuration for CI could look like. The files illustrate different aspects of the concept. In production everything would be stored under a single "ci" parent, that is saved in the ci.fmf file or scattered on the filesystem as defined by the Flexible Metadata Format. --- diff --git a/examples/.fmf/version b/examples/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/examples/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/examples/artifacts.fmf b/examples/artifacts.fmf new file mode 100644 index 0000000..bc153ec --- /dev/null +++ b/examples/artifacts.fmf @@ -0,0 +1,19 @@ +# Basic structure of artifacts and related testsets +/test: + /pull-request: + /pep: + summary: All code must comply with the PEP8 style guide + /lint: + summary: Run pylint to catch common problems (no gating) + /build: + /smoke: + summary: Basic smoke test (Tier1) + /features: + summary: Verify important features + /update: + /basic: + summary: Run all Tier1, Tier2 and Tier3 tests + /security: + summary: Security tests (extra job to get quick results) + /integration: + summary: Integration tests with related components diff --git a/examples/gating.fmf b/examples/gating.fmf new file mode 100644 index 0000000..05e5d6d --- /dev/null +++ b/examples/gating.fmf @@ -0,0 +1,30 @@ +# Turn on gating for selected testsets (defined inline) +/test: + /pull-request: + /pep: + summary: All code must comply with the PEP8 style guide + # Do not allow ugly code to be merged into master + gate: + - merge-pull-request + /lint: + summary: Run pylint to catch common problems (no gating) + /build: + /smoke: + summary: Basic smoke test (Tier1) + # Basic smoke test is used by three gates + gate: + - merge-pull-request + - add-build-to-update + - add-build-to-compose + /features: + summary: Verify important features + /update: + # This enables the 'release-update' gate for all three testsets + gate: + - release-update + /basic: + summary: Run all Tier1, Tier2 and Tier3 tests + /security: + summary: Security tests (extra job to get quick results) + /integration: + summary: Integration tests with related components diff --git a/examples/separate.fmf b/examples/separate.fmf new file mode 100644 index 0000000..ac94ee8 --- /dev/null +++ b/examples/separate.fmf @@ -0,0 +1,43 @@ +# Turn on gating for selected testsets (separate gate section) +/test: + /pull-request: + /pep: + summary: All code must comply with the PEP8 style guide + /lint: + summary: Run pylint to catch common problems (no gating) + /build: + /smoke: + summary: Basic smoke test (Tier1) + /features: + summary: Verify important features + /update: + /basic: + summary: Run all Tier1, Tier2 and Tier3 tests + /security: + summary: Security tests (extra job to get quick results) + /integration: + summary: Integration tests with related components + +/gate: + # Gate blocking the pull request merge into master + /merge-pull-request: + test: + - /test/pull-request/pep + - /test/build/smoke + + # Gate blocking the build to be added to an update/erratum + /add-build-to-update: + test: + - /test/build/smoke + + # Gate blocking the build to be added to compose + /add-build-to-compose: + test: + - /test/build/smoke + + # Gate blocking release of an update/erratum + /release-update: + test: + - /test/update/basic + - /test/update/security + - /test/update/integration diff --git a/examples/tooling.fmf b/examples/tooling.fmf new file mode 100644 index 0000000..147139c --- /dev/null +++ b/examples/tooling.fmf @@ -0,0 +1,32 @@ +# Multiple tool support for test discovery & execution +/test: + /build: + # Standard Test Inteface + /sti: + execute: + tool: sti + playbooks: + - 'tests.yml' + tags: + - 'classic' + # Simple shell script + /shell: + execute: + tool: shell + path: 'tests' + test: './test.sh' + environment: + PYTHON: 'python2' + # Workflow Tomorrow + /wow: + execute: + tool: wow + options: '--plan 1234 --tags Tier1' + # Flexible Metadata Format + Restraint + /fmf: + discover: + tool: fmf + filter: 'tier: 1, 2' + repository: https://src.fedoraproject.org/tests/python + execute: + tool: restraint diff --git a/examples/workflow.fmf b/examples/workflow.fmf new file mode 100644 index 0000000..e94593e --- /dev/null +++ b/examples/workflow.fmf @@ -0,0 +1,59 @@ +# Workflow steps: discover, provision, prepare, execute, report +/test: + # Discover relevant tests + discover: + tool: fmf + # System requirements + provision: + memory: + min: '1 GB' + arch: + - 'x86_64' + # Machine configuration + prepare: + ansible: + - 'setup.yml' + # Test execution + execute: + tool: restraint + # Result reporting + report: + contact: email@address.org + + # Build testing + /build: + /smoke: + summary: Basic smoke test (Tier1) + discover+: + filter: 'tier: 1' + /features: + summary: Verify important features + discover+: + filter: 'tag: functional' + + # Errata testing + /update: + provision+: + arch: + - x86_64 + - ppc64 + - s390x + /basic: + summary: Run all Tier1, Tier2 and Tier3 tests + discover+: + filter: 'tier: 1, 2, 3' + /security: + summary: Security tests (extra job to get quick results) + discover+: + filter: 'tag: security' + /integration: + summary: Integration tests with related components + discover+: + filter: 'tag: integration' + provision+: + memory: + min: '4 GB' + max: '8 GB' + prepare: + ansible: + - 'integration.yml'