Skip to content
Snippets Groups Projects
Commit f67e3473 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(terraform): skip tf files with only local modules

parent 8d99c9b8
No related branches found
Tags 39.118.5
No related merge requests found
...@@ -95,5 +95,8 @@ function extractDependencies(content) { ...@@ -95,5 +95,8 @@ function extractDependencies(content) {
delete dep.versionLine; delete dep.versionLine;
/* eslint-enable no-param-reassign */ /* eslint-enable no-param-reassign */
}); });
return deps.length ? { deps } : null; if (deps.some(dep => dep.skipReason !== 'local')) {
return { deps };
}
return null;
} }
...@@ -4,6 +4,10 @@ const { ...@@ -4,6 +4,10 @@ const {
} = require('../../../lib/manager/terraform/extract'); } = require('../../../lib/manager/terraform/extract');
const tf1 = fs.readFileSync('test/_fixtures/terraform/1.tf', 'utf8'); const tf1 = fs.readFileSync('test/_fixtures/terraform/1.tf', 'utf8');
const tf2 = `module "relative" {
source = "../../modules/fe"
}
`;
describe('lib/manager/terraform/extract', () => { describe('lib/manager/terraform/extract', () => {
describe('extractDependencies()', () => { describe('extractDependencies()', () => {
...@@ -20,5 +24,8 @@ describe('lib/manager/terraform/extract', () => { ...@@ -20,5 +24,8 @@ describe('lib/manager/terraform/extract', () => {
expect(res.deps).toHaveLength(13); expect(res.deps).toHaveLength(13);
expect(res.deps.filter(dep => dep.skipReason)).toHaveLength(4); expect(res.deps.filter(dep => dep.skipReason)).toHaveLength(4);
}); });
it('returns null if only local deps', () => {
expect(extractDependencies(tf2, config)).toBe(null);
});
}); });
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment