24.09., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

Commit 24dc2eb0 authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier

Moved CI helper scripts to "Tools/ContinuousIntegration" and enabled Java...

Moved CI helper scripts to "Tools/ContinuousIntegration" and enabled Java assertions in POM files and helper scripts.

.gitlab-ci.yml:
- Refactored complete file: moved comment on top of file.
- Call helper scripts in "Tools/ContinuousIntegration" instead of just "Tools".

Tools/ContinuousIntegration/run_vadere_console_with_all_scenario_files.py:
- Execute scenario files alphabetically.
- Use "-enableassertions" when invoking Java.

POM files:
- Use "<enableAssertions>true</enableAssertions>" to be independent of SureFire's default settings.
parent edc0ad78
Pipeline #63739 failed with stages
in 4 minutes and 16 seconds
# # GitLab CI Jobs
#
# Each of the jobs defined here is triggered by GitLab's CI pipeline.
#
# ## GitLab YAML Job Description Syntax
#
# <job_name>: # Job name which is displayed in web interface.
# stage: <stage_name> # <build|test|deploy>: these stages are executed
# # one after another. A stage can contain multiple
# # jobs.
# script:
# - <arbitrary_commands> # Here you can execute arbitratry terminal
# # commands. If any of the commands return a
# # non-zero exit code, the job fails.
#
# ## Maven Syntax for Skipping Unit Tests
#
# General syntax to execute unit tests:
#
# ```
# mvn test
# ```
#
# The comma-separated list of tests after "-Dtest=<list>" is skipped. All other
# tests are executed normally:
#
# ```
# mvn -Dtest=!TestClassA,!TestClassB,!TestClassC
# ```
#
# **Note:** on some CI instances the exclamation mark must be escaped by a
# backslash. Otherwise, it is interpreted by the executing shell as special
# command.
#
# ## Unit Test Limitations
#
# **Watch out:** OpenCL code cannot be run on virtual machines where tests are
# executed. Therefore, skip this tests.
unit_tests_with_coverage:
# A job is always executed within a stage.
# If no stage is set, it defaults to 'test'.
stage: test
# Here you can execute arbitrate terminal commands.
# If any of the commands returns a non zero exit code the job fails.
#
# Watch out: OpenCL code cannot be run on virtual machine. Therefore,
# skip this tests.
#
# The comma-separated list of tests after "-Dtest=<list>" is skipped.
# All other tests are executed normally.
#
# Watch out: on some CI instances the exclamation mark must be escaped by a
# backslash. Otherwise, it is interpreted by the executing shell as special
# command.
#
# Following syntaxes allow you to skip whole classes and single methods:
#
# #Exclude one test class
# mvn -Dtest=!LegacyTest test
# # Exclude one test method
# mvn -Dtest=!LegacyTest#testFoo verify
# # Exclude two test methods
# mvn -Dtest=!LegacyTest#testFoo+testBar verify
# # Exclude a package with a wildcard (*)
# mvn -Dtest=!com.mycompany.app.Legacy* test
script:
- mvn clean
- mvn -Dtest=!TestConvolution,!TestBitonicSort,!TestCLLinkedList test
- python3 Tools/collect_line_and_branch_coverage.py
- python3 Tools/ContinuousIntegration/collect_line_and_branch_coverage.py
run_scenario_files:
stage: deploy
......@@ -37,5 +51,5 @@ run_scenario_files:
script:
- mvn clean
- mvn -Dmaven.test.skip=true package
- python3 Tools/run_vadere_console_with_all_scenario_files.py
- python3 Tools/ContinuousIntegration/run_vadere_console_with_all_scenario_files.py
......@@ -33,7 +33,7 @@ def find_scenario_files(path="VadereModelTests"):
print("Total scenario files: {}".format(len(scenario_files)))
print("Exclude patterns: {}".format(exclude_patterns))
return scenario_files
return sorted(scenario_files)
def run_scenario_files_with_vadere_console(scenario_files, vadere_console="VadereGui/target/vadere-console.jar", scenario_timeout_in_sec=60):
output_dir = "output"
......@@ -46,7 +46,7 @@ def run_scenario_files_with_vadere_console(scenario_files, vadere_console="Vader
for i, scenario_file in enumerate(scenario_files):
print("Running scenario file ({}/{}): {}".format(i + 1, total_scenario_files, scenario_file))
# Use timout feature, check return value and capture stdout/stderr to a PIPE (use completed_process.stdout to get it).
completed_process = subprocess.run(args=["java", "-jar", vadere_console, scenario_file, output_dir],
completed_process = subprocess.run(args=["java", "-enableassertions", "-jar", vadere_console, scenario_file, output_dir],
timeout=scenario_timeout_in_sec,
check=True,
stdout=subprocess.PIPE,
......
......@@ -97,10 +97,11 @@
<version>2.19</version>
<configuration>
<argLine>${surefireArgLine}</argLine>
<failIfNoTests>false</failIfNoTests>
<enableAssertions>true</enableAssertions>
<excludes>
<exclude></exclude>
</excludes>
<failIfNoTests>false</failIfNoTests>
<skipTests>${skip.unit.tests}</skipTests>
</configuration>
</plugin>
......
......@@ -171,10 +171,11 @@
<version>2.19</version>
<configuration>
<argLine>${surefireArgLine}</argLine>
<failIfNoTests>false</failIfNoTests>
<enableAssertions>true</enableAssertions>
<excludes>
<exclude></exclude>
</excludes>
<failIfNoTests>false</failIfNoTests>
<skipTests>${skip.unit.tests}</skipTests>
</configuration>
</plugin>
......
......@@ -103,10 +103,11 @@
<version>2.19</version>
<configuration>
<argLine>${surefireArgLine}</argLine>
<failIfNoTests>false</failIfNoTests>
<enableAssertions>true</enableAssertions>
<excludes>
<exclude></exclude>
</excludes>
<failIfNoTests>false</failIfNoTests>
<skipTests>${skip.unit.tests}</skipTests>
</configuration>
</plugin>
......
......@@ -67,10 +67,11 @@
<version>2.19</version>
<configuration>
<argLine>${surefireArgLine}</argLine>
<failIfNoTests>false</failIfNoTests>
<enableAssertions>true</enableAssertions>
<excludes>
<exclude></exclude>
</excludes>
<failIfNoTests>false</failIfNoTests>
<skipTests>${skip.unit.tests}</skipTests>
</configuration>
</plugin>
......
......@@ -72,10 +72,11 @@
<version>2.19</version>
<configuration>
<argLine>${surefireArgLine}</argLine>
<failIfNoTests>false</failIfNoTests>
<enableAssertions>true</enableAssertions>
<excludes>
<exclude></exclude>
</excludes>
<failIfNoTests>false</failIfNoTests>
<skipTests>${skip.unit.tests}</skipTests>
</configuration>
</plugin>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment