forked from eclipse-tractusx/tractusx-edc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eclipse-tractusx#139 from catenax-ng/feature/refac…
…tor_tests refactor: restructure tests, add JVM based e2e tests
- Loading branch information
Showing
92 changed files
with
1,093 additions
and
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
# | ||
# Copyright (c) 2023 ZF Friedrichshafen AG | ||
# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH | ||
# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache License, Version 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
--- | ||
name: "Build" | ||
|
||
|
@@ -20,6 +42,7 @@ on: | |
- '*' | ||
workflow_dispatch: | ||
|
||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
@@ -41,74 +64,9 @@ jobs: | |
[ ! -z "${{ secrets.GPG_PASSPHRASE }}" ] && echo "::set-output name=GPG_PASSPHRASE::true" | ||
exit 0 | ||
verify-formatting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- | ||
name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: 'gradle' | ||
- | ||
name: Verify proper formatting | ||
run: ./gradlew spotlessCheck | ||
|
||
- name: Run Checkstyle | ||
run: | | ||
./gradlew checkstyleMain checkstyleTest | ||
echo "Running Checkstyle is currently a placeholder" | ||
sonar: | ||
needs: [ secret-presence, verify-formatting ] | ||
if: | | ||
needs.secret-presence.outputs.SONAR_TOKEN | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Set-Up | ||
- | ||
name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: 'gradle' | ||
- | ||
name: Cache SonarCloud packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.sonar/cache | ||
key: ${{ runner.os }}-sonar | ||
restore-keys: ${{ runner.os }}-sonar | ||
# Analyse | ||
- | ||
name: Build with Maven and analyze with Sonar | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
JACOCO: true | ||
run: |- | ||
./gradlew sonar \ | ||
-Pcoverage,failsafe \ | ||
-Dsonar.projectKey=${GITHUB_REPOSITORY_OWNER}_product-edc \ | ||
-Dsonar.organization=${GITHUB_REPOSITORY_OWNER} \ | ||
-Dsonar.host.url=https://sonarcloud.io \ | ||
-Dsonar.coverage.jacoco.xmlReportPaths=${GITHUB_WORKSPACE}/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml \ | ||
-Dsonar.verbose=true | ||
build-extensions: | ||
runs-on: ubuntu-latest | ||
needs: [ secret-presence, verify-formatting ] | ||
needs: [ secret-presence] | ||
steps: | ||
# Set-Up | ||
- | ||
|
@@ -135,7 +93,7 @@ jobs: | |
permissions: | ||
contents: read | ||
packages: write | ||
needs: [ secret-presence, verify-formatting ] | ||
needs: [ secret-presence] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -204,7 +162,7 @@ jobs: | |
permissions: | ||
contents: read | ||
packages: write | ||
needs: [ secret-presence, verify-formatting ] | ||
needs: [ secret-presence] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -271,7 +229,7 @@ jobs: | |
permissions: | ||
contents: read | ||
packages: write | ||
needs: [secret-presence, verify-formatting, build-controlplane, build-dataplane, build-extensions] | ||
needs: [secret-presence, build-controlplane, build-dataplane, build-extensions] | ||
|
||
# do not run on PR branches, do not run on main | ||
if: | | ||
|
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,193 @@ | ||
# | ||
# Copyright (c) 2023 Mercedes-Benz Tech Innovation GmbH | ||
# Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache License, Version 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
--- | ||
name: "Verify" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
release: | ||
types: | ||
- published | ||
pull_request: | ||
paths-ignore: | ||
- 'charts/**' | ||
- 'docs/**' | ||
- '**/*.md' | ||
branches: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
secret-presence: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
SONAR_TOKEN: ${{ steps.secret-presence.outputs.SONAR_TOKEN }} | ||
steps: | ||
- | ||
name: Check whether secrets exist | ||
id: secret-presence | ||
run: | | ||
[ ! -z "${{ secrets.SONAR_TOKEN }}" ] && echo "::set-output name=SONAR_TOKEN::true" | ||
exit 0 | ||
verify-formatting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- | ||
name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: 'gradle' | ||
- | ||
name: Verify proper formatting | ||
run: ./gradlew spotlessCheck | ||
|
||
- name: Run Checkstyle | ||
run: | | ||
./gradlew checkstyleMain checkstyleTest | ||
echo "Running Checkstyle is currently a placeholder" | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
needs: [verify-formatting] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: 'gradle' | ||
|
||
- name: Run Unit tests | ||
run: ./gradlew test | ||
|
||
integration-tests: | ||
runs-on: ubuntu-latest | ||
needs: [verify-formatting] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: 'gradle' | ||
|
||
- name: Run Integration tests | ||
run: ./gradlew test -DincludeTags="ComponentTest" | ||
|
||
api-tests: | ||
runs-on: ubuntu-latest | ||
needs: [verify-formatting] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: 'gradle' | ||
|
||
- name: Run API tests | ||
run: ./gradlew test -DincludeTags="ApiTest" | ||
|
||
end-to-end-tests: | ||
runs-on: ubuntu-latest | ||
needs: [verify-formatting] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: 'gradle' | ||
|
||
- name: Run E2E tests | ||
run: ./gradlew test -DincludeTags="EndToEndTest" | ||
|
||
sonar: | ||
needs: [ secret-presence, verify-formatting ] | ||
if: | | ||
needs.secret-presence.outputs.SONAR_TOKEN | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Set-Up | ||
- | ||
name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
cache: 'gradle' | ||
- | ||
name: Cache SonarCloud packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.sonar/cache | ||
key: ${{ runner.os }}-sonar | ||
restore-keys: ${{ runner.os }}-sonar | ||
# Analyse | ||
- | ||
name: Build with Maven and analyze with Sonar | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
JACOCO: true | ||
run: |- | ||
./gradlew sonar \ | ||
-Pcoverage,failsafe \ | ||
-Dsonar.projectKey=${GITHUB_REPOSITORY_OWNER}_product-edc \ | ||
-Dsonar.organization=${GITHUB_REPOSITORY_OWNER} \ | ||
-Dsonar.host.url=https://sonarcloud.io \ | ||
-Dsonar.coverage.jacoco.xmlReportPaths=${GITHUB_WORKSPACE}/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml \ | ||
-Dsonar.verbose=true | ||
Oops, something went wrong.