Enable `helmfile test` testing only enabled and selected releases (#1486)
Resolves #1483
This commit is contained in:
parent
ff81b2f279
commit
b176408eb2
|
|
@ -390,7 +390,7 @@ func (a *App) Test(c TestConfigProvider) error {
|
||||||
err := run.withPreparedCharts("test", state.ChartPrepareOptions{
|
err := run.withPreparedCharts("test", state.ChartPrepareOptions{
|
||||||
SkipRepos: true,
|
SkipRepos: true,
|
||||||
}, func() {
|
}, func() {
|
||||||
errs = run.Test(c)
|
errs = a.test(run, c)
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -161,14 +161,29 @@ func (a *App) diff(r *Run, c DiffConfigProvider) (*string, bool, bool, []error)
|
||||||
return infoMsg, true, len(deleted) > 0 || len(updated) > 0, errs
|
return infoMsg, true, len(deleted) > 0 || len(updated) > 0, errs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Run) Test(c TestConfigProvider) []error {
|
func (a *App) test(r *Run, c TestConfigProvider) []error {
|
||||||
cleanup := c.Cleanup()
|
cleanup := c.Cleanup()
|
||||||
timeout := c.Timeout()
|
timeout := c.Timeout()
|
||||||
concurrency := c.Concurrency()
|
concurrency := c.Concurrency()
|
||||||
|
|
||||||
|
st := r.state
|
||||||
|
|
||||||
|
toTest, err := a.getSelectedReleases(r)
|
||||||
|
if err != nil {
|
||||||
|
return []error{err}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(toTest) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do test only on selected releases, because that's what the user intended
|
||||||
|
// with conditions and selectors
|
||||||
|
st.Releases = toTest
|
||||||
|
|
||||||
r.helm.SetExtraArgs(argparser.GetArgs(c.Args(), r.state)...)
|
r.helm.SetExtraArgs(argparser.GetArgs(c.Args(), r.state)...)
|
||||||
|
|
||||||
return r.state.TestReleases(r.helm, cleanup, timeout, concurrency)
|
return st.TestReleases(r.helm, cleanup, timeout, concurrency)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Run) Lint(c LintConfigProvider) []error {
|
func (r *Run) Lint(c LintConfigProvider) []error {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue