description:"module in name allowlist and type allowlist fails",
shouldConvert:false,
expectedErrors:[]string{"A module cannot be in moduleAlwaysConvert and also be in moduleTypeAlwaysConvert"},
module:TestBazelModule{
TestModuleInfo:bazel.TestModuleInfo{
ModuleName:"foo",
Typ:"rule1",
Dir:"dir1",
},
BazelModuleBase:bazelableBazelModuleBase,
},
allowlist:bp2BuildConversionAllowlist{
moduleAlwaysConvert:map[string]bool{
"foo":true,
},
moduleTypeAlwaysConvert:map[string]bool{
"rule1":true,
},
},
},
{
description:"module in allowlist and denylist fails",
shouldConvert:false,
expectedErrors:[]string{"a module cannot be in moduleDoNotConvert and also be in moduleAlwaysConvert"},
module:TestBazelModule{
TestModuleInfo:bazel.TestModuleInfo{
ModuleName:"foo",
Typ:"rule1",
Dir:"dir1",
},
BazelModuleBase:bazelableBazelModuleBase,
},
allowlist:bp2BuildConversionAllowlist{
moduleAlwaysConvert:map[string]bool{
"foo":true,
},
moduleDoNotConvert:map[string]bool{
"foo":true,
},
},
},
{
description:"module in allowlist and existing BUILD file",
shouldConvert:false,
expectedErrors:[]string{"A module cannot be in a directory listed in keepExistingBuildFile and also be in moduleAlwaysConvert. Directory: 'existing/build/dir'"},
module:TestBazelModule{
TestModuleInfo:bazel.TestModuleInfo{
ModuleName:"foo",
Typ:"rule1",
Dir:"existing/build/dir",
},
BazelModuleBase:bazelableBazelModuleBase,
},
allowlist:bp2BuildConversionAllowlist{
moduleAlwaysConvert:map[string]bool{
"foo":true,
},
keepExistingBuildFile:map[string]bool{
"existing/build/dir":true,
},
},
},
{
description:"module allowlist and enabled directory",
shouldConvert:false,
expectedErrors:[]string{"A module cannot be in a directory marked Bp2BuildDefaultTrue or Bp2BuildDefaultTrueRecursively and also be in moduleAlwaysConvert. Directory: 'existing/build/dir'"},
description:"module allowlist and enabled subdirectory",
shouldConvert:false,
expectedErrors:[]string{"A module cannot be in a directory marked Bp2BuildDefaultTrue or Bp2BuildDefaultTrueRecursively and also be in moduleAlwaysConvert. Directory: 'existing/build/dir'"},