diff --git a/src/components/database/sqliteCompute.ts b/src/components/database/sqliteCompute.ts index 4b1d0bebf..9d87bd16f 100644 --- a/src/components/database/sqliteCompute.ts +++ b/src/components/database/sqliteCompute.ts @@ -462,7 +462,7 @@ export class SQLiteCompute implements ComputeDatabaseProvider { if (consumerAddrs && consumerAddrs.length > 0) { const placeholders = consumerAddrs.map(() => '?').join(',') - conditions.push(`owner NOT IN (${placeholders})`) + conditions.push(`owner IN (${placeholders})`) params.push(...consumerAddrs) } diff --git a/src/test/integration/getJobs.test.ts b/src/test/integration/getJobs.test.ts index 0f405a66b..58aba7857 100644 --- a/src/test/integration/getJobs.test.ts +++ b/src/test/integration/getJobs.test.ts @@ -131,7 +131,7 @@ describe('GetJobsHandler integration', () => { expect(filtered.every((j) => Number(j.dateFinished) >= Number(fromTs))).to.equal(true) }) - it('should exclude jobs owned by specified consumer addresses', async function () { + it('should include jobs owned by specified consumer addresses', async function () { this.timeout(DEFAULT_TEST_TIMEOUT) const resp = await handler.handle({ @@ -144,7 +144,7 @@ describe('GetJobsHandler integration', () => { const jobs = (await streamToObject(resp.stream as Readable)) as any[] const owners = jobs.filter((j) => j.environment === uniqueEnv).map((j) => j.owner) - expect(owners.includes(ownerA)).to.equal(false) - expect(owners.includes(ownerB)).to.equal(true) + expect(owners.includes(ownerA)).to.equal(true) + expect(owners.includes(ownerB)).to.equal(false) }) })