Skip to content

Commit

Permalink
spec(terragrunt-manager): Remove unnecessary specs
Browse files Browse the repository at this point in the history
  • Loading branch information
mblum14 committed Jan 24, 2025
1 parent 4d8061e commit 64f641e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 27 deletions.
5 changes: 0 additions & 5 deletions lib/modules/manager/terragrunt/__fixtures__/2.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ terraform {
source = "git::ssh://[email protected]/hashicorp/example?ref=v1.0.3"
}

# gittags_ssh_subdir
terraform {
source = "git::ssh://[email protected]/hashicorp/example//subdir/test?ref=v1.0.4"
}

# invalid, ignored by test since it does not have source on the next line
terraform {
}
Expand Down
5 changes: 0 additions & 5 deletions lib/modules/manager/terragrunt/__fixtures__/4.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ terraform {
source = "git::ssh://[email protected]/hashicorp/example?depth=1&ref=v1.0.3"
}

# gittags_ssh_subdir
terraform {
source = "git::ssh://[email protected]/hashicorp/example//subdir/test?depth=1&ref=v1.0.4"
}

# invalid, ignored by test since it does not have source on the next line
terraform {
}
Expand Down
18 changes: 2 additions & 16 deletions lib/modules/manager/terragrunt/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,6 @@ describe('modules/manager/terragrunt/extract', () => {
depType: 'gitTags',
packageName: 'ssh://[email protected]/hashicorp/example',
},
{
currentValue: 'v1.0.4',
datasource: 'git-tags',
depName: 'mygit.com/hashicorp/example',
depType: 'gitTags',
packageName: 'ssh://[email protected]/hashicorp/example',
},
{
skipReason: 'no-source',
},
Expand Down Expand Up @@ -262,7 +255,7 @@ describe('modules/manager/terragrunt/extract', () => {
},
],
});
expect(res?.deps).toHaveLength(37);
expect(res?.deps).toHaveLength(36);
expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(4);
});

Expand Down Expand Up @@ -643,13 +636,6 @@ describe('modules/manager/terragrunt/extract', () => {
depType: 'gitTags',
packageName: 'ssh://[email protected]/hashicorp/example',
},
{
currentValue: 'v1.0.4',
datasource: 'git-tags',
depName: 'mygit.com/hashicorp/example',
depType: 'gitTags',
packageName: 'ssh://[email protected]/hashicorp/example',
},
{
skipReason: 'no-source',
},
Expand Down Expand Up @@ -698,7 +684,7 @@ describe('modules/manager/terragrunt/extract', () => {
},
],
});
expect(res?.deps).toHaveLength(36);
expect(res?.deps).toHaveLength(35);
expect(res?.deps.filter((dep) => dep.skipReason)).toHaveLength(4);
});

Expand Down
3 changes: 2 additions & 1 deletion lib/modules/manager/terragrunt/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export function analyseTerragruntModule(
dep.datasource = detectGitTagDatasource(url);
if (dep.datasource === GitTagsDatasource.id) {
if (containsSubDirectory) {
dep.packageName = `${protocol}//${host}${pathname.split('//')[0]}`;
const tempLookupName = url.split('//');
dep.packageName = tempLookupName[0] + '//' + tempLookupName[1];
} else {
dep.packageName = url;
}
Expand Down

0 comments on commit 64f641e

Please sign in to comment.