Skip to content

Commit

Permalink
ci: refactor tmt test (#470)
Browse files Browse the repository at this point in the history
One more refactoring. Found out we could keep the root cleaner.

---------

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
  • Loading branch information
LecrisUT authored Aug 21, 2023
1 parent a6e5b9d commit 938271f
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 24 deletions.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion distro/plans/examples.fmf → .distro/plans/examples.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ summary:
discover+:
how: fmf
filter: "tag: examples"
path: docs
execute:
how: tmt
how: tmt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
discover:
how: fmf
dist-git-source: true
dist-git-extract: scikit_build_core-*/
File renamed without changes.
2 changes: 1 addition & 1 deletion distro/plans/smoke.fmf → .distro/plans/smoke.fmf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
summary:
Basic smoke tests
discover+:
discover:
how: fmf
filter: "tag: smoke"
execute:
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion distro/tests/rpmlint.fmf → .distro/tests/rpmlint.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
tag:
- rpmlint
tier: 0
path: /distro
path: /

# Define tests
/rpmlint:
Expand Down
3 changes: 1 addition & 2 deletions distro/tests/smoke.fmf → .distro/tests/smoke.fmf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Common test variables
tag:
- smoke
tag: [ smoke ]
tier: 0
path: /

Expand Down
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ tests/**/build/
*.swp

# RPM spec file
!/distro/*.spec
/distro/*.tar.gz
!/.distro/*.spec
/.distro/*.tar.gz
*.rpm

# ruff
Expand All @@ -171,8 +171,8 @@ Thumbs.db

.idea/
# tmt setup
/distro/main.fmf
/distro/plans/main.fmf
/distro/tests/main.fmf
/.distro/main.fmf
/.distro/plans/main.fmf
/.distro/tests/main.fmf

/docs/**/build
12 changes: 7 additions & 5 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# See the documentation for more information:
# https://packit.dev/docs/configuration/

specfile_path: distro/python-scikit-build-core.spec
specfile_path: .distro/python-scikit-build-core.spec

files_to_sync:
- src: distro/python-scikit-build-core.spec
- src: .distro/python-scikit-build-core.spec
dest: python-scikit-build-core.spec
- .packit.yaml
- src: distro/python-scikit-build-core.rpmlintrc
- src: .distro/python-scikit-build-core.rpmlintrc
dest: python-scikit-build-core.rpmlintrc
# tmt setup
- src: .fmf/
dest: .fmf/
- src: distro/plans/
- src: .distro/plans/
dest: plans/
filters:
- "- main.fmf.dist-git"
- "- rpmlint.fmf"
- src: distro/plans/main.fmf.dist-git
- src: .distro/plans/main.fmf.dist-git
dest: plans/main.fmf
upstream_package_name: scikit_build_core
downstream_package_name: python-scikit-build-core
Expand Down Expand Up @@ -48,6 +48,7 @@ jobs:
- fedora-development-aarch64
- fedora-latest-aarch64
- fedora-latest-stable-aarch64
fmf_path: .distro
- job: copr_build
trigger: commit
branch: main
Expand All @@ -70,6 +71,7 @@ jobs:
- fedora-development-aarch64
- fedora-latest-aarch64
- fedora-latest-stable-aarch64
fmf_path: .distro
- job: copr_build
trigger: release
owner: "@scikit-build"
Expand Down
1 change: 1 addition & 0 deletions docs/.fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
4 changes: 2 additions & 2 deletions docs/examples/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ require:
- rsync
- tree
framework: beakerlib
path: /docs/examples
test: ./test.sh
path: /
test: ./examples/test.sh
9 changes: 2 additions & 7 deletions docs/examples/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ source /usr/share/beakerlib/beakerlib.sh || exit 1
rlJournalStart
rlPhaseStartSetup
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
if [ -z ${TMT_SOURCE_DIR} ]; then
tmt_root=${TMT_TREE}
else
tmt_root=${TMT_SOURCE_DIR}/scikit_build_core-*
fi
rlRun "rsync -r ${tmt_root}$TMT_TEST_NAME/ $tmp" 0 "Copy example project"
rlRun "rsync -r .$TMT_TEST_NAME/ $tmp" 0 "Copy example project"
if [ "${HAS_PYTEST}" != True ]; then
rlRun "rsync -r ${tmt_root}/docs/examples/getting_started/test.py $tmp" 0 "Copy test.py file"
rlRun "rsync -r ./examples/getting_started/test.py $tmp" 0 "Copy test.py file"
fi
rlRun "pushd $tmp"
rlRun "tree" 0 "Show directory tree"
Expand Down

0 comments on commit 938271f

Please sign in to comment.