Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Commit

Permalink
fix(dictionaries): set missing directory index
Browse files Browse the repository at this point in the history
Fixes #59
  • Loading branch information
trieloff committed Apr 18, 2019
1 parent 3708b69 commit ef56581
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/fastly/dictionaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion test/dictionaries.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ 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' }));
assert.ok(fastly.bulkUpdateDictItems.calledWith(1, 'strain_refs', { op: 'upsert', item_key: 'adhoc', item_value: 'master' }));
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' }));
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ strains:
adhoc:
<<: *basestrain
package: 75f29aa936bfc2b84bde5ac0ee4afbf824b1391e-dirty
directoryIndex: foo.html

client:
code: *myrepo
Expand Down

0 comments on commit ef56581

Please sign in to comment.