-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add Thundra Foresight Integration to the CI Build #4313
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b8ad699
Add Thundra Gradle Test Action for Thundra Foresight Integration
rwxdash 20543af
Add Thundra Foresight badge
rwxdash 5aba329
Run only on master and check if init script exist
rwxdash a781039
Remove Thundra related test environment settings and set the proper s…
rwxdash d8ae332
Update Thundra badge URL to target showroom env
rwxdash fa77a86
Set Thundra collector base URL to showroom environment
rwxdash c21d276
Update CI build for testrun ID to use Thundra init action
rwxdash 98bf55d
Revert unnecessary changes
rwxdash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -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: | ||
|
|
@@ -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) }} | ||
|
|
@@ -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") | ||
| 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 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | ||
|
|
||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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