Skip to content

Commit

Permalink
ATS: Rework tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gacko committed Nov 20, 2023
1 parent 8bce388 commit 0c64894
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 474 deletions.
14 changes: 11 additions & 3 deletions .ats/main.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
app-tests-skip-app-deploy: true
app-tests-app-config-file: tests/values.yaml
app-tests-deploy-namespace: kube-system

smoke-tests-cluster-config-file: tests/kind_config.yaml
smoke-tests-cluster-type: kind
skip-steps: [functional, upgrade]
smoke-tests-cluster-config-file: tests/cluster.yaml

functional-tests-cluster-type: kind
functional-tests-cluster-config-file: tests/cluster.yaml

upgrade-tests-cluster-type: kind
upgrade-tests-cluster-config-file: tests/cluster.yaml
upgrade-tests-app-catalog-url: https://giantswarm.github.io/giantswarm-catalog
upgrade-tests-app-config-file: tests/values.yaml
12 changes: 2 additions & 10 deletions tests/ats/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@ name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[packages]
pytest-helm-charts = ">=1.1.1"
pytest = ">=6.2.5"
pykube-ng = ">=21.10.0"
pyyaml = "~=6.0"
pytest-rerunfailures = ">=10.2"
requests = "~=2.31.0"

[requires]
python_version = "3.9"

[pipenv]
allow_prereleases = true
[packages]
pytest-helm-charts = ">=1.1.2"
368 changes: 0 additions & 368 deletions tests/ats/Pipfile.lock

This file was deleted.

5 changes: 5 additions & 0 deletions tests/ats/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
markers =
smoke
functional
upgrade
16 changes: 16 additions & 0 deletions tests/ats/test_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from pytest import mark
from pytest_helm_charts.clusters import Cluster
from pytest_helm_charts.giantswarm_app_platform.app import wait_for_apps_to_run
from pytest_helm_charts.k8s.deployment import wait_for_deployments_to_run

@mark.smoke
@mark.functional
@mark.upgrade
def test_coredns(kube_cluster: Cluster) -> None:
assert kube_cluster.kube_client is not None

# Wait for coredns app to run.
wait_for_apps_to_run(kube_cluster.kube_client, [ "coredns-app" ], "kube-system", 60)

# Wait for coredns-controlplane & coredns-workers deployments to run.
wait_for_deployments_to_run(kube_cluster.kube_client, [ "coredns-controlplane", "coredns-workers" ], "kube-system", 60)
87 changes: 0 additions & 87 deletions tests/ats/test_coredns.py

This file was deleted.

2 changes: 0 additions & 2 deletions tests/kind_config.yaml → tests/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
- role: worker
4 changes: 0 additions & 4 deletions tests/ats/test-values.yaml → tests/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@

name: coredns-test
namespace: default

cluster:
kubernetes:
DNS:
Expand Down

0 comments on commit 0c64894

Please sign in to comment.