-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix getMeasurements(), which retrieves the invocation details for the…
… compare view (#195)
- Loading branch information
Showing
10 changed files
with
116 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { describe, expect, it, beforeAll, afterAll } from '@jest/globals'; | ||
|
||
import { | ||
TestDatabase, | ||
closeMainDb, | ||
createAndInitializeDB | ||
} from '../db/db-testing.js'; | ||
import { loadLargePayload } from '../../payload.js'; | ||
import { getMeasurements } from '../../../src/backend/compare/compare.js'; | ||
|
||
describe('compare view: getMeasurements()', () => { | ||
let db: TestDatabase; | ||
|
||
beforeAll(async () => { | ||
db = await createAndInitializeDB('compare_view_get_m', 0, false); | ||
const largeTestData = loadLargePayload(); | ||
await db.recordAllData(largeTestData); | ||
}); | ||
|
||
afterAll(async () => { | ||
if (db) return db.close(); | ||
}); | ||
|
||
it('should give expected results for runId 1', async () => { | ||
const results = await getMeasurements( | ||
'Large-Example-Project', | ||
10, | ||
'58666d1c84c652306f930daa72e7a47c58478e86', | ||
'58666d1c84c652306f930daa72e7a47c58478e86', | ||
db | ||
); | ||
|
||
expect(results).toHaveLength(1); | ||
if (results === null) return; | ||
expect(results[0].data).toHaveLength(1); | ||
expect(results[0].data[0].criterion).toEqual('total'); | ||
expect(results[0].data[0].values).toHaveLength(1); | ||
expect(results[0].data[0].values[0]).toHaveLength(1000); | ||
}); | ||
}); | ||
|
||
afterAll(async () => { | ||
return closeMainDb(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters