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

Initial E2E tests infrastructure #29

Merged
merged 27 commits into from
Feb 19, 2024
Merged

Initial E2E tests infrastructure #29

merged 27 commits into from
Feb 19, 2024

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Jan 25, 2024

E2E Tests: Elastic's .NET OpenTelemetry Distribution

Target Environment

Requires an already running serverless observability project on cloud.

The configuration can be provided either as asp.net secrets or environment variables.

dotnet user-secrets set "E2E:Endpoint" "<url>" --project tests/Elastic.OpenTelemetry.IntegrationTests
dotnet user-secrets set "E2E:Authorization" "<header>" --project tests/Elastic.OpenTelemetry.IntegrationTests

The equivalent environment variables are E2E__ENDPOINT and E2E__AUTHORIZATION. For local development setting
secrets is preferred.

This ensures the instrumented applications will send OTLP data.

Browser authentication

The tests require a headless browser to login. This requires a non OAuth login to be setup on your serverless
observability project.

To do this is to invite an email address you own to your organization:

https://cloud.elastic.co/account/members

This user only needs instance access to the Target Environment.

NOTE: since you can only be part of a single organization on cloud be sure that the organization you are part of is
not used for any production usecases and you have clearance from the organization owner.

By default accounts on cloud are part of their own personal organization.

Once invited and accepted the invited email can be used to login during the automated tests.

These can be provided again as user secrets:

dotnet user-secrets set "E2E:BrowserEmail" "<email>" --project tests/Elastic.OpenTelemetry.IntegrationTests
dotnet user-secrets set "E2E:BrowserPassword" "<password>" --project tests/Elastic.OpenTelemetry.IntegrationTests

or environment variables (E2E__BROWSEREMAIL and E2E__BROWSERPASSWORD).

@Mpdreamz Mpdreamz changed the title feature/integration tests Initial E2E tests infrastructure Jan 25, 2024
@Mpdreamz Mpdreamz removed the request for review from stevejgordon January 25, 2024 14:30
@Mpdreamz Mpdreamz marked this pull request as draft January 25, 2024 14:30
@v1v
Copy link
Member

v1v commented Feb 2, 2024

Requires an already running serverless observability project on cloud.

What environment? Should this be a long-running serverless project? A few long-lived serverless projects are running at the moment.

Otherwise, we use some oblt-cli tooling to create ephemeral serverless projects elsewhere. I don't know what you prefer.

@Mpdreamz
Copy link
Member Author

Mpdreamz commented Feb 5, 2024

What environment? Should this be a long-running serverless project? A few long-lived serverless projects are running at the moment.

Preferably long running, our UI tests scope to per run service names so are designed to share a single serverless observability project.

@v1v
Copy link
Member

v1v commented Feb 5, 2024

Awesome.

@kuisathaverat, can we use the keep serverless projects? If so, can I use the vault secrets as usual?

@Mpdreamz , If possible, I'd say to use the production-canary one for now. Unless you wanna use staging explicitly.

@kuisathaverat
Copy link

can we use the keep serverless projects?

yes, the name must start with keep_ in Qa and staging, for production is not needed

If so, can I use the vault secrets as usual?

We all remove it soon, the Google Cloud Secrets Manager is already in place, and we duplicate the secrets in Vault for the moment. As soon as I finish the changes I will stop creating Vault secrets. All the tools will be adapted at that point, so the change will be transparent for CI.

@v1v
Copy link
Member

v1v commented Feb 5, 2024

The configuration can be provided either as asp.net secrets or environment variables.

What's the GitHub action that will run for this e2e? Then I can add the Vault github action to read those secrets and prepare the environment variables

The oblt-cli-cluster-credentials is the GitHub action that can help to read the secrets for any long-running project in Elastic Cloud/Serverless.

For instance, this snippet illustrates how we test the above GitHub action.

NOTE: bear in mind, @main is not the version but @current, aka the stable version.

There are a few serverless projects:

  • production -> serverless-production-oblt
  • staging -> keep_serverless-staging-oblt
  • qa -> keep_serverless-qa-oblt

If possible, I'd say to use one of the existing secrets rather than E2E__ENDPOINT/E2E__AUTHORIZATION, those secrets can be found here

@Mpdreamz , how do you wanna proceed?

@v1v
Copy link
Member

v1v commented Feb 6, 2024

#32 is configuring the env variables to access the serverless projects. Let me know what you think

@Mpdreamz Mpdreamz marked this pull request as ready for review February 13, 2024 14:40
@Mpdreamz
Copy link
Member Author

Ready for review, e2e temporarily disabled.

Since its now bootstrapping successfully I'll move to a new PR with less folks participating to keep the noise down.

Copy link
Contributor

@stevejgordon stevejgordon left a comment

Choose a reason for hiding this comment

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

A couple of minor questions for discussion, but otherwise looks good.

Copy link
Contributor

@stevejgordon stevejgordon left a comment

Choose a reason for hiding this comment

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

LGTM

@Mpdreamz Mpdreamz merged commit e3633c0 into main Feb 19, 2024
3 checks passed
@Mpdreamz Mpdreamz deleted the feature/integration-tests branch February 19, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants