From 74f2a2a1f32ecde3f891513b1867499802817b1b Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 28 May 2024 10:53:54 +0800 Subject: [PATCH] Rewrite CI tests --- .fmf/version | 1 + plans/basic.fmf | 6 ++++++ tests/main.fmf | 13 +++++++++++++ tests/make_check.sh | 9 +++++++++ tests/tests.yml | 22 ---------------------- 5 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/basic.fmf create mode 100644 tests/main.fmf delete mode 100644 tests/tests.yml 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/basic.fmf b/plans/basic.fmf new file mode 100644 index 0000000..d57536e --- /dev/null +++ b/plans/basic.fmf @@ -0,0 +1,6 @@ +summary: Basic smoke test +discover: + how: fmf + dist-git-source: true +execute: + how: tmt diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..4624f5c --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,13 @@ +test: bash ./make_check.sh .. +duration: 50m +framework: shell +require: + - make + - gcc-c++ + - autoconf + - automake + - libtool + - zlib-devel + - lzo-devel + - xz-devel + - rpm-build diff --git a/tests/make_check.sh b/tests/make_check.sh index 6d4a0f6..d9d35e3 100644 --- a/tests/make_check.sh +++ b/tests/make_check.sh @@ -9,6 +9,15 @@ check_return_value () { } cd $1 + +VERSION=`rpmspec -q --srpm --qf "%{version}" kyotocabinet.spec 2>/dev/null` + +if test -d kyotocabinet-$VERSION-build; +then cd kyotocabinet-$VERSION-build; +fi + +cd kyotocabinet-$VERSION + ./configure --prefix=/usr --disable-opt --enable-lzo --enable-lzma check_return_value $? make diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 12c3f10..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,22 +0,0 @@ -- hosts: localhost - vars: - - artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}" - tags: - - classic - remote_user: root - roles: - - role: standard-test-source # to get the source tar ball to do “make check” - - role: standard-test-basic - required_packages: - - make - - gcc-c++ - - autoconf - - automake - - libtool - - zlib-devel - - lzo-devel - - xz-devel - tests: - - make-check: - dir: ./ - run: bash ./make_check.sh ./source