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

Intial smoke tests #1268

Merged
merged 4 commits into from
Oct 24, 2023
Merged

Intial smoke tests #1268

merged 4 commits into from
Oct 24, 2023

Conversation

lukehinds
Copy link
Contributor

Basic smoke tests to perform health checks against grpc / HTTP endpoints and ensure basic auth controls are in place.

Happy to expand on these, but I am noticing some overlap with other tests. Please say in review if you want anything else.

The expectation is these might run in CI and be pointed towards staging.

HTTP_HOST=https://app.staging.stacklok.dev go test internal/smoke/smoke_test.go

Basic smoke tests to perform health checks against grpc / HTTP
endpoints and ensure basic auth controls are in place.

Happy to expand on these, but I am noticing some overlap with other
tests. Please say in review if you want anything else.

The expectation is these might run in CI and be pointed towards
staging.

HTTP_HOST=https://app.staging.stacklok.dev go test internal/smoke/smoke_test.go

Signed-off-by: Luke Hinds <luke@stacklok.com>
Signed-off-by: Luke Hinds <luke@stacklok.com>
Signed-off-by: Luke Hinds <luke@stacklok.com>
@lukehinds
Copy link
Contributor Author

of course, I need to gate these from happening in regular go test:

📦 github.com/stacklok/mediator/internal/smoke
❌ TestAuthUserService (0s)
❌ TestGRPCHealthCheck (0s)
❌ TestGetAuthorizationURL (0s)
❌ TestHTTPHealthCheck (0s)
❌ TestRevokeProviderToken (0s)
❌ TestStoreProviderToken (0s)

@evankanderson
Copy link
Member

You'll want to add a build tag for this

Signed-off-by: Luke Hinds <luke@stacklok.com>
Copy link
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

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

This seems to work:

GRPC_HOST=127.0.0.1:8090 HTTP_HOST=http://127.0.0.1:8080 go test -tags=smoke ./...

we get:

ok      github.com/stacklok/mediator/internal/smoke     0.155s

Question: Do we want to add a Makefile target?

@rdimitrov rdimitrov merged commit 8be648e into stacklok:main Oct 24, 2023
12 checks passed
@evankanderson
Copy link
Member

Question: Do we want to add a Makefile target?

I think this can be a future task -- this gives us at least a bit of a framework to work with.

We might be able to leverage GITHUB_TOKEN from the GitHub API to enable login to mediator in staging, or we could store a secret with an auth token to mediator...

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.

None yet

4 participants