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

32 Commits

Author SHA1 Message Date
Alison Hart
3f428cda4d Add release-name option (#735)
Signed-off-by: alisonlhart <alhart@redhat.com>
2025-06-02 10:41:47 +02:00
Léo Colombaro
b9f7ae90ab Add missing helm-extra-set-args configuration flag (#697)
This should allow defining `helm-extra-set-args`  within the config file or as an environment variable.

Signed-off-by: Léo Colombaro <LeoColomb@users.noreply.github.com>
2024-12-02 18:11:01 +01:00
Carlos Tadeu Panato Junior
3e61ea4c85 Feature: add extra flags to skip helm dependencies download and upgrade Go to 1.23 (#690)
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-11-08 12:01:45 +01:00
Cyril Jouve
c94fcac041 use .helmignore when identifying changed charts (#591)
* use .helmignore when identifying changed charts

Signed-off-by: Cyril Jouve <jv.cyril@gmail.com>

* use .helmignore when identifying changed charts

Signed-off-by: Cyril Jouve <jv.cyril@gmail.com>

---------

Signed-off-by: Cyril Jouve <jv.cyril@gmail.com>
2024-05-22 10:17:39 +02:00
Carlos Tadeu Panato Junior
a67573475c add helm lint extra args (#605)
Signed-off-by: cpanato <ctadeu@gmail.com>
2023-11-02 17:46:00 +01:00
Joe Julian
373aa72287 add github grouping of log lines (#556)
see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines

Signed-off-by: Joe Julian <me@joejulian.name>
2023-05-27 14:46:24 +02:00
Quan TRAN
34698417dd add .ct in current working-directory as config directory (#479)
* add .ct in working as config directory

Signed-off-by: Quan TRAN <itscaro@users.noreply.github.com>

* Update README.md

Signed-off-by: Quan TRAN <itscaro@users.noreply.github.com>

Signed-off-by: Quan TRAN <itscaro@users.noreply.github.com>
2022-10-11 08:27:38 -05:00
Carlos Tadeu Panato Junior
f661af1260 add skip-clean-up option to not remove the charts when finishing the tests (#478)
Signed-off-by: cpanato <ctadeu@gmail.com>

Signed-off-by: cpanato <ctadeu@gmail.com>
2022-09-28 14:46:08 +02:00
Nick Hudson
5865864cf3 Add configuration option to disable container logging (#472)
Signed-off-by: Nick Hudson <nick.hudson@gmail.com>

Signed-off-by: Nick Hudson <nick.hudson@gmail.com>
2022-09-26 14:02:51 +02:00
Carlos Tadeu Panato Junior
68f3fffe62 Upgrade go1.19, helm update and add golangci-lint job (#460)
* upgrade to go1.19

Signed-off-by: cpanato <ctadeu@gmail.com>

* add golangci-lint

Signed-off-by: cpanato <ctadeu@gmail.com>

* fix lints and Replace github.com/pkg/errors dependency with native error wrapping

Signed-off-by: cpanato <ctadeu@gmail.com>

* update install kind cluster

Signed-off-by: cpanato <ctadeu@gmail.com>

* update tests

Signed-off-by: cpanato <ctadeu@gmail.com>

* use errors.new

Signed-off-by: cpanato <ctadeu@gmail.com>

Signed-off-by: cpanato <ctadeu@gmail.com>
2022-09-16 15:59:15 +02:00
Scott Leggett
048064130d Set a request timeout on kubectl commands (#360)
* feat: add kubectl timeout value to configuration

Signed-off-by: Scott Leggett <scott@sl.id.au>

* fix: set a request timeout on kubectl commands

Simple kubectl commands such as get, describe, and logs should return
quickly, but kubectl does not set a timeout on requests by default.

This can mean kubectl hangs forever if the kubernetes API stops
responding during a request, which is quite possible in CI environments
where jobs may cancelled and kubernetes clusters torn down while ct is
running.

This change sets a configurable timeout on such kubectl commands, with a
default value of 30s.

Signed-off-by: Scott Leggett <scott@sl.id.au>

* chore: update integration test for new kubectl API

Signed-off-by: Scott Leggett <scott@sl.id.au>
2022-07-26 17:16:31 +02:00
Krzysztof Nazarewski
3c014d8d38 introduce helm-dependency-extra-args (#396)
addresses https://github.com/helm/chart-testing/issues/368

Signed-off-by: Krzysztof Nazarewski <3494992+nazarewk@users.noreply.github.com>
2022-04-05 11:50:08 +02:00
Carlos Tadeu Panato Junior
1bccc2467e Update reference from master to main in tests (#329)
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2021-04-21 21:28:47 +02:00
Reinhard Nägele
2a4dfd420d Introduce environment variable for custom config dir (#291) 2020-11-03 08:11:25 +01:00
Reinhard Nägele
fd6720ba30 Consistently use filepath package (#292)
Usage of filepath vs. path seems to have been pretty random.
With this change, we consistently use filepath which considers
the platform-specific path separator.

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2020-11-02 16:42:55 +01:00
Eric
ec7b0c779b Add option to exclude deprecated charts (#280) 2020-10-27 08:44:13 +01:00
Torsten Walter
e4d7b78183 Support execution of additional commands during ct lint (#283)
* support execution of additional commands for lint

Given that helm unittest is installed locally or mounted into the chart
testing container one could use this to run helm unittest for each
chart.

```
additional-commands:
 - helm unittest --helm3 -f tests/*.yaml {{ .Path }}
```

The command is treated as a go template. Like this it's possible to get
the path to the chart as in the example. It would also be open for
further extension if needed.

Signed-off-by: Torsten Walter <mail@torstenwalter.de>

* Use sh to execute command

Signed-off-by: Torsten Walter <mail@torstenwalter.de>

Co-authored-by: Reinhard Nägele <unguiculus@gmail.com>

* rename function to NewCmdTemplateExecutor

Signed-off-by: Torsten Walter <mail@torstenwalter.de>

* add error handling

Signed-off-by: Torsten Walter <mail@torstenwalter.de>

* add documentation

Signed-off-by: Torsten Walter <mail@torstenwalter.de>

* use go-shellwords to split rendered command

Signed-off-by: Torsten Walter <mail@torstenwalter.de>

* Update pkg/tool/cmdexecutor.go

Signed-off-by: Torsten Walter <mail@torstenwalter.de>

Co-authored-by: Reinhard Nägele <unguiculus@gmail.com>

* add unit tests

Signed-off-by: Torsten Walter <mail@torstenwalter.de>

Co-authored-by: Reinhard Nägele <unguiculus@gmail.com>
2020-10-20 17:10:56 -04:00
Reinhard Nägele
43b9ced061 Print config to stderr (#277)
Fixes a regression when the config file used is printed
to stdout even when the list-changed command is run. It is
now only printed when --print-config=true. Also, config printing
is now done to stderr so the flag can also be used in combination
with the list-changed command.

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2020-09-25 22:22:43 +02:00
Reinhard Nägele
b3899d2ce9 Add flag for disabling config printing (#269)
By default, ct prints the config on startup. This can be problematic
because it may contain senstivie data when helm-repo-extra-args contains
passwords. The new flag enables turning off config printing and disables
it by default.

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2020-09-09 21:26:06 +02:00
Reinhard Nägele
50db473a1e Add Homebrew installer (#244)
The Homebrew formula installs the config files to Homebrew's
etc directory, so we add that to the search locations for config files.

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2020-07-24 22:32:42 +02:00
Marc Sensenich
93b10e8e55 Add since flag for changing the reference branch for git merge-base (#229) 2020-07-24 22:12:55 +02:00
Reinhard Nägele
5b7b21e064 Migrate to Go modules (#183)
* Migrate to Go modules

Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>

* Add 'go mod download'

Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>

* Update machine image

Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>

* Install Go

Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>

* Fix Go installation

Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>

* Fix Go installation

Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>

* Override Go link

Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>

* Do checkout first

Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>

* Fix link

Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>

* Copy go 1.13 binary in place of circle image default binary

Signed-off-by: Scott Rigby <scott@r6by.com>

* Use latest helm v3 version, and remove install_tiller function

Signed-off-by: Scott Rigby <scott@r6by.com>

* Revert "Use latest helm v3 version, and remove install_tiller function"

This reverts commit 63dedab3a2.

Signed-off-by: Scott Rigby <scott@r6by.com>

* Copy full go 1.13 dir into the circle machine default location after deleting initial install

Signed-off-by: Scott Rigby <scott@r6by.com>
2019-11-02 15:44:02 -04:00
Jacob LeGrone
acfb89768e Add option to skip upgrade testing of deleted/renamed values files (#132)
* feat(upgrade): allow skipping missing values files

This allows fixing previous chart versions in a single pull request
without applying a major version bump to the chart version.

Signed-off-by: Jacob LeGrone <git@jacob.work>

* test(skip-missing-values): validate config and HasCIValuesFile method

Signed-off-by: Jacob LeGrone <git@jacob.work>

* docs(skip-missing-values): generate documentation

Signed-off-by: Jacob LeGrone <git@jacob.work>

* fix(chart): switch to filepath from path

Signed-off-by: Jacob LeGrone <git@jacob.work>
2019-03-25 13:53:21 -04:00
Jacob LeGrone
de59b1cdfb Test chart upgrades (#103)
* Test chart upgrades against previous version

Upgrade testing will be run if the --upgrade flag is set (default true)
and chart version increment does not indicate a breaking change
according to the SemVer 2.0 spec.

Any releases associated with previous chart versions which fail to roll
out or for which an initial `helm test` fails will be ignored.

Signed-off-by: Jacob LeGrone <git@jacob.work>

* fix(dep): add version constraint for github.com/otiai10/copy

Signed-off-by: Jacob LeGrone <git@jacob.work>

* refactor(git): checkout whole repository with worktree

Signed-off-by: Jacob LeGrone <git@jacob.work>

* Rename test* to do*

Signed-off-by: Jacob LeGrone <git@jacob.work>

* Return bool, error from BreakingChangeAllowed

Signed-off-by: Jacob LeGrone <git@jacob.work>

* Use errors.Wrapf

Co-Authored-By: jlegrone <jlegrone@users.noreply.github.com>
Signed-off-by: Jacob LeGrone <git@jacob.work>

* Explicitly disable upgrade when not install

Signed-off-by: Jacob LeGrone <git@jacob.work>
2019-03-18 11:11:57 -04:00
Reinhard Nägele
d69c43e71b Add list-changed command (#98)
Allows to identify chart changes before actually running
lint or install commands. This can be useful in the following
cases:

* In a CI setup where kind clusters are spun up on the fly,
  this makes it possible to decide whether a cluster is necessary
  at all. A PR may only contain changes that are not relevant
  to any charts.
* By knowing upfront which charts have changed, it is
  possible to load a per-chart CI configuration which would
  allows us to determine the number of nodes needed in a kind
  cluster. For most charts, one node is enough, but in certain
  scenarios, especially for StatefulSets, we may want to test
  with pod anti-affinity where replicas have to be spread across
  multiple nodes.

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2019-01-31 17:17:25 +01:00
Reinhard Nägele
9e980f87cc Use visitor to bind flags to Viper (#92)
Simplifies the logic and no longer requires that flags be
listed individually in order to get bound.

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2019-01-24 09:26:43 -05:00
Reinhard Nägele
ee1bd9e090 Only require validation configs when validation is enabled (#87)
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2019-01-22 08:05:42 -05:00
Markus Maga
9084cf16d0 Add support for providing credentials when adding chart-repositories (#67)
Signed-off-by: Markus Maga <markus@nadilus.com>
2019-01-07 21:13:30 +01:00
Carlos Tadeu Panato Junior
46dc82e972 Add new flags to disable lint/schema validation (#68)
Signed-off-by: cpanato <ctadeu@gmail.com>
2018-12-21 07:44:55 +01:00
Jacob LeGrone
228603701a Support installation to existing namespace (#59)
This PR adds two flags to the `install` command: `namespace` and `release-label`. If `namespace` is specified, releases will target that namespace and `release-label` will be used to select deployments and pods for readiness and reading log output.

Fixes #34
2018-12-14 15:30:36 +01:00
Reinhard Nägele
73f35d7fcb Explicitly disable version checks when all or specific charts are tested (#56)
It is already documented that the check is disabled in this case.

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2018-11-16 13:25:34 +01:00
Reinhard Nägele
f632cd5081 Re-write it in Go (#35)
* Re-write it in Go

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Fix loading config from home dir

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Print config

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Remove git gc test code

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Remove year in copyright header

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add alias for lint-and-install

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Fix examples

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Remove OWNERS file

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add docs generation

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update CircleCI

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update readme

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Document building and releasing

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Remove Makefile

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Hide doc-gen command

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add support for Helm extra args

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update tool dependencies

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update Goreleaser

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Upgrade pip

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update Gopkg.lock

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add log messages

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Fix CircleCI env var for tag

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add Docker login

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Readme update for MacOS (#1)

* Add build.sh mac prerequisites, and README markdown linting fixes

Signed-off-by: Scott Rigby <scott@r6by.com>

* Update README.md

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update Gopkg.lock

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Update config search locations

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add config files to distro

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add debug flag

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Add note on config files for linting

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Fix link

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Revert "Update Gopkg.lock"

This reverts commit fcbfbdc9db.

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Fix link

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>

* Fix readme

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2018-11-07 13:06:20 -05:00