Skip to content

Commit

Permalink
add basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinBisson committed Sep 19, 2024
1 parent a086a9e commit 5210c1b
Show file tree
Hide file tree
Showing 8 changed files with 522 additions and 33 deletions.
36 changes: 36 additions & 0 deletions .ats/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
app-tests-app-config-file: tests/test-values.yaml
app-tests-deploy-namespace: monitoring

smoke-tests-cluster-type: kind

upgrade-tests-cluster-type: kind
upgrade-tests-app-catalog-url: https://giantswarm.github.io/control-plane-catalog
upgrade-tests-app-config-file: tests/test-values.yaml

skip-steps: [functional]

# --------
# Uncomment values below this line to be able to execute app-test-suite against an externally created
# Kubernetes cluster.
# Comment out everything above

# If you want to create a kind cluster, use the line below
# kind create cluster --config tests/kind-config.yaml --kubeconfig kube.config
# --------

# app-tests-app-config-file: tests/test-values.yaml
# app-tests-deploy-namespace: loki

# upgrade-tests-app-catalog-url: https://giantswarm.github.io/giantswarm-catalog
# upgrade-tests-app-config-file: tests/test-values.yaml

# skip-steps: [functional, upgrade]

# smoke-tests-cluster-type: external
# functional-tests-cluster-type: external
# upgrade-tests-cluster-type: external
# external-cluster-kubeconfig-path: kube.config
# external-cluster-type: kind
# external-cluster-version: 1.24.0

# app-tests-skip-app-delete: "Yes"
66 changes: 33 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,58 @@ version: 2.1
orbs:
architect: giantswarm/[email protected]

jobs:
template-chart:
docker:
- image: giantswarm/helm-chart-testing:v3.11.0
steps:
- checkout
- run: |-
cd helm/alloy
helm dep up
helm template .
workflows:
build:
jobs:
- template-chart:
name: "template-chart-test"
filters:
branches:
ignore:
- main

# Ensure that for every commit to master and for every
# release tag, there is an app version in the catalog.
- architect/push-to-app-catalog:
context: architect
name: push-sloth-app-to-control-plane-catalog-master
name: package-and-push-chart
app_catalog: "control-plane-catalog"
app_catalog_test: "control-plane-test-catalog"
chart: "sloth"
persist_chart_archive: true
filters:
tags:
only: /^v.*/
- architect/push-to-app-collection:
name: aws-app-collection
context: "architect"
app_catalog: control-plane-catalog
app_name: "sloth"
app_namespace: monitoring
app_collection_repo: "aws-app-collection"

- architect/run-tests-with-ats:
name: run-tests-with-ats
requires:
- push-sloth-app-to-control-plane-catalog-master
- "package-and-push-chart"
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
ignore:
- main

- architect/push-to-app-collection:
name: azure-app-collection
name: aws-app-collection
context: "architect"
app_catalog: control-plane-catalog
app_name: "sloth"
app_namespace: monitoring
app_collection_repo: "azure-app-collection"
app_collection_repo: "aws-app-collection"
requires:
- push-sloth-app-to-control-plane-catalog-master
- run-tests-with-ats
filters:
branches:
ignore: /.*/
Expand All @@ -55,7 +69,7 @@ workflows:
app_namespace: monitoring
app_collection_repo: "vsphere-app-collection"
requires:
- push-sloth-app-to-control-plane-catalog-master
- run-tests-with-ats
filters:
branches:
ignore: /.*/
Expand All @@ -70,7 +84,7 @@ workflows:
app_namespace: monitoring
app_collection_repo: "cloud-director-app-collection"
requires:
- push-sloth-app-to-control-plane-catalog-master
- run-tests-with-ats
filters:
branches:
ignore: /.*/
Expand All @@ -85,7 +99,7 @@ workflows:
app_namespace: monitoring
app_collection_repo: "capa-app-collection"
requires:
- push-sloth-app-to-control-plane-catalog-master
- run-tests-with-ats
filters:
branches:
ignore: /.*/
Expand All @@ -100,24 +114,10 @@ workflows:
app_namespace: monitoring
app_collection_repo: "capz-app-collection"
requires:
- push-sloth-app-to-control-plane-catalog-master
- run-tests-with-ats
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/

- architect/push-to-app-collection:
context: architect
name: push-to-gcp-app-collection
app_catalog: control-plane-catalog
app_name: "sloth"
app_namespace: monitoring
app_collection_repo: "gcp-app-collection"
requires:
- push-sloth-app-to-control-plane-catalog-master
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/()
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s

## [Unreleased]

### Added

- Add helm chart templating test in ci pipeline.
- Add tests with ats in ci pipeline.

## [1.4.5] - 2024-06-12

### Changed
Expand Down
10 changes: 10 additions & 0 deletions tests/ats/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
pytest-helm-charts = ">=1.0.2"
pytest = ">=6.2.5"
pykube-ng = ">=22.1.0"
[requires]
python_version = "3.9"
Loading

0 comments on commit 5210c1b

Please sign in to comment.