Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orchestration module: Migration of the Resource Identification process code and tests #59

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions .github/workflows/build.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: build-annotations
name: build-retorch
on:
push:
branches-ignore:
- 'dependabot/**' #avoid duplicates: only run the PR, not the commit
- 'gh-pages' #GitHub pages do not trigger all tests
- 'gh-pages' #github pages do not trigger all tests
tags-ignore:
- 'v*' #avoid rerun existing commit on release
pull_request:
branches:
- 'main'
jobs:
test-java:
test-retorch:
runs-on: ubuntu-latest
# if: ${{ false }} # disable for now
#if: ${{ false }} # disable for now
#avoids duplicate execution of pr from local repo, but allows pr from forked repos and dependabot
if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && (github.event.pull_request.head.repo.fork || startsWith(github.head_ref, 'dependabot/')))
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -21,12 +23,35 @@ jobs:
java-version: '8'
cache: 'maven'

- name: Build Annotation project
run: mvn compile -U --no-transfer-progress
- name: Test and aggregate surefire report
run: mvn test surefire-report:report -Daggregate=true -Dmaven.test.failure.ignore=true -U --no-transfer-progress

- name: Additional aggregated junit report
uses: javiertuya/junit-report-action@v1
with:
surefire-files: "**/target/surefire-reports/TEST-*.xml"
report-dir: target/site

- name: Generate report checks
if: always()
uses: mikepenz/action-junit-report@v5
with:
check_name: "test-result"
report_paths: "**/surefire-reports/TEST-*.xml"
fail_on_failure: 'true'

- if: always()
name: Publish test report files
uses: actions/upload-artifact@v4
with:
name: "test-report-files"
path: |
target/site
**/target/site/jacoco/jacoco.xml
**/target/surefire-reports

sonarqube:
needs: [ test-java ]
needs: [ test-retorch ]
#if: ${{ false }} # disable for now
#This job fails when comming from a dependabot PR (can't read the sonarqube token for security reasons).
#Links to discussions and workaround at: https://github.com/giis-uniovi/samples-giis-template/issues/4
Expand All @@ -37,6 +62,7 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
sonar-token: ${{ secrets.SONAR_TOKEN }}
restore-artifact-name1: "test-report-files"

publish-java-snapshot:
#if: ${{ false }} # disable for now
Expand Down
113 changes: 101 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,77 @@
<packaging>pom</packaging>

<name>retorch</name>
<description>RETORCH: Resource-aware Orchestration of End-to-End Test Cases
</description>
<description>RETORCH: Resource-aware Orchestration of End-to-End Test Cases</description>
<url>https://github.com/giis-uniovi/retorch</url>
<organization>
<name>Software Engineering Research Group (GIIS) - University of Oviedo, ES</name>
<url>http://giis.uniovi.es/</url>
<url>https://giis.uniovi.es/</url>
</organization>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!--Separate all dependencies by a blank line to avoid problems creating combined dependencies in dependabot.-->
<junit.version>4.13.2</junit.version>

<slf4japi.version>2.0.16</slf4japi.version>

<logback-classic.version>1.3.14</logback-classic.version>

<jacksonjson.version>2.18.1</jacksonjson.version>

<maven-source-plugin.version>3.3.1</maven-source-plugin.version>

<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>

<maven-javadoc-plugin.version>3.10.1</maven-javadoc-plugin.version>

<maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>

<nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>

<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>

<mockito.version>4.11.0</mockito.version>

</properties>

<modules>
<module>retorch-annotations</module>
<module>retorch-orchestration</module>
</modules>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4japi.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback-classic.version}</version>
<scope>test</scope>
</dependency>
<dependency><!-- This package allows to serialize the resources -->
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jacksonjson.version}</version>
</dependency>
<dependency><!-- Mockito is used to get the logs and check that the errors appear https://mvnrepository.com/artifact/org.mockito/mockito-core -->
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand All @@ -36,7 +87,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -49,7 +100,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.10.1</version>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<quiet>true</quiet>
<doclint>none</doclint>
Expand All @@ -64,22 +115,60 @@
</execution>
</executions>
</plugin>
<!-- jacoco plugin for code coverage, only includes ut. Ver: https://www.petrikainulainen.net/programming/maven/creating-code-coverage-reports-for-unit-and-integration-tests-with-the-jacoco-maven-plugin/ -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<executions>
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<developers>
<developer>
<name>Cristian Augusto</name>
<url>http://giis.uniovi.es</url>
<url>https://www.augustocristian.es</url>
</developer>
<developer>
<name>Claudio de la Riva</name>
<url>http://giis.uniovi.es</url>
<url>https://giis.uniovi.es</url>
</developer>
<developer>
<name>Javier Tuya</name>
<url>http://giis.uniovi.es</url>
<url>https://giis.uniovi.es</url>
</developer>
<developer>
<name>Jesús Morán</name>
<url>https://giis.uniovi.es</url>
</developer>
</developers>
<licenses>
Expand Down Expand Up @@ -111,7 +200,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<version>${nexus-staging-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand All @@ -122,7 +211,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down
2 changes: 1 addition & 1 deletion retorch-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<url>https://github.com/giis-uniovi/retorch</url>
<organization>
<name>Software Engineering Research Group (GIIS) - University of Oviedo, ES</name>
<url>http://giis.uniovi.es/</url>
<url>https://giis.uniovi.es/</url>
</organization>

<dependencies>
Expand Down
40 changes: 40 additions & 0 deletions retorch-orchestration/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
23 changes: 23 additions & 0 deletions retorch-orchestration/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>retorch-orchestration</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8
8 changes: 8 additions & 0 deletions retorch-orchestration/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
4 changes: 4 additions & 0 deletions retorch-orchestration/.settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
Loading