Skip to content

Commit

Permalink
Merge pull request #642 from nasa/CUMULUS-969
Browse files Browse the repository at this point in the history
Fix early-callback bug in jsftp
  • Loading branch information
Marc authored Oct 23, 2018
2 parents f355fd3 + 72b3c33 commit 32c3565
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 33 deletions.
2 changes: 1 addition & 1 deletion packages/ingest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"encodeurl": "^1.0.2",
"fs-extra": "^5.0.0",
"got": "^9.2.1",
"jsftp": "^2.0.0",
"jsftp": "https://github.com/yjpa7145/jsftp.git#Fix-partial-file-issue",
"json-loader": "~0.5.7",
"lodash.clonedeep": "^4.5.0",
"lodash.get": "^4.4.2",
Expand Down
47 changes: 15 additions & 32 deletions tasks/parse-pdr/tests/parse_pdrs_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,24 +291,16 @@ test.serial('Parse a PDR without a granuleIdFilter in the config', async (t) =>
await validateInput(t, t.context.payload.input);
await validateConfig(t, t.context.payload.config);

let output;
try {
output = await parsePdr(t.context.payload);
const output = await parsePdr(t.context.payload);

await validateOutput(t, output);
await validateOutput(t, output);

t.deepEqual(output.pdr, t.context.payload.input.pdr);
t.is(output.granules.length, 2);
t.is(output.granulesCount, 2);
t.is(output.filesCount, 2);
t.is(output.totalSize, 3952643);

t.deepEqual(output.pdr, t.context.payload.input.pdr);
t.is(output.granules.length, 2);
t.is(output.granulesCount, 2);
t.is(output.filesCount, 2);
t.is(output.totalSize, 3952643);
}
catch (err) {
if (err instanceof errors.RemoteResourceError || err.code === 'AllAccessDisabled') {
t.pass('ignoring this test. Test server seems to be down');
}
else t.fail(err);
}
});

test.serial('Empty FILE_ID valule in PDR, parse-pdr throws error', async (t) => {
Expand Down Expand Up @@ -403,22 +395,13 @@ test.serial('Parse a PDR with a granuleIdFilter in the config', async (t) => {
await validateInput(t, t.context.payload.input);
await validateConfig(t, t.context.payload.config);

let output;
try {
output = await parsePdr(t.context.payload);
const output = await parsePdr(t.context.payload);

await validateOutput(t, output);
await validateOutput(t, output);

t.deepEqual(output.pdr, t.context.payload.input.pdr);
t.is(output.granules.length, 1);
t.is(output.granulesCount, 1);
t.is(output.filesCount, 1);
t.is(output.totalSize, 1503297);
}
catch (err) {
if (err instanceof errors.RemoteResourceError || err.code === 'AllAccessDisabled') {
t.pass('ignoring this test. Test server seems to be down');
}
else t.fail(err);
}
t.deepEqual(output.pdr, t.context.payload.input.pdr);
t.is(output.granules.length, 1);
t.is(output.granulesCount, 1);
t.is(output.filesCount, 1);
t.is(output.totalSize, 1503297);
});

0 comments on commit 32c3565

Please sign in to comment.