Skip to content

Commit df86b16

Browse files
authored
test: document git submodule requirements (#1974)
1 parent aec1c73 commit df86b16

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
default: build
22

33
prepare:
4+
git submodule init
5+
git submodule update
46
go run ./plugin/stub-generator
57

68
test: prepare

docs/developer-guide/building.md

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ If you change code, make sure that the tests you add and existing tests will be
1818
$ make test
1919
```
2020

21+
Some tests depending on Git submodules. Running `make test` will update these automatically, but if you run tests directly with `go test`, you need to update submodules manually:
22+
23+
```sh
24+
git submodule init
25+
git submodule update
26+
```
27+
2128
## Run E2E tests
2229

2330
You can check the actual CLI behavior by running the E2E tests. Since the E2E tests uses the installed `tflint` command, it is necessary to add the path into `$PATH` environment so that the binary built by `go install` can be referenced.

terraform/loader_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ func testChildModule(t *testing.T, config *Config, key string, wantPath string)
609609
t.Helper()
610610

611611
if _, exists := config.Children[key]; !exists {
612-
t.Fatalf("`%s` module is not loaded: %#v", key, config.Children)
612+
t.Fatalf("`%s` module is not loaded, are submodules downloaded?: %#v", key, config.Children)
613613
}
614614
modulePath := config.Children[key].Module.SourceDir
615615
if modulePath != wantPath {

0 commit comments

Comments
 (0)