Skip to content
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

action: disable tests targeting TestContainers Cloud if Forked PRs #2275

Merged
merged 5 commits into from
Feb 2, 2024
Merged
Changes from 1 commit
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
13 changes: 12 additions & 1 deletion .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,22 @@ jobs:
with:
token: ${{ secrets.TC_CLOUD_TOKEN }}

# Forked Pull Requests don't have access to GitHub secrets hence cannot use Test Containers Cloud
# this will disable the tests that require access to the Test Containers Cloud.
- name: Disable the required tests if needed
id: disabled-tests
run:
if [ "${{github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false}}" = "true" ] ; then
echo "list=" >> "$GITHUB_OUTPUT"
else
echo "list=&FullyQualifiedName!~Elastic.Apm.MongoDb.Tests" >> "$GITHUB_OUTPUT"
fi

- name: 'Tests: Unit'
uses: ./.github/workflows/test
with:
name: 'unit'
filter: 'FullyQualifiedName!~Elastic.Apm.StartupHook.Tests&FullyQualifiedName!~Elastic.Apm.Profiler.Managed.Tests&FullyQualifiedName!~Elastic.Apm.Azure'
filter: 'FullyQualifiedName!~Elastic.Apm.StartupHook.Tests&FullyQualifiedName!~Elastic.Apm.Profiler.Managed.Tests&FullyQualifiedName!~Elastic.Apm.Azure${{ steps.disabled-tests.outputs.list }}'
framework: '' # reset to test all .NET frameworks including net462

startup-hook-tests:
Expand Down
Loading