Skip to content
Merged
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
149 changes: 149 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
unitAndFunctionalTests:
if: github.repository == 'eiffel-community/eiffel-intelligence'
# The type of runner that the job will run on
runs-on: ubuntu-18.04
env:
JAVA_HOME: /usr/lib/jvm/java-1.8.0-openjdk-amd64
M2_HOME: /opt/apache-maven-3.6.3
MAVEN_HOME: /opt/apache-maven-3.6.3

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Runs a set of commands using the runners shell
# Run before every job
- name: Install Java
run: |
sudo apt-get update
sudo apt-get install -y openjdk-8-jdk
java -version
uname -a
chmod +x pom.xml

- name: Install Maven
shell: bash
run: |
wget https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -P /tmp
tar xf /tmp/apache-maven-3.6.3-bin.tar.gz -C /opt
echo "${M2_HOME}/bin" >> $GITHUB_PATH

# To ensure docker containers are fully up and running we sleep 60s
- name: Before script
run: |
source src/main/docker/env.bash
docker-compose -f src/main/docker/docker-compose.yml up -d mongodb mongodb-auth rabbitmq eiffel-er mail-server
sleep 60

- name: Run unit and functional tests
run: |
mvn --version
mvn test -DskipITs -Dsurefire.rerunFailingTestsCount=2 -Djasypt.encryptor.password=secret -Dspring.config.location=src/functionaltests/resources/application.properties -B

integrationTests:
if: github.repository == 'eiffel-community/eiffel-intelligence'
# The type of runner that the job will run on
runs-on: ubuntu-18.04
env:
JAVA_HOME: /usr/lib/jvm/java-1.8.0-openjdk-amd64
M2_HOME: /opt/apache-maven-3.6.3
MAVEN_HOME: /opt/apache-maven-3.6.3

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Runs a set of commands using the runners shell
# Run before every job
- name: Install Java
run: |
sudo apt-get update
sudo apt-get install -y openjdk-8-jdk
java -version
uname -a
chmod +x pom.xml
mvn --version

- name: Install Maven
shell: bash
run: |
wget https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -P /tmp
tar xf /tmp/apache-maven-3.6.3-bin.tar.gz -C /opt
ln -s /opt/apache-maven-3.6.3 /opt/maven
echo "${M2_HOME}/bin" >> $GITHUB_PATH

# To ensure docker containers are fully up and running we sleep 60s
- name: Before script
run: |
source src/main/docker/env.bash
docker-compose -f src/main/docker/docker-compose.yml up -d mongodb mongodb-auth rabbitmq eiffel-er jenkins mail-server
sleep 60

- name: Run integration tests
run: |
mvn --version
mvn verify -DskipUTs -Djasypt.encryptor.password=integrationtest -Dspring.config.location=src/integrationtests/resources/application.properties -B

reportCoverage:
if: github.repository == 'eiffel-community/eiffel-intelligence' && github.event_name == 'push'
# The type of runner that the job will run on
runs-on: ubuntu-18.04
env:
JAVA_HOME: /usr/lib/jvm/java-1.8.0-openjdk-amd64
M2_HOME: /opt/apache-maven-3.6.3
MAVEN_HOME: /opt/apache-maven-3.6.3

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Runs a set of commands using the runners shell
# Run before every job
- name: Install Java
run: |
sudo apt-get update
sudo apt-get install -y openjdk-8-jdk
java -version
uname -a
chmod +x pom.xml
mvn --version

- name: Install Maven
shell: bash
run: |
wget https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -P /tmp
tar xf /tmp/apache-maven-3.6.3-bin.tar.gz -C /opt
echo "${M2_HOME}/bin" >> $GITHUB_PATH

- name: Run cobertura
shell: bash
run: |
mvn cobertura:cobertura -Dcobertura.report.format=xml -B

# Generating test coverage report and publishing to Codacy
- name: Run report coverage
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: 571cdd20d4bf435f84b25d806d304792
coverage-reports: target/site/cobertura/coverage.xml
48 changes: 0 additions & 48 deletions .travis.yml

This file was deleted.

12 changes: 9 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.ericsson</groupId>
<artifactId>eiffel-intelligence</artifactId>
<version>3.2.4</version>
<version>3.2.5</version>
<packaging>war</packaging>

<parent>
Expand All @@ -25,12 +25,12 @@
<skipTests>false</skipTests>
<skipITs>${skipTests}</skipITs>
<skipUTs>${skipTests}</skipUTs>
<springBootVersion>2.5.5</springBootVersion>
<springBootVersion>2.5.12</springBootVersion>
<springLdapVersion>2.3.4.RELEASE</springLdapVersion>
<springSecurityVersion>5.5.2</springSecurityVersion>
<springSessionVersion>2.5.0</springSessionVersion>
<forkCountTests>1</forkCountTests>
<jackson.version>2.12.5</jackson.version>
<jackson.version>2.13.3</jackson.version>
</properties>

<!-- Reporting Plugins -->
Expand Down Expand Up @@ -571,6 +571,9 @@
<exclude>**/TestScalingAndFailoverRunner.java</exclude>
<exclude>**/FlowTestTestExecution.java</exclude>
<exclude>**/SingleEventAggregationTest.java</exclude>
<exclude>**/SubscriptionRestAPITest.java</exclude>
<exclude>**/RunSubscriptionTest.java</exclude>
<exclude>**/TestProcessQueryParams.java</exclude>
</excludes>
</configuration>
</execution>
Expand All @@ -589,6 +592,9 @@
<include>**/TestScalingAndFailoverRunner.java</include>
<include>**/FlowTestTestExecution.java</include>
<include>**/SingleEventAggregationTest.java</include>
<include>**/SubscriptionRestAPITest.java</include>
<include>**/RunSubscriptionTest.java</include>
<include>**/TestProcessQueryParams.java</include>
</includes>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import com.ericsson.ei.utils.FunctionalTestBase;
import com.ericsson.ei.utils.HttpRequest;
import com.ericsson.ei.utils.HttpRequest.HttpMethod;
import com.ericsson.eiffelcommons.subscriptionobject.RestPostSubscriptionObject;

import cucumber.api.java.Before;
Expand Down Expand Up @@ -64,9 +65,14 @@ public class EncryptionSteps extends FunctionalTestBase {
private ClientAndServer clientAndServer;

@Before
public void init() throws IOException {
public void init() throws Exception {
clientAndServer = ClientAndServer.startClientAndServer();
mockServerPort = String.valueOf(clientAndServer.getLocalPort());
HttpRequest deleteRequest = new HttpRequest(HttpMethod.DELETE);
deleteRequest.setHost(getHostName())
.setPort(applicationPort)
.setEndpoint(SUBSCRIPTION_ROOT_ENDPOINT +"/"+ SUBSCRIPTION_NAME);
response = deleteRequest.performRequest();
setUpMock();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ public class TestEncryptionRunner {

@BeforeClass
public static void configureLdapProperties() {
System.setProperty("jasypt.encryptor.password", "secret");
}
}
Loading