8
8
9
9
"github.com/google/go-cmp/cmp"
10
10
"github.com/hashicorp/go-version"
11
+ tfmod "github.com/hashicorp/terraform-schema/module"
11
12
)
12
13
13
14
func TestParseModuleManifestFromFile (t * testing.T ) {
@@ -22,26 +23,29 @@ func TestParseModuleManifestFromFile(t *testing.T) {
22
23
rootDir : modPath ,
23
24
Records : []ModuleRecord {
24
25
{
25
- Key : "web_server_sg1" ,
26
- SourceAddr : "terraform-aws-modules/security-group/aws//modules/http-80" ,
27
- VersionStr : "3.10.0" ,
28
- Version : version .Must (version .NewVersion ("3.10.0" )),
29
- Dir : filepath .Join (".terraform" , "modules" , "web_server_sg" , "terraform-aws-security-group-3.10.0" , "modules" , "http-80" ),
26
+ Key : "web_server_sg1" ,
27
+ SourceAddr : tfmod .ParseModuleSourceAddr ("terraform-aws-modules/security-group/aws//modules/http-80" ),
28
+ RawSourceAddr : "terraform-aws-modules/security-group/aws//modules/http-80" ,
29
+ VersionStr : "3.10.0" ,
30
+ Version : version .Must (version .NewVersion ("3.10.0" )),
31
+ Dir : filepath .Join (".terraform" , "modules" , "web_server_sg" , "terraform-aws-security-group-3.10.0" , "modules" , "http-80" ),
30
32
},
31
33
{
32
- Key : "web_server_sg2" ,
33
- SourceAddr : "terraform-aws-modules/security-group/aws//modules/http-80" ,
34
- VersionStr : "3.10.0" ,
35
- Version : version .Must (version .NewVersion ("3.10.0" )),
36
- Dir : filepath .Join (".terraform" , "modules" , "web_server_sg" , "terraform-aws-security-group-3.10.0" , "modules" , "http-80" ),
34
+ Key : "web_server_sg2" ,
35
+ SourceAddr : tfmod .ParseModuleSourceAddr ("terraform-aws-modules/security-group/aws//modules/http-80" ),
36
+ RawSourceAddr : "terraform-aws-modules/security-group/aws//modules/http-80" ,
37
+ VersionStr : "3.10.0" ,
38
+ Version : version .Must (version .NewVersion ("3.10.0" )),
39
+ Dir : filepath .Join (".terraform" , "modules" , "web_server_sg" , "terraform-aws-security-group-3.10.0" , "modules" , "http-80" ),
37
40
},
38
41
{
39
42
Dir : "." ,
40
43
},
41
44
{
42
- Key : "local" ,
43
- SourceAddr : "./nested/path" ,
44
- Dir : filepath .Join ("nested" , "path" ),
45
+ Key : "local" ,
46
+ SourceAddr : tfmod .ParseModuleSourceAddr ("./nested/path" ),
47
+ RawSourceAddr : "./nested/path" ,
48
+ Dir : filepath .Join ("nested" , "path" ),
45
49
},
46
50
},
47
51
}
0 commit comments