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
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

jobs:
thundra_test_initializer:
runs-on: ubuntu-latest
outputs:
thundra_agent_testrun_id: ${{ steps.thundra_test_initializer.outputs.thundra_agent_testrun_id }}
steps:
- uses: actions/checkout@v2
- id: thundra_test_initializer
uses: thundra-io/thundra-test-init-action@v1
find_gradle_jobs:
runs-on: ubuntu-18.04
outputs:
Expand All @@ -34,7 +42,7 @@ jobs:
echo $TASKS
echo "::set-output name=matrix::{\"gradle_args\":$TASKS}"
check:
needs: find_gradle_jobs
needs: [find_gradle_jobs, thundra_test_initializer]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.find_gradle_jobs.outputs.matrix) }}
Expand All @@ -53,9 +61,19 @@ jobs:
key: ${{ runner.os }}-gradle-home-${{matrix.gradle_args}}_check-${{ hashFiles('**/*.gradle') }}
- name: Clear existing docker image cache
run: docker image prune -af
- name: Thundra Gradle Test Instrumentation
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: thundra-io/thundra-gradle-test-action@v1
with:
apikey: ${{ secrets.THUNDRA_API_KEY }}
project_id: ${{ secrets.THUNDRA_PROJECT_ID }}
- name: Build and test with Gradle (${{matrix.gradle_args}})
run: |
./gradlew --no-daemon --continue --scan ${{matrix.gradle_args}}
./gradlew --no-daemon --continue --scan ${{matrix.gradle_args}} \
$($THUNDRA_GRADLE_INIT_SCRIPT_PATH || echo "--init-script $THUNDRA_GRADLE_INIT_SCRIPT_PATH")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the easiest way to understand if the Thundra step was successful and if so, instrument the build. If not, we don't want to break the build. Hence the check.

The template of the init script can be found here: https://github.com/thundra-io/thundra-gradle-test-action/blob/master/templates/thundra.gradle.ejs

env:
THUNDRA_AGENT_TEST_RUN_ID: ${{ needs.thundra_test_initializer.outputs.thundra_agent_testrun_id }}
THUNDRA_AGENT_REPORT_REST_BASEURL: https://collector.thundra.us/v1
Copy link
Contributor Author

@rwxdash rwxdash Aug 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This base URL is for our staging environment. Our showroom page is fetching the data from this environment. Normally, in production, you don't need to set this. We wanted to split the showroom environment from production, that's why this is needed here.

httpclient5_test:
runs-on: ubuntu-18.04
steps:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Testcontainers

[![Thundra Foresight](https://thundra-assets-prod.s3.us-west-2.amazonaws.com/images/badges/thundra-foresight-badge-enabled.svg)](https://foresight.thundra.live/testRuns/5a49cc30-f063-11eb-9a03-0242ac130003)

> Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.

![Testcontainers logo](docs/logo.png)
Expand Down