Skip to content

Commit 5a52564

Browse files
dwhoganmauberti-bc
andauthored
SIMSBIOHUB-864: Submission Validation and Ingestion Job (#330)
* feat(download): Download package with cleanup * feat(download): Decompose policy URN and index, add data_byte_size to column to submission_feature, a few enhancement to csv package. * test(download_worker): Added db and system tests. * fix(download): Fixes to address comments * fix(download): Lint fixes. * fix(ingestion): Address reviewer's comments * fix(ingestion): Sonar fixes * feat(download): add ownership, sharing, and auth gates * fix(download): lint format fix * feat(submission-ingestion): Submission process job to validate and ingest submission * fix(submission-ingestion): Lint * feat(ingestion): integration tests * fix(ingestion): scope DLQ status update to latest validation record * refactor(ingestion): Reorg to align to convention * refactor(ingestion): get to findFeatureTypeWithProperties * fix(ingestion): address PR review feedback --------- Co-authored-by: Macgregor Aubertin-Young <108430771+mauberti-bc@users.noreply.github.com>
1 parent 0c07ed4 commit 5a52564

35 files changed

+5002
-1745
lines changed

api/src/__integration__/system/malware-scan-worker.integration.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
// Requires: make web && make clamav && make queue
55
import { expect } from 'chai';
66
import { Knex, knex } from 'knex';
7+
import sinon from 'sinon';
78
import * as tar from 'tar-stream';
89
import { initPgBoss, stopPgBoss } from '../../queue/pg-boss-service';
9-
import { publishMalwareScanJob } from '../../queue/publisher';
10+
import * as publisher from '../../queue/publisher';
1011
import { BucketType, ObjectStorageService } from '../../services/object-storage/object-storage-service';
1112

1213
// EICAR test signature - standard antivirus test string (NOT actual malware)
@@ -62,10 +63,13 @@ describe('Malware Scan Worker', function () {
6263
searchPath: ['biohub', 'public']
6364
});
6465
storageService = new ObjectStorageService();
66+
// Stub the downstream job publisher so the scan doesn't chain into validation
67+
sinon.stub(publisher, 'publishProcessSubmissionFeaturesJob').resolves();
6568
await initPgBoss();
6669
});
6770

6871
after(async () => {
72+
sinon.restore();
6973
// Cleanup: remove test data (child rows first, then parent rows)
7074
try {
7175
if (createdArtifactIds.length > 0) {
@@ -129,7 +133,7 @@ describe('Malware Scan Worker', function () {
129133
})
130134
.returning('artifact_security_id');
131135

132-
await publishMalwareScanJob({ artifactSecurityId: security.artifact_security_id });
136+
await publisher.publishMalwareScanJob({ artifactSecurityId: security.artifact_security_id });
133137
const result = await waitForScanResult(db, security.artifact_security_id);
134138

135139
return { result, objectKey };

0 commit comments

Comments
 (0)