From 1a2454a8085c1d37705ce3cb3b94f6cae8014638 Mon Sep 17 00:00:00 2001 From: Alex Nelson Date: Thu, 1 Sep 2022 14:01:09 -0400 Subject: [PATCH] Add copy of monolithic CASE build for a UCO test UCO Issue 393 added a test that assumed a file's existence during the UCO CI. That file is the UCO monolithic build, a purposefully Git- ignored build artifact. `case-utils` currently repurposes the UCO `pytest` script to ensure UCO's tests also pass when substituting the monolithic build of CASE. With Issue 393, the file reference to the UCO monolithic build needs to be handled downstream in `case-utils`. This patch adds that file by making a copy as a Git-ignored file. (A soft link could cause potential confusion due to management of the modification timestamp on the monolithic build file.) References: * https://github.com/ucoProject/UCO/issues/393 * [ONT-295] Release CASE 1.0.0 Signed-off-by: Alex Nelson --- tests/case_utils/case_validate/.gitignore | 1 + tests/case_utils/case_validate/Makefile | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/case_utils/case_validate/.gitignore diff --git a/tests/case_utils/case_validate/.gitignore b/tests/case_utils/case_validate/.gitignore new file mode 100644 index 0000000..303dea0 --- /dev/null +++ b/tests/case_utils/case_validate/.gitignore @@ -0,0 +1 @@ +uco_monolithic.ttl diff --git a/tests/case_utils/case_validate/Makefile b/tests/case_utils/case_validate/Makefile index 37378f4..d0c1b0a 100644 --- a/tests/case_utils/case_validate/Makefile +++ b/tests/case_utils/case_validate/Makefile @@ -15,6 +15,11 @@ SHELL := /bin/bash top_srcdir := $(shell cd ../../.. ; pwd) +case_version := $(shell $(PYTHON3) $(top_srcdir)/case_utils/ontology/version_info.py) +ifeq ($(case_version),) +$(error Unable to determine CASE version) +endif + tests_srcdir := $(top_srcdir)/tests all: \ @@ -57,7 +62,8 @@ check-cli: --directory cli \ check -check-uco_test_examples: +check-uco_test_examples: \ + uco_monolithic.ttl $(MAKE) \ --directory uco_test_examples \ check @@ -72,3 +78,17 @@ clean: @$(MAKE) \ --directory cli \ clean + +# This file is necessary for a UCO unit test that case-utils runs +# substituting its own monolithic build. +# It is incorrect to designate this the "UCO" monolithic build due to +# CASE concepts being present, but using the CASE build here keeps with +# the spirit of confirming UCO tests continue to pass when using the +# CASE monolithic build. +uco_monolithic.ttl: \ + $(top_srcdir)/case_utils/ontology/version_info.py \ + $(top_srcdir)/case_utils/ontology/case-$(case_version).ttl + rm -f $@ + cp \ + $(top_srcdir)/case_utils/ontology/case-$(case_version).ttl \ + $@