Skip to content

Commit

Permalink
chore(EWT-560): Dependency updates and improved reporting for failed …
Browse files Browse the repository at this point in the history
…acceptance tests (#288)
  • Loading branch information
dili91 authored May 16, 2024
1 parent f3bfb39 commit 3d6a592
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 51 deletions.
66 changes: 25 additions & 41 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,58 +39,42 @@ jobs:
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3
- name: Acceptance tests in sandbox
env:
TL_CLIENT_ID: ${{ secrets.tl_client_id }}
TL_CLIENT_SECRET: ${{ secrets.tl_client_secret }}
TL_SIGNING_KEY_ID: ${{ secrets.tl_signing_key_id }}
TL_SIGNING_PRIVATE_KEY: ${{ secrets.tl_signing_private_key }}
run: ./gradlew acceptance-tests
- uses: actions/upload-artifact@v4
name: Upload test results as artifact
if: always()
with:
name: test-results
path: ./build/test-results
retention-days: 1
notify-slack:
needs: acceptance-tests
runs-on: ubuntu-latest
if: ${{ always() && contains(needs.*.result, 'failure') && inputs.notify_slack_on_failure == true }}
steps:
- name: Notify slack
uses: slackapi/[email protected]
- uses: actions/download-artifact@v4
name: Download test results artifacts
with:
name: test-results
path: ./build/test-results
- uses: dili91/[email protected]
name: Generate Slack report from Junit results
id: generate_slack_report
with:
title: ":fire: Acceptance tests are failing in Sandbox on the Java backend library!"
include_skipped: true
reports_pattern: './build/test-results/**/*.xml'
- name: Send Slack report
uses: slackapi/[email protected]
with:
payload: ${{steps.generate_slack_report.outputs.report}}
env:
SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_url }}
# type is required for custom payloads
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":fire: *Acceptance tests* are failing in *Sandbox* on our *Java* backend library! :java:"
}
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": ":eyes: View on Github"
},
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
},
{
"type": "image",
"title": {
"type": "plain_text",
"text": "I don't like that",
"emoji": true
},
"image_url": "https://media.giphy.com/media/jOpLbiGmHR9S0/giphy.gif",
"alt_text": "this is the worst"
}
]
}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
4 changes: 2 additions & 2 deletions .github/workflows/build-test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
distribution: ${{ matrix.java-distribution }}
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3
- name: Get project version
id: get_project_version
run: |
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3
- name: Test coverage
run: ./gradlew unit-tests jacocoTestReport coveralls
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3
- name: Create Snapshot version
run: |
CHECKOUT_REF=${{inputs.checkout_ref}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3
- name: Create tag
id: create_tag
uses: mathieudutour/[email protected]
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {
// signing
id "signing"
// nexus publishing
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
}

compileJava {
Expand Down Expand Up @@ -85,7 +85,7 @@ tasks.register('acceptance-tests', Test) {
dependencies {
// Utilities
implementation group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.4'
implementation group: 'org.apache.commons', name: 'commons-configuration2', version: '2.9.0'
implementation group: 'org.apache.commons', name: 'commons-configuration2', version: '2.10.1'


// HTTP client
Expand Down Expand Up @@ -113,11 +113,11 @@ dependencies {
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: '5.10.2'

// Mocking libraries
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.11.0'
testImplementation group: 'org.wiremock', name: 'wiremock', version: '3.5.2'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.12.0'
testImplementation group: 'org.wiremock', name: 'wiremock', version: '3.5.4'

// Wait test utility
testImplementation group: 'org.awaitility', name: 'awaitility', version: '4.2.0'
testImplementation group: 'org.awaitility', name: 'awaitility', version: '4.2.1'

// Transitive dependencies constraints
constraints {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Main properties
group=com.truelayer
archivesBaseName=truelayer-java
version=13.0.0
version=13.0.1

# Artifacts properties
sonatype_repository_url=https://s01.oss.sonatype.org/service/local/
Expand Down

0 comments on commit 3d6a592

Please sign in to comment.