Skip to content

Commit

Permalink
Integration tests fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Matvievsky committed Sep 20, 2022
1 parent a6a8f4b commit 53265a8
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 58 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/consumer-tests-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ on:
jobs:
consumer_tests:
name: Consumer tests
runs-on: ubuntu-latest
if: |
(
github.event.comment.body == '/it' ) && (
github.event.comment.body == '/it' ||
github.event.comment.body == '/it-consumer'
) && (
github.event.comment.author_association == 'COLLABORATOR' ||
github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER'
)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
ref: ${{ github.ref }}
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Install Groovy
run: |
sudo apt-get update && sudo apt-get install groovy -y
sudo apt-get update
sudo apt-get install groovy -y
- name: Setup Git
run: |
git config --global user.email "[email protected]" && git config --global user.name "piper-testing-bot"
git config --global user.email "[email protected]"
git config --global user.name "piper-testing-bot"
- name: Run tests
env:
REPOSITORY_UNDER_TEST: ${{ github.repository }}
Expand All @@ -44,4 +44,5 @@ jobs:
NEO_DEPLOY_PASSWORD: ${{ secrets.NEO_DEPLOY_PASSWORD }}
CX_INFRA_IT_TMS_UPLOAD: ${{ secrets.CX_INFRA_IT_TMS_UPLOAD }}
run: |
cd consumer-test && groovy consumerTestController.groovy
cd ./consumer-test
groovy consumerTestController.groovy
15 changes: 7 additions & 8 deletions .github/workflows/consumer-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@ jobs:
name: Consumer tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
ref: ${{ github.ref }}
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Install Groovy
run: |
sudo apt-get update && sudo apt-get install groovy -y
sudo apt-get update
sudo apt-get install groovy -y
- name: Setup Git
run: |
git config --global user.email "[email protected]" && git config --global user.name "piper-testing-bot"
git config --global user.email "[email protected]"
git config --global user.name "piper-testing-bot"
- name: Run tests
env:
REPOSITORY_UNDER_TEST: ${{ github.repository }}
Expand All @@ -37,4 +35,5 @@ jobs:
NEO_DEPLOY_PASSWORD: ${{ secrets.NEO_DEPLOY_PASSWORD }}
CX_INFRA_IT_TMS_UPLOAD: ${{ secrets.CX_INFRA_IT_TMS_UPLOAD }}
run: |
cd consumer-test && groovy consumerTestController.groovy
cd ./consumer-test
groovy consumerTestController.groovy
45 changes: 24 additions & 21 deletions .github/workflows/integration-tests-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,29 @@ env:
jobs:
start:
name: Start
runs-on: ubuntu-latest
if: |
(
github.event.comment.body == '/it' ) && (
github.event.comment.body == '/it' ||
github.event.comment.body == '/it-go'
) && (
github.event.comment.author_association == 'COLLABORATOR' ||
github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER'
)
outputs:
sha: ${{ steps.sha.outputs.sha }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get commit SHA
id: sha
run: |
echo "::set-output name=sha::$(git log --format=%H -n 1)"
- name: Update status
run: |
curl \
--location \
--request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ github.sha }}' \
--request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ steps.sha.outputs.sha }}' \
-H 'Content-Type: application/json' \
--data '{"state": "pending",
"context": "Go / integration-tests",
Expand All @@ -42,11 +51,9 @@ jobs:
- start
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
ref: ${{ github.ref }}
ref: ${{ needs.start.outputs.sha }}
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GHA_GO_VERSION }}
Expand All @@ -66,11 +73,9 @@ jobs:
- start
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
ref: ${{ github.ref }}
ref: ${{ needs.start.outputs.sha }}
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GHA_GO_VERSION }}
Expand All @@ -94,7 +99,7 @@ jobs:
os:
- ubuntu-latest
version:
# tough CNB tests are decomposed to reduce pipeline execution time
# tough CNB tests are decomposed to reduce pipeline execution time
- '"(TestCNBIntegrationBindings|TestCNBIntegrationWrongBuilderProject|TestCNBIntegrationNonZipPath|TestCNBIntegrationZipPath|TestCNBIntegrationPreserveFilesIgnored)"'
- '"TestCNBIntegrationPreserveFiles\b"'
- '"TestCNBIntegrationNPMProject"'
Expand All @@ -106,23 +111,21 @@ jobs:
- '"TestGolangIntegration"'
- '"TestGradleIntegration"'

