ci: Install kola tests
authorColin Walters <walters@verbum.org>
Thu, 14 May 2020 23:50:40 +0000 (23:50 +0000)
committerColin Walters <walters@verbum.org>
Fri, 15 May 2020 19:40:54 +0000 (19:40 +0000)
This builds on
https://github.com/coreos/coreos-assembler/pull/1441
to install our tests rather than running them from the source
directory.  This model will more cleanly allow us to ship
our tests along with a test container or elsewhere, separate
from the source directory.

Also prep for https://github.com/ostreedev/ostree/pull/2048

.cci.jenkinsfile
Makefile-tests.am
tests/kola/Makefile [new file with mode: 0644]

index d1f2a231e9aa34885dbcc52250e507d74ca48519..68656cbd8ac11189f7f58669150662f95569cd40 100644 (file)
@@ -76,6 +76,9 @@ parallel fcos: {
         rmdir insttree
         coreos-assembler fetch
         coreos-assembler build
+        # Install the tests, then be sure they're not run again
+        make -C tests/kola install
+        rm tests/kola -rf
       """)
     }
     fcosKola(cosaDir: "${env.WORKSPACE}")
index a172f01574a98b111c1f4a2bf3ce16d35b3d44d7..411c5628d4771b159c55ad8a7dcad63b7f757cc7 100644 (file)
@@ -456,3 +456,10 @@ else
 endif
 INSTALL_DATA_HOOKS += install-installed-tests-extra
 endif
+
+# Just forward these
+build-kola-tests:
+       $(MAKE) -C tests/kola
+
+install-kola-tests:
+       $(MAKE) -C tests/kola install
diff --git a/tests/kola/Makefile b/tests/kola/Makefile
new file mode 100644 (file)
index 0000000..18305a2
--- /dev/null
@@ -0,0 +1,13 @@
+DESTDIR ?=
+
+TESTDIRS := $(shell find -mindepth 1 -maxdepth 1 -type d)
+LIBSCRIPTS := $(shell ls *.sh)
+
+KOLA_TESTDIR = $(DESTDIR)/usr/lib/coreos-assembler/tests/kola/ostree/
+
+all:
+       for x in $(LIBSCRIPTS); do bash -n "$${x}"; done
+
+install:
+       install -D -m 0644 -t $(KOLA_TESTDIR) $(LIBSCRIPTS)
+       for x in $(TESTDIRS); do rsync -rlv ./$${x} $(KOLA_TESTDIR)/; done