1
0
mirror of https://github.com/helm/chart-testing.git synced 2026-02-05 18:45:18 +01:00
Commit Graph

9 Commits

Author SHA1 Message Date
Dan Carley
4960e30445 Return correct exit code when using values files (#32)
* Return correct exit code when using values files

The return values from the individual calls to `lint_chart_with_single_config`
are masked by the other operations in the `lint_chart_with_all_configs`
function.

When `helm lint` reports an error to STDERR but the chart is incorrectly
given a success tick and the exit code of `chart_test.sh` is 0 for
success. An example using `quay.io/helmpack/chart-testing:v1.1.0`:

    ==> Linting charts/nomad-server
    [ERROR] templates/: render error in "nomad-server/templates/nomad-server.yaml": template: nomad-server/templates/nomad-server.yaml:55:28: executing "nomad-server/templates/nomad-server.yaml" at <{{template "fullname...>: template "fullname" not defined

    Error: 1 chart(s) linted, 1 chart(s) failed
    --------------------------------------------------------------------------------
     ✔︎ charts/nomad-server
    --------------------------------------------------------------------------------
     dcarley@cci-mbp  ~/p/g/s/g/c/circle-external-services-chart   master  echo $?
    0s

Fix this by copying the pattern used in other functions of tracking
failures in a local boolean variable and using that to determine the
return code at the end of the function. This is the result after:

    ==> Linting charts/nomad-server
    [ERROR] templates/: render error in "nomad-server/templates/nomad-server.yaml": template: nomad-server/templates/nomad-server.yaml:55:28: executing "nomad-server/templates/nomad-server.yaml" at <{{template "fullname...>: template "fullname" not defined

    Error: 1 chart(s) linted, 1 chart(s) failed
    --------------------------------------------------------------------------------
     ✖︎  charts/nomad-server
    --------------------------------------------------------------------------------
     ✘ dcarley@cci-mbp  ~/p/g/s/g/c/circle-external-services-chart   master  echo $?
    1

There are probably other bugs like this. Shell scripting does not
provide safe error handling for these cases and it's difficult to write
unit tests for. This is another good reason why the proposal in #29 to
re-implement in another language is a good idea.

Signed-off-by: Dan Carley <dan.carley@gmail.com>

* Make error handling for functions consistent

The `|| error=true` pattern is already used in a few other places. This
makes the change from 64c1e52 consistent with the others.

Signed-off-by: Dan Carley <dan.carley@gmail.com>
2018-10-01 18:05:46 +02:00
Ducas Francis
6c1b24b399 Use characters before first equals sign for repo name (#31)
Signed-off-by: Ducas Francis <ducas@ducasfrancis.com>
2018-09-26 20:38:22 +02:00
Rimas Mocevicius
48e81aaa43 Add an option to force install of all/single charts (#24)
* Add an option to force install of all/single chart

Signed-off-by: rimas <rmocius@gmail.com>

* replace flag `--force` with `--chart-all`
add an option to list charts for `--chart` flag

Signed-off-by: rimas <rmocius@gmail.com>

* address mattfarina and unguiculus comments

Signed-off-by: rimas <rmocius@gmail.com>

* fixing merge conflicts

Signed-off-by: rimas <rmocius@gmail.com>

* fixing merge conflicts 2

Signed-off-by: rimas <rmocius@gmail.com>

* fixing merge conflicts 3

Signed-off-by: rimas <rmocius@gmail.com>

* exporting CHECK_VERSION_INCREMENT before chart_lib.sh is sourced

Signed-off-by: rimas <rmocius@gmail.com>

* fix --chart -> --charts

Signed-off-by: rimas <rmocius@gmail.com>

* print skip version check before env vars

Signed-off-by: rimas <rmocius@gmail.com>

* Fix readme

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2018-09-21 09:58:02 -04:00
Matt Farina
f5d8145fdf Adding ability to skip version increment check (#23)
The use case for this is an environment where every change is not
a new release of a chart. When new releases are created the
increment can be checked while development outside a release
does not need to check for it

Signed-off-by: Matt Farina <matt@mattfarina.com>
2018-09-13 22:02:20 +02:00
Reinhard Nägele
3b5e7fa1c1 Fix exit code when test with multiple custom CI values files fails (#18)
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2018-09-11 15:56:47 +02:00
Erikas Mazrimas
31ee629a8f Use environment variable for Github address (#11)
Add short description about GITHUB_INSTANCE env var

Echo GITHUB_INSTANCE with other environment variables
2018-08-29 11:51:10 -04:00
Rimas Mocevicius
64c0eef72c [fix]: Limits release name to 29 characters. (#14)
* Limits release name to 29 characters.
Fixes an issue https://github.com/helm/charts/pull/7320#issuecomment-416213125

Signed-off-by: rimas <rmocius@gmail.com>

* fix linting errors

Signed-off-by: rimas <rmocius@gmail.com>

* fix linting errors

Signed-off-by: rimas <rmocius@gmail.com>

* cut random_suffix to 10 long

Signed-off-by: rimas <rmocius@gmail.com>

* cut release name to 10 long

Signed-off-by: rimas <rmocius@gmail.com>
2018-08-29 11:30:43 -04:00
Reinhard Nägele
c52f1dd7d5 Double-check pod readiness for deployments (#10) 2018-08-15 21:48:02 +02:00
Reinhard Nägele
96d2ce7c0e Factor out testing code from charts (#1)
* [WIP] Factor out testing code from charts

* Minor various fixes

 Please enter the commit message for your changes. Lines starting

* Start readme

* Update readme and add GKE example

* Add CircleCI job for ShellCheck

* Install Helm and kubectl after other tools

Also: Hard-code version for kubectl.

* Fix readme

* Update maintainer validation

'chartlib::validate_maintainers' should not log an error if there's no maintainers
section. This is already covered by the schema validation.

* Add random suffix to namespaces

* Improve container logs output

* Improve logging

* Add --cleanup flag to 'helm test'

* Improve namespace cleanup

* Improve logging

* Add random suffixes to releases

* Update logging and Docker image version

* Update GKE example

* Fix Bash array declarations

* Remove user from Docker image

* Add summary

* Use kubectl rollout status for deployments

* Add some more fixes

* Build dependencies before linting

* Fix array initialization

* Increase sleep time for namespace polling

* Add missing colon

* Create v1.0.0

* Update Helm to v2.9.1

* Add missing local keywords

* Bump image version

* Update copyright headers
2018-06-06 09:42:53 -04:00