From ef565812c2009dc71e8d09a5bb268e0631be6072 Mon Sep 17 00:00:00 2001 From: Lars Trieloff Date: Thu, 18 Apr 2019 09:53:51 +0000 Subject: [PATCH] fix(dictionaries): set missing directory index Fixes #59 --- src/fastly/dictionaries.js | 2 ++ test/dictionaries.test.js | 4 +++- test/fixtures/full.yaml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fastly/dictionaries.js b/src/fastly/dictionaries.js index 6334c940..3042af1c 100644 --- a/src/fastly/dictionaries.js +++ b/src/fastly/dictionaries.js @@ -62,6 +62,8 @@ async function updatestrains(fastly, version, strains) { upsertstrain(p, 'strain_repos', strain.name, strain.content.repo); upsertstrain(p, 'strain_root_paths', strain.name, strain.content.path); + upsertstrain(p, 'strain_index_files', strain.name, strain.directoryIndex); + upsertstrain(p, 'strain_github_static_repos', strain.name, strain.static.repo); upsertstrain(p, 'strain_github_static_owners', strain.name, strain.static.owner); diff --git a/test/dictionaries.test.js b/test/dictionaries.test.js index 67f980b5..4346818a 100644 --- a/test/dictionaries.test.js +++ b/test/dictionaries.test.js @@ -38,7 +38,7 @@ describe('Testing dictionaries.js', () => { .init(); assert.ok(await updatestrains(fastly, 1, config.strains)); - assert.equal(fastly.bulkUpdateDictItems.getCalls().length, 11); + assert.equal(fastly.bulkUpdateDictItems.getCalls().length, 12); assert.ok(fastly.bulkUpdateDictItems.calledWith(1, 'strain_action_roots', { op: 'upsert', item_key: 'adhoc', item_value: '75f29aa936bfc2b84bde5ac0ee4afbf824b1391e-dirty' })); assert.ok(fastly.bulkUpdateDictItems.calledWith(1, 'strain_owners', { op: 'upsert', item_key: 'adhoc', item_value: 'adobe' })); @@ -46,6 +46,8 @@ describe('Testing dictionaries.js', () => { assert.ok(fastly.bulkUpdateDictItems.calledWith(1, 'strain_repos', { op: 'upsert', item_key: 'adhoc', item_value: 'project-helix.io' })); assert.ok(fastly.bulkUpdateDictItems.calledWith(1, 'strain_root_paths', { op: 'upsert', item_key: 'adhoc', item_value: '' })); + assert.ok(fastly.bulkUpdateDictItems.calledWith(1, 'strain_index_files', { op: 'upsert', item_key: 'adhoc', item_value: 'foo.html' })); + assert.ok(fastly.bulkUpdateDictItems.calledWith(1, 'strain_github_static_repos', { op: 'upsert', item_key: 'adhoc', item_value: 'project-helix.io' })); assert.ok(fastly.bulkUpdateDictItems.calledWith(1, 'strain_github_static_owners', { op: 'upsert', item_key: 'adhoc', item_value: 'adobe' })); assert.ok(fastly.bulkUpdateDictItems.calledWith(1, 'strain_github_static_refs', { op: 'upsert', item_key: 'adhoc', item_value: 'master' })); diff --git a/test/fixtures/full.yaml b/test/fixtures/full.yaml index 63992dcd..01f709a8 100644 --- a/test/fixtures/full.yaml +++ b/test/fixtures/full.yaml @@ -31,6 +31,7 @@ strains: adhoc: <<: *basestrain package: 75f29aa936bfc2b84bde5ac0ee4afbf824b1391e-dirty + directoryIndex: foo.html client: code: *myrepo