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

Use Github Actions for unit and integration tests #8968

Merged
merged 6 commits into from
Apr 1, 2022
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
2 changes: 0 additions & 2 deletions .github/codeql/codeql-config.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Code quality
on:
push:
branches:
- main
- stable/*
- release/*
- trying
- staging
pull_request: {}
jobs:
codeql:
name: CodeQL
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: java
queries: +security-and-quality
- name: Build
run: mvn -B -T1C -DskipTests -DskipChecks install
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
go-lint:
name: Go linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.32
working-directory: clients/go
java-format:
name: Java formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- run: mvn -T1C -B -D skipTests -P checkFormat,-autoFormat validate
30 changes: 0 additions & 30 deletions .github/workflows/codeql.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/golangci-lint.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/os-smoke-test.yml

This file was deleted.

157 changes: 157 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Tests

on:
push:
branches:
- main
- stable/*
- release/*
- trying
- staging
pull_request: {}
workflow_dispatch: {}

jobs:
integration-tests:
name: Integration tests
runs-on: "n1-standard-32-netssd-preempt"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- uses: stCarolas/setup-maven@v4.3
with:
maven-version: 3.8.5
- run: mvn -T1C -B -DskipChecks -DskipTests package
- run: docker build --build-arg DISTBALL=dist/target/camunda-zeebe-*.tar.gz --build-arg APP_ENV=dev -t camunda/zeebe:current-test .
remcowesterhoud marked this conversation as resolved.
Show resolved Hide resolved
- run: mvn -pl !:zeebe-elasticsearch-exporter -T2 -B -D skipUTs -D skipChecks -Dfailsafe.rerunFailingTestsCount=3 -Dflaky.test.reportDir=failsafe-reports -D junitThreadCount=12 -P parallel-tests,extract-flaky-tests verify
- name: Archive Test Results
uses: actions/upload-artifact@v2
if: failure()
with:
name: Integration test results
path: "**/target/failsafe-reports/"
retention-days: 7
exporter-tests:
name: Exporter tests
runs-on: "n1-standard-8-netssd-preempt"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- uses: stCarolas/setup-maven@v4.3
with:
maven-version: 3.8.5
- run: mvn -T1C -B -DskipChecks -DskipTests package
- run: docker build --build-arg DISTBALL=dist/target/camunda-zeebe-*.tar.gz --build-arg APP_ENV=dev -t camunda/zeebe:current-test .
remcowesterhoud marked this conversation as resolved.
Show resolved Hide resolved
- run: mvn -pl :zeebe-elasticsearch-exporter -B -D skipUTs -D skipChecks -Dfailsafe.rerunFailingTestsCount=3 verify
- name: Archive Test Results
uses: actions/upload-artifact@v2
if: failure()
with:
name: Exporter test results
path: "**/target/failsafe-reports/"
retention-days: 7
project-list:
lenaschoenburg marked this conversation as resolved.
Show resolved Hide resolved
# Builds a list of projects where unit tests can be run on hosted runners
name: List projects
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt-get -y install jq
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Get Project List
id: list-projects
# Build a json array of module names that can be used for the matrix in `unit-tests`
run: >
echo "::set-output name=projects::$(mvn -pl !:zeebe-workflow-engine,!:zeebe-logstreams -Dexec.executable='echo' -Dexec.args='${project.artifactId}' exec:exec -q | jq -cnR [inputs])"
outputs:
projects: ${{ steps.list-projects.outputs.projects }}
unit-tests:
name: Unit tests
needs: project-list
strategy:
fail-fast: false
matrix:
project: ${{ fromJson(needs.project-list.outputs.projects) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- run: mvn -T1C -B -D skipTests -D skipChecks -am -pl :${{ matrix.project }} package
- run: mvn -B -D skipITs -D skipChecks verify -pl :${{ matrix.project }}
- name: Archive Test Results
uses: actions/upload-artifact@v2
if: failure()
with:
name: Unit test results for ${{ matrix.project }}
path: "**/target/surefire-reports/"
retention-days: 7
slow-unit-tests:
name: Slow unit tests
runs-on: ["n1-standard-8-netssd-preempt"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- uses: stCarolas/setup-maven@v4.3
with:
maven-version: 3.8.5
- run: mvn -T1C -B -D skipTests -D skipChecks -am -pl :zeebe-workflow-engine,:zeebe-logstreams package
- run: mvn -B -D skipITs -D skipChecks -pl :zeebe-workflow-engine,:zeebe-logstreams verify
- name: Archive Test Results
uses: actions/upload-artifact@v2
if: failure()
with:
name: Slow unit test results
path: "**/target/surefire-reports/"
retention-days: 7
smoke-tests:
# This name is hard-referenced from bors.toml
# Remember to update that if this name, or the matrix.os changes
name: Smoke tests on ${{ matrix.os }}
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
env:
JAVA_TOOL_OPTIONS: -XX:+TieredCompilation -XX:TieredStopAtLevel=1
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Build relevant modules
run: mvn -B -am -pl qa/integration-tests install -DskipTests -DskipChecks "-Dmaven.javadoc.skip=true" -T1C
- name: Run smoke test
run: mvn -B -pl qa/integration-tests verify -P smoke-test -DskipUTs -DskipChecks
- name: Archive Test Results
uses: actions/upload-artifact@v2
if: failure()
with:
name: Smoke test results for ${{ matrix.os }}
path: "**/target/failsafe-reports/"
retention-days: 7

6 changes: 3 additions & 3 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
status = [
"continuous-integration/jenkins/branch",
# "Run smoke tests on macos-latest",
"Run smoke tests on windows-2022",
"Run smoke tests on ubuntu-latest"
"Smoke tests on macos-latest",
"Smoke tests on windows-2022",
"Smoke tests on ubuntu-latest"
]

required_approvals = 1
Expand Down
18 changes: 18 additions & 0 deletions exporters/elasticsearch-exporter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,24 @@
</ignoredNonTestScopedDependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/IT*.java</include>
<include>**/*IT.java</include>
<include>**/*ITCase.java</include>
</includes>
<!--
as our in-house CI does not enable IPv6, clients not running in a Testcontainer-managed
container will not be able to use IPv6; as such, ensure we always prefer IPv4 when
resolving host names
-->
<argLine>-XX:MaxDirectMemorySize=4g -Djava.net.preferIPv4Stack=true</argLine>
</configuration>
</plugin>

</plugins>
</build>
</project>