mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-28 22:28:25 +00:00
feat: auto-plan projects when modules change (#2507)
* feat: auto-plan projects when modules change Fixes #920 * rename Downstream->Dependent; docs cleanup * chore: gofmt -s
This commit is contained in:
@@ -22,13 +22,14 @@ import (
|
||||
"testing"
|
||||
|
||||
homedir "github.com/mitchellh/go-homedir"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
"github.com/runatlantis/atlantis/server"
|
||||
"github.com/runatlantis/atlantis/server/events/vcs/fixtures"
|
||||
"github.com/runatlantis/atlantis/server/logging"
|
||||
. "github.com/runatlantis/atlantis/testing"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
// passedConfig is set to whatever config ended up being passed to NewServer.
|
||||
@@ -764,6 +765,23 @@ func TestExecute_RepoWhitelistDeprecation(t *testing.T) {
|
||||
Equals(t, "*", passedConfig.RepoAllowlist)
|
||||
}
|
||||
|
||||
func TestExecute_AutoDetectModulesFromProjects_Env(t *testing.T) {
|
||||
t.Setenv("ATLANTIS_AUTOPLAN_MODULES_FROM_PROJECTS", "**/init.tf")
|
||||
c := setupWithDefaults(map[string]interface{}{}, t)
|
||||
err := c.Execute()
|
||||
Ok(t, err)
|
||||
Equals(t, "**/init.tf", passedConfig.AutoplanModulesFromProjects)
|
||||
}
|
||||
|
||||
func TestExecute_AutoDetectModulesFromProjects(t *testing.T) {
|
||||
c := setupWithDefaults(map[string]interface{}{
|
||||
AutoplanModulesFromProjects: "**/*.tf",
|
||||
}, t)
|
||||
err := c.Execute()
|
||||
Ok(t, err)
|
||||
Equals(t, "**/*.tf", passedConfig.AutoplanModulesFromProjects)
|
||||
}
|
||||
|
||||
func TestExecute_AutoplanFileList(t *testing.T) {
|
||||
cases := []struct {
|
||||
description string
|
||||
|
||||
Reference in New Issue
Block a user