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

54 Commits

Author SHA1 Message Date
Dylan Arbour
d576e67e39 Fix helm-extra-set-args in YAML configuration (#713)
Currently, `helm-extra-set-args` is only available as a command-line
flag, despite being part of the config object. This does not appear to
be documented.

This changes sources the value `extraSetArgs` via the `config` object
rather than the cmd.Flags() only.

Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
2025-06-03 08:26:27 +02:00
Alison Hart
3f428cda4d Add release-name option (#735)
Signed-off-by: alisonlhart <alhart@redhat.com>
2025-06-02 10:41:47 +02:00
PaoloGallina
5bde7c54d4 feat(upgrade): using the values instead of --reuse-values (#742)
Signed-off-by: Paolo Gallina <paologallina1992@gmail.com>
2025-06-02 10:30:49 +02:00
dependabot[bot]
a3f2df35e1 Bump golangci/golangci-lint-action from 6.5.2 to 8.0.0 (#736)
* Bump golangci/golangci-lint-action from 6.5.2 to 8.0.0

Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.5.2 to 8.0.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](55c2c1448f...4afd733a84)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* migrate config

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

* fix lints

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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Carlos Panato <ctadeu@gmail.com>
2025-05-06 10:27:43 +02: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
15a8beb256 Upgrade go to 1.22 and housekeeping (#641)
* group dependabot updates

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

* upgrade to go1.22

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

* fix lints

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

* update alpine and helm

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

* go mod tidy

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

* update goreleaser deprecated flags and config

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

* update dockerfile

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

---------

Signed-off-by: cpanato <ctadeu@gmail.com>
2024-04-21 09:13:08 +02:00
Aleksey @soar Smyrnov
560d59deb1 Fix for --upgrade option (#624)
Signed-off-by: Aleksey @soar Smyrnov <i@soar.name>
2024-02-05 15:21:24 +01: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
Cyril Jouve
10aaf461bf use the same ref to check branch existance and merge-base calculation (#601)
fix #577

Signed-off-by: Cyril Jouve <jv.cyril@gmail.com>
2023-10-27 10:54:07 +02: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
Marco Lecheler
6f100eb93b feat: verify if targetBranch is present in git repo (#511)
* feat: verify if targetBranch is present in git repo

If a targetBranch is not present in the git repository the `ct list-changed` command will fail.
The error message for this is not really meaningful.

This commit will validate if the branch exists and throw a error message which the user will understand.

closes #330

Signed-off-by: Marco Lecheler <marco@task.media>

* chore(test): mocking test for chart.BranchExists()

Signed-off-by: Marco Lecheler <marco@task.media>

* fix(lint): use fmt.Errorf for error msg

Signed-off-by: Marco Lecheler <marco@task.media>

---------

Signed-off-by: Marco Lecheler <marco@task.media>
2023-04-14 00:30:46 +02:00
Carlos Tadeu Panato Junior
7f3a83ddc5 sync version comments, update actions and update cosign flag (#538)
* sync version comments, update actions and update cosign flag

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

* fix lints

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

---------

Signed-off-by: cpanato <ctadeu@gmail.com>
2023-03-24 12:24:35 +00: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
PaoloGallina
882d4be7b0 Fix integration tests for upgrade flag (#446)
* fix(test): deploment was not installing due to missing selector

Signed-off-by: paologallinaharbur <paologallina1992@gmail.com>

* feat(test): tesi if chart is upgraded and error is triggered

Signed-off-by: paologallinaharbur <paologallina1992@gmail.com>
2022-07-22 13:08:36 +02:00
PaoloGallina
8c88f671da feat(upgrade): it should upgrade to new version instead of the old one (#434)
Signed-off-by: paologallinaharbur <paologallina1992@gmail.com>
2022-06-01 09:34:30 +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
Massimiliano Donini
aabb51e7dd Introduce helm-extra-set-args command line parameter (#402)
* Introduce helm-extra-set-args
Signed-off-by: ilmax <massimiliano.donini@gmail.com>

Signed-off-by: Massimiliano Donini <massimiliano.donini@lobsterink.com>

* Fix and add integration test

- Fixed error when no values are passed in
- Added integration test

Signed-off-by: Massimiliano Donini <massimiliano.donini@lobsterink.com>

* Generate docs

Signed-off-by: Massimiliano Donini <massimiliano.donini@lobsterink.com>
2022-03-23 10:24:39 +01:00
Kotaro Shimizu
a66bd3363c Fix excluded chart when chart-dirs is multi-level (#312)
Signed-off-by: nekottyo <nekottyo@gmail.com>
2022-03-23 10:13:31 +01:00
Carlos Tadeu Panato Junior
859182198c Update golang to 1.17 and some goreleaser/docker file updates (#375)
* update projecto to go 1.17x

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

* add syft to generate the sboms and update goreleaser

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

* add dependabot config

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

* update dokcerfile to fetch the correct binaries for the arch and update base image

Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2022-01-12 18:23:22 +01:00
Reinhard Nägele
2407e7df46 Log invalid chart dirs to stderr (#290)
If directories are deleted from a chart, ct detects them as invalid
chart directories. A log message is printed to stdout which messes up
the regular output. In order to fix this, the message is now logged to
stderr.

*Example:*

```
$ ct list-changed
Directory 'charts/mychart/templates/deleted' is not a valid chart directory. Skipping...
charts/mychart
```

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2020-10-29 15:02:17 +01:00
Eric
ec7b0c779b Add option to exclude deprecated charts (#280) 2020-10-27 08:44:13 +01:00
MengZeLee
21e0f7a1d3 Fix typo (#284)
Signed-off-by: MengZn <adnt587@gmail.com>
2020-10-27 08:01:59 +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
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
f5f1e7786b Don't create provided namespace (#205)
Adding support for Helm 3 introduced creating namespaces
because Helm does not do this automatically anymore.
However, a regression was introduced that always creates
namespaces, even if a dedicated namespace is provided via
CLI flag.

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

* Fix statefulset test

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

* Fix deployment apiVersion

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

* Create custom namespace before test

Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
2020-02-27 18:45:38 +01:00
Reinhard Nägele
62e23acd9f Update docs for Helm 3 (#194)
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
2019-12-13 16:18:11 +01:00
jeff-knurek
b9d4ad0a41 List changed fixes (#190)
Signed-off-by: Jeff Knurek <j.knurek@travelaudience.com>
2019-12-08 20:05:25 +01:00
Reinhard Nägele
b8572749f0 Add support for Helm 3 (#184)
Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
2019-11-28 19:09:20 +01: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
Reinhard Nägele
f53c402ee2 Print events on cleanup (#155)
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2019-05-03 08:07:18 +02:00
Reinhard Nägele
e2e0c8cea3 Fix log messages (#152)
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2019-04-25 18:39:03 +02:00
Reinhard Nägele
bc772e2051 Trim leading hyphens from names (#143)
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2019-04-22 18:02:20 +02:00
Jacob LeGrone
b060fc83f2 Add git version documentation, rename worktree methods, and handle existing worktree (#133)
Signed-off-by: Jacob LeGrone <git@jacob.work>
2019-03-28 21:46:30 +01: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
52a4be9561 Add Helm/Kubernetes integration tests (#120)
* Add helm/kubectl integration test

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

* Use Chart type from integration tests

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

* Update .circleci/config.yml

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

* Remove extraneous test chart files

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

* Fix shellcheck lint

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

* Remove example kind config from e2e tests

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

* Remove breaking semver test

This wasn't super clear and was no longer working properly
after the switch to git-worktree.

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

* Bump kind version

Signed-off-by: Jacob LeGrone <git@jacob.work>
2019-03-25 13:47:22 -04:00
Jacob LeGrone
8ddee49c8b Handle empty chart path, add Chart type (#104)
Signed-off-by: Jacob LeGrone <git@jacob.work>
2019-03-21 10:09:48 +01: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
3e4f4f88fa Log values files used (#96)
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2019-01-24 11:14:17 -05:00
Reinhard Nägele
868038e2e8 Improve error logging (#91)
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2019-01-23 19:15:12 +01:00
Reinhard Nägele
374227938c Require charts to be in direct subdirectories of configured charts dirs (#90)
Fixes a regression introduced in #73 so that chart directories were no longer required to be in a direct subdirectory of configured chart directories.

This caused problems in https://github.com/helm/charts/pull/10830.

cc @munnerz
2019-01-23 15:26:46 +01:00
Reinhard Nägele
b679b85de0 Fix regression in changed chart detection (#85)
* Fix regression in changed chart detection

 Please enter the commit message for your changes. Lines starting

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

* Refactor to consider charts at root

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

* Make sure charts are processed only once

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

* Fix typo

Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2019-01-20 17:15:48 -05:00
Reinhard Nägele
fa29453c5b Use anonymous function to avoid defer in loop (#86)
Signed-off-by: Reinhard Nägele <unguiculus@gmail.com>
2019-01-19 11:39:37 +01: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
Adam Kunicki
7b167f8fe0 Fix index out of range when files exist in the root of a chart dir (#73)
Signed-off-by: Adam Kunicki <adam@streamsets.com>
2019-01-04 15:09: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
3ce597ad11 feat(lint): validate values files in ci directory (#66)
Signed-off-by: Jacob LeGrone <git@jacob.work>
2018-12-18 17:17:55 +01:00