-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure project at pipeline and test (cleanup)
Introduced a "cleanup" test that removes temporary files that are needed (and reused) throughout multiple modules and need to be removed in the end during full compilation. Additionally, reworked pipeline into multiple modules to be able to compile and run tests of certain classed/runners for certain profiles only.
- Loading branch information
Showing
47 changed files
with
492 additions
and
643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.github.ardoco.core</groupId> | ||
<artifactId>pipeline</artifactId> | ||
<version>0.8.3-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>pipeline-core</artifactId> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
</project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.gitignore | ||
!.gitignore |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.github.ardoco.core</groupId> | ||
<artifactId>pipeline</artifactId> | ||
<version>0.8.3-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>pipeline-id</artifactId> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.github.ardoco.core</groupId> | ||
<artifactId>pipeline-core</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...ine-id/src/test/java/edu/kit/kastel/mcse/ardoco/core/execution/runner/RunnerBaseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* Licensed under MIT 2023. */ | ||
package edu.kit.kastel.mcse.ardoco.core.execution.runner; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.util.Objects; | ||
|
||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
// TODO improve this so this does not have to be in the src/main/java | ||
class RunnerBaseTest { | ||
private static final Logger logger = LoggerFactory.getLogger(RunnerBaseTest.class); | ||
|
||
protected static final String INPUT_TEXT = "../pipeline-core/src/test/resources/teastore.txt"; | ||
protected static final String INPUT_MODEL_ARCHITECTURE = "../pipeline-core/src/test/resources/teastore.repository"; | ||
protected static final String INPUT_MODEL_ARCHITECTURE_UML = "../pipeline-core/src/test/resources/teastore.uml"; | ||
protected static final String OUTPUT_DIR = "../pipeline-core/src/test/resources/testout"; | ||
protected static final String ADDITIONAL_CONFIGS = "../pipeline-core/src/test/resources/additionalConfig.txt"; | ||
protected static final String PROJECT_NAME = "teastore"; | ||
|
||
@AfterEach | ||
void cleanUp() { | ||
for (File file : Objects.requireNonNull(new File(OUTPUT_DIR).listFiles())) { | ||
if (!file.getName().equals(".gitkeep")) { | ||
try { | ||
Files.delete(file.toPath()); | ||
} catch (IOException e) { | ||
logger.warn("Error when cleaning up!", e); | ||
} | ||
} | ||
} | ||
} | ||
|
||
@SuppressWarnings("java:S5960") | ||
@Test | ||
@DisplayName("Test SetUp") | ||
void testInput() { | ||
File inputTextFile = new File(INPUT_TEXT); | ||
File inputModelArchitectureFile = new File(INPUT_MODEL_ARCHITECTURE); | ||
File inputModelArchitectureUmlFile = new File(INPUT_MODEL_ARCHITECTURE_UML); | ||
File outputDirFile = new File(OUTPUT_DIR); | ||
File additionalConfigsFile = new File(ADDITIONAL_CONFIGS); | ||
|
||
Assertions.assertAll(// | ||
() -> Assertions.assertTrue(inputTextFile.exists()),// | ||
() -> Assertions.assertTrue(inputModelArchitectureFile.exists()),// | ||
() -> Assertions.assertTrue(inputModelArchitectureUmlFile.exists()),// | ||
() -> Assertions.assertTrue(outputDirFile.exists()),// | ||
() -> Assertions.assertTrue(additionalConfigsFile.exists())// | ||
); | ||
} | ||
|
||
protected void testRunnerAssertions(ArDoCoRunner runner) { | ||
Assertions.assertAll(// | ||
() -> Assertions.assertNotNull(runner),// | ||
() -> Assertions.assertTrue(runner.isSetUp())// | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.github.ardoco.core</groupId> | ||
<artifactId>pipeline</artifactId> | ||
<version>0.8.3-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>pipeline-tlr</artifactId> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.github.ardoco.core</groupId> | ||
<artifactId>pipeline-core</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...lr/src/test/java/edu/kit/kastel/mcse/ardoco/core/execution/runner/CodeRunnerBaseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* Licensed under MIT 2023. */ | ||
package edu.kit.kastel.mcse.ardoco.core.execution.runner; | ||
|
||
import java.io.File; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.BeforeAll; | ||
|
||
import edu.kit.kastel.mcse.ardoco.core.common.CodeUtils; | ||
|
||
// TODO improve this so this does not have to be in the src/main/java | ||
class CodeRunnerBaseTest extends RunnerBaseTest { | ||
protected static final String inputCodeRepository = "https://github.com/ArDoCo/TeaStore.git"; | ||
|
||
// If you change the folder, make sure to also update the CleanupTest in the module "report" | ||
protected static final String inputCode = "../../temp/code/teastore"; | ||
|
||
@BeforeAll | ||
static void setup() { | ||
File codeLocation = new File(inputCode); | ||
|
||
if (!codeLocation.exists()) { | ||
var successfulClone = CodeUtils.cloneRepository(inputCodeRepository, inputCode); | ||
if (!successfulClone) { | ||
Assertions.fail("Could not clone repository."); | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.