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

update ats tests #229

Merged
merged 8 commits into from
Aug 19, 2024
Merged

update ats tests #229

merged 8 commits into from
Aug 19, 2024

Conversation

QuantumEnigmaa
Copy link
Contributor

Towards giantswarm/roadmap#3612

This PR updates the tests run by ats so that those tests are run before pushing the app to all collections. The tests only check the following :

  • api-server availability
  • grafana deployment present
  • grafana pod running and ready

@QuantumEnigmaa
Copy link
Contributor Author

All tests passing

Comment on lines 17 to 26
def test_api_working(kube_cluster: Cluster) -> None:
"""Very minimalistic example of using the [kube_cluster](pytest_helm_charts.fixtures.kube_cluster)
fixture to get an instance of [Cluster](pytest_helm_charts.clusters.Cluster) under test
and access its [kube_client](pytest_helm_charts.clusters.Cluster.kube_client) property
to get access to Kubernetes API of cluster under test.
Please refer to [pykube](https://pykube.readthedocs.io/en/latest/api/pykube.html) to get docs
for [HTTPClient](https://pykube.readthedocs.io/en/latest/api/pykube.html#pykube.http.HTTPClient).
"""
assert kube_cluster.kube_client is not None
assert len(pykube.Node.objects(kube_cluster.kube_client)) >= 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this test?
According to the comments it's just supposed to be an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not absolutely necessary but still nice to make sure that the apiserver is reachable before proceeding with any further tests right ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, why not, but then that's what the comment should say.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the comment.

tests/test-values.yaml Outdated Show resolved Hide resolved
@hervenicol
Copy link
Contributor

That looks really great! 😲 👍

@QuantumEnigmaa
Copy link
Contributor Author

QuantumEnigmaa commented Aug 1, 2024

Maybe I should move the chart templating test before the jobs pushing the app to the catalogs ? 🤔

# Do not trigger the job on merge to master.
branches:
ignore:
- master
Copy link
Contributor

Choose a reason for hiding this comment

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

You mean main right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would have preferred but unfortunately, this repo's "main" branch is called "master" :/

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it? Maybe we should change it then :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would totally agree :)

@QuantumEnigmaa QuantumEnigmaa merged commit 1ba2c22 into master Aug 19, 2024
6 checks passed
@QuantumEnigmaa QuantumEnigmaa deleted the update-ats-tests branch August 19, 2024 12:48
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.

3 participants