kubewarden / kubewarden-end-to-end-tests

Files used to run Kubewarden end-to-end tests
https://kubewarden.io
Apache License 2.0
2 stars 6 forks source link

Fetch charts under test prior to running tests #68

Open viccuad opened 1 year ago

viccuad commented 1 year ago

helm has helm fetch, that obtains a chart from a URL or repo, and saves it as tar.gz. For all operations like helm install, helm upgrade, helm accepts a local folder or a tar.gz as a chart.

I would like to separate the setup of the end-to-end tests and the run of tests, where:

I think this brings some nice behaviour:

Improvements

A somewhat similar approach could be used for configuring the charts. For example, a specific combination of chart versions may need to consume a container image :latest and set a specific config. It would be easier to drop a default-values-chart-under-test/values.yaml with:

auditScanner
  image
    tag: latest
  serviceAccountName: my-development-sa

This can help when using the end-to-end tests when developing, as one can just drop the values.yaml, and the helm-chart. The same approach can be used recursively inside of the tests, with each test being a folder, where there's resources to kubectl apply, values.yaml to upgrade to, etc.

viccuad commented 4 months ago

As talked on daily, piling up here several features wanted.

The majority of the tests are tightly coupled with the helm chart code, hence the test code could be part of the chart repo. The only tests not tightly coupled would be for chart dependencies (such as open-telemetry, grafana, etc), and we only need minimum integration tests for those. For vendored chart dependencies such as policy-reporter-ui are tightly coupled and we can include integration tests in the chart repo.

My list of desired features:

Example of a Helm chart with unit, integration tests: https://github.com/hashicorp/vault-helm, albeit DIY.