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

ci: spin-up ephemeral ESS clusters to run some system tests #2551

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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
71 changes: 70 additions & 1 deletion .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:

- name: 'Tests: Unit'
run: ./build.sh test --test-suite unit

azure-tests:
runs-on: ubuntu-latest
needs: [ 'format', 'tests' ]
Expand Down Expand Up @@ -164,3 +164,72 @@ jobs:
run: |
docker build . -t docker.elastic.co/observability/apm-agent-dotnet:${{ steps.bootstrap.outputs.agent-version }} \
--build-arg AGENT_ZIP_FILE=build/output/elastic_apm_profiler_${{ steps.bootstrap.outputs.agent-version }}-linux-x64.zip

system-tests:
runs-on: ubuntu-latest
needs: [ 'tests' ]
# Skip pull_request event from forks and dependabot
if: github.event_name != 'pull_request' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
# NOTE: edge-oblt version is the next major version for APM Server
# dev-oblt version is the the next minor release for APM Server
# release-oblt version is the latest release or current BC for APM Server
remote-cluster:
- 'edge-oblt'
- 'dev-oblt'
- 'release-oblt'
steps:
- uses: actions/checkout@v4

- uses: elastic/oblt-actions/google/auth@v1

- name: Get token
id: get_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.OBS_AUTOMATION_APP_ID }}
private_key: ${{ secrets.OBS_AUTOMATION_APP_PEM }}
permissions: >-
{
"contents": "write",
"pull_requests": "read"
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
"pull_requests": "read"
"pull_requests": "read",
"checks": "read"

}
repositories: >-
["observability-test-environments"]

- uses: elastic/oblt-actions/git/setup@v1
with:
github-token: ${{ steps.get_token.outputs.token }}

- name: Setup ephemeral cluster
uses: elastic/oblt-actions/oblt-cli/cluster-create-ccs@v1
id: cluster_create
with:
github-token: ${{ steps.get_token.outputs.token }}
remote-cluster: ${{ matrix.remote-cluster }}
cluster-name-prefix: 'dotnet'
wait: 15

- name: Setup credentials for the ephemeral cluster
uses: elastic/oblt-actions/oblt-cli/cluster-credentials@v1
with:
cluster-name: ${{ steps.cluster_create.outputs.cluster-name }}
github-token: ${{ steps.get_token.outputs.token }}

# NOTE: you can now use the cluster credentials to run your tests
# please see https://github.com/elastic/oblt-actions/tree/v1/oblt-cli/cluster-credentials#exported-environment-variables
# for the environment variables that are set by this action
- run: echo "TBC"
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the step to honour the created ephemeral ESS projects

@stevejgordon, what are your thoughts?


- name: Tear down ephemeral cluster
uses: elastic/oblt-actions/oblt-cli/cluster-destroy@v1
if: always()
continue-on-error: true
with:
github-token: ${{ steps.get_token.outputs.token }}
cluster-name: ${{ steps.cluster_create.outputs.cluster-name }}
Loading