# Jenkins tests are still not implemented(skipped) yet
# - '"TestJenkinsIntegration"'
# Jenkins tests are still not implemented(skipped) yet
#- '"TestJenkinsIntegration"'

- '"TestMavenIntegration"'
- '"TestMTAIntegration"'
- '"TestNexusIntegration"'

# these are light-weighed tests, so we can use only one pod to reduce resource consumption
# these are light-weighted tests, so we can use only one pod to reduce resource consumption
- '"Test(Gauge|GCS|GitHub|GitOps|Influx|NPM|Piper|Python|Sonar|Vault|Karma)Integration"'

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
ref: ${{ github.ref }}
ref: ${{ needs.start.outputs.sha }}
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GHA_GO_VERSION }}
Expand Down Expand Up @@ -158,7 +161,7 @@ jobs:
then
curl \
--location \
--request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ github.sha }}' \
--request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ needs.start.outputs.sha }}' \
-H 'Content-Type: application/json' \
--data '{"state": "success",
"context": "Go / integration-tests",
Expand All @@ -168,7 +171,7 @@ jobs:
else
curl \
--location \
--request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ github.sha }}' \
--request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ needs.start.outputs.sha }}' \
-H 'Content-Type: application/json' \
--data '{"state": "failure",
"context": "Go / integration-tests",
Expand Down
39 changes: 20 additions & 19 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@ env:
jobs:
start:
name: Start
outputs:
sha: ${{ steps.sha.outputs.sha }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get commit SHA
id: sha
run: |
echo "::set-output name=sha::$(git log --format=%H -n 1)"
- name: Update status
run: |
curl \
--location \
--request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ github.sha }}' \
--request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ steps.sha.outputs.sha }}' \
-H 'Content-Type: application/json' \
--data '{"state": "pending",
"context": "Go / integration-tests",
Expand All @@ -35,11 +42,9 @@ jobs:
- start
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
ref: ${{ github.ref }}
ref: ${{ needs.start.outputs.sha }}
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GHA_GO_VERSION }}
Expand All @@ -59,11 +64,9 @@ jobs:
- start
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
ref: ${{ github.ref }}
ref: ${{ needs.start.outputs.sha }}
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GHA_GO_VERSION }}
Expand All @@ -87,7 +90,7 @@ jobs:
os:
- ubuntu-latest
version:
# tough CNB tests are decomposed to reduce pipeline execution time
# tough CNB tests are decomposed to reduce pipeline execution time
- '"(TestCNBIntegrationBindings|TestCNBIntegrationWrongBuilderProject|TestCNBIntegrationNonZipPath|TestCNBIntegrationZipPath|TestCNBIntegrationPreserveFilesIgnored)"'
- '"TestCNBIntegrationPreserveFiles\b"'
- '"TestCNBIntegrationNPMProject"'
Expand All @@ -99,23 +102,21 @@ jobs:
- '"TestGolangIntegration"'
- '"TestGradleIntegration"'

# Jenkins tests are still not implemented(skipped) yet
# - '"TestJenkinsIntegration"'
# Jenkins tests are still not implemented(skipped) yet
#- '"TestJenkinsIntegration"'

- '"TestMavenIntegration"'
- '"TestMTAIntegration"'
- '"TestNexusIntegration"'

# these are light-weighed tests, so we can use only one pod to reduce resource consumption
# these are light-weighted tests, so we can use only one pod to reduce resource consumption
- '"Test(Gauge|GCS|GitHub|GitOps|Influx|NPM|Piper|Python|Sonar|Vault|Karma)Integration"'

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ${{ github.repository }}
ref: ${{ github.ref }}
ref: ${{ needs.start.outputs.sha }}
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GHA_GO_VERSION }}
Expand Down Expand Up @@ -151,7 +152,7 @@ jobs:
then
curl \
--location \
--request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ github.sha }}' \
--request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ needs.start.outputs.sha }}' \
-H 'Content-Type: application/json' \
--data '{"state": "success",
"context": "Go / integration-tests",
Expand All @@ -161,7 +162,7 @@ jobs:
else
curl \
--location \
--request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ github.sha }}' \
--request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ needs.start.outputs.sha }}' \
-H 'Content-Type: application/json' \
--data '{"state": "failure",
"context": "Go / integration-tests",
Expand Down

0 comments on commit 53265a8

Please sign in to comment.