From 7855ae68bc2cec29f798df307cf800db9df2e821 Mon Sep 17 00:00:00 2001
From: Soeren Peters <peters@irmb.tu-bs.de>
Date: Fri, 14 Apr 2023 13:42:14 +0000
Subject: [PATCH] Change output folder name. Remove colon from CI jobs.

---
 .gitlab-ci.yml                                        |  2 +-
 regression-tests/__regression_test_executer.sh        |  4 +---
 regression-tests/driven_cavity_test.sh                |  4 ++--
 regression-tests/driven_cavity_uniform_test.sh        |  4 ++--
 utilities/ci-regression-tests/generate-ci.py          | 11 ++---------
 .../ci-regression-tests/regression-tests-ci.yml.j2    |  2 +-
 6 files changed, 9 insertions(+), 18 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4c8fc4d11..c7fcb81d3 100755
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -261,7 +261,7 @@ build-regression-tests-ci:
 
   needs: []
 
-trigger:regression-tests:
+trigger-regression-tests:
   stage: test
   needs:
     - build-regression-tests-ci
diff --git a/regression-tests/__regression_test_executer.sh b/regression-tests/__regression_test_executer.sh
index b892912dd..254161929 100644
--- a/regression-tests/__regression_test_executer.sh
+++ b/regression-tests/__regression_test_executer.sh
@@ -13,9 +13,8 @@ download_reference_data () {
 # 1. REFERENCE_DATA_DIR - to download the reference data and compare against
 # 2. CMAKE_FLAGS - cmake flags for the build of VirtualFluids
 # 3. APPLICATION - the application to be executed
-# 4. PATH_TO_DIR - the path to the produced data to be compared
+# 4. RESULT_DATA_DIR - the path to the produced data to be compared
 run_regression_test () {
-
     download_reference_data $1
 
     rm -rf build && mkdir -p build
@@ -27,5 +26,4 @@ run_regression_test () {
 
     # execute fieldcompare (A more comprehensive manual can be found here https://gitlab.com/dglaeser/fieldcompare)
     fieldcompare dir $4 reference_data/$1 --include-files "*.vtu"
-
 }
\ No newline at end of file
diff --git a/regression-tests/driven_cavity_test.sh b/regression-tests/driven_cavity_test.sh
index 97fab4958..e4a7dcf05 100755
--- a/regression-tests/driven_cavity_test.sh
+++ b/regression-tests/driven_cavity_test.sh
@@ -12,8 +12,8 @@ CMAKE_FLAGS="--preset=make_gpu -DCMAKE_BUILD_TYPE=Release -DCMAKE_CUDA_ARCHITECT
 APPLICATION=./build/bin/DrivenCavity
 
 # 4. set the path to the produced data
-PATH_TO_DIR=output/DrivenCavity
+RESULT_DATA_DIR=output/DrivenCavity
 
 
-run_regression_test "$REFERENCE_DATA_DIR" "$CMAKE_FLAGS" "$APPLICATION" "$PATH_TO_DIR"
+run_regression_test "$REFERENCE_DATA_DIR" "$CMAKE_FLAGS" "$APPLICATION" "$RESULT_DATA_DIR"
 
diff --git a/regression-tests/driven_cavity_uniform_test.sh b/regression-tests/driven_cavity_uniform_test.sh
index ba6b39b98..deb1300ca 100755
--- a/regression-tests/driven_cavity_uniform_test.sh
+++ b/regression-tests/driven_cavity_uniform_test.sh
@@ -13,7 +13,7 @@ CMAKE_FLAGS="--preset=make_gpu -DCMAKE_BUILD_TYPE=Release -DCMAKE_CUDA_ARCHITECT
 APPLICATION=./build/bin/DrivenCavityUniform
 
 # 4. set the path to the produced data
-PATH_TO_DIR=output/DrivenCavity_uniform
+RESULT_DATA_DIR=output/DrivenCavity_uniform
 
 
-run_regression_test "$REFERENCE_DATA_DIR" "$CMAKE_FLAGS" "$APPLICATION" "$PATH_TO_DIR"
+run_regression_test "$REFERENCE_DATA_DIR" "$CMAKE_FLAGS" "$APPLICATION" "$RESULT_DATA_DIR"
diff --git a/utilities/ci-regression-tests/generate-ci.py b/utilities/ci-regression-tests/generate-ci.py
index 4bbaf848e..834728b5b 100644
--- a/utilities/ci-regression-tests/generate-ci.py
+++ b/utilities/ci-regression-tests/generate-ci.py
@@ -1,4 +1,3 @@
-from dataclasses import dataclass
 from jinja2 import Template
 from pathlib import Path
 
@@ -6,7 +5,7 @@ TEMPLATES_DIR = Path(__file__).parent
 REGRESSION_CI_TEMPLATE = TEMPLATES_DIR / "regression-tests-ci.yml.j2"
 GENERATED_DIR = Path("generated")
 REGRESSION_CI_FILE = GENERATED_DIR / "regression-tests-ci.yml"
-
+TEST_FILE_DIR = Path("regression-tests")
 
 
 def build_regression_job_string(regression_tests: list[str]) -> str:
@@ -15,13 +14,7 @@ def build_regression_job_string(regression_tests: list[str]) -> str:
 
 
 def main():
-
-    root_dir = "regression-tests"
-    root_dir_instance = Path(root_dir)
-    regression_tests_files = [item.stem for item in root_dir_instance.glob("*_test.sh")]
-    print(regression_tests_files)
-
-
+    regression_tests_files = [item.stem for item in TEST_FILE_DIR.glob("*_test.sh")]
     regression_tests_ci_file = build_regression_job_string(regression_tests_files)
     REGRESSION_CI_FILE.write_text(regression_tests_ci_file)
 
diff --git a/utilities/ci-regression-tests/regression-tests-ci.yml.j2 b/utilities/ci-regression-tests/regression-tests-ci.yml.j2
index 0ec69187e..4367ad6c7 100644
--- a/utilities/ci-regression-tests/regression-tests-ci.yml.j2
+++ b/utilities/ci-regression-tests/regression-tests-ci.yml.j2
@@ -17,7 +17,7 @@ stages:
     - pip install fieldcompare
 
 {% for regression_test in regression_tests %}
-regression-test:{{ regression_test }}:
+run-regression-test-{{ regression_test }}:
   extends: .regression-test
 
   script:
-- 
GitLab