Skip to content

Commit

Permalink
Merge pull request #87 from qtomlinson/qt/add_fixture
Browse files Browse the repository at this point in the history
Add fixture for pypi package sdbus 0.12.0
  • Loading branch information
qtomlinson authored Jul 24, 2024
2 parents f2be76d + ef1e912 commit 9868ee7
Show file tree
Hide file tree
Showing 3 changed files with 766 additions and 5 deletions.
5 changes: 4 additions & 1 deletion tools/integration/lib/harvester.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ class Harvester {

async detectSchemaVersions(component, poller, tools) {
if (!component) throw new Error('Component not set')
console.log('Start to detect schema versions for harvest tools')
const startTime = Date.now()
//make sure that we have one entire set of harvest results (old or new)
await this.harvest([component])
await new Promise(resolve => setTimeout(resolve, poller.interval))

//trigger a reharvest to overwrite the old result, so we can verify the timestamp is new for completion
await this.harvest([component], true)

Expand All @@ -66,7 +69,7 @@ class Harvester {
startTime,
tools
)
console.log(`Detected schema versions: ${detectedToolVersions}`)
console.log(`Detected schema versions for harvest tools: ${detectedToolVersions}`)
this._harvestToolChecks = detectedToolVersions
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Validation definitions between dev and prod', function () {
findDefinition(coordinates),
getDefinition(devApiBaseUrl, coordinates)
])
deepStrictEqual(foundDef, omit(expectedDef, ['files']))
deepStrictEqualExpectedEntries(foundDef, omit(expectedDef, ['files']))
})
})

Expand All @@ -48,7 +48,7 @@ describe('Validation definitions between dev and prod', function () {
postDefinitions.then(r => r[coordinates]),
getDefinition(devApiBaseUrl, coordinates)
])
deepStrictEqual(actualDef, expectedDef)
deepStrictEqualExpectedEntries(actualDef, expectedDef)
})
})
})
Expand Down Expand Up @@ -80,13 +80,16 @@ function compareDefinition(recomputedDef, expectedDef) {
function compareLicensed(result, expectation) {
let actual = omit(result.licensed, ['facets'])
const expected = omit(expectation.licensed, ['facets'])
actual = pick(actual, Object.keys(expected))
deepStrictEqual(actual, expected)
deepStrictEqualExpectedEntries(actual, expected)
}

function compareDescribed(result, expectation) {
let actual = omit(result.described, ['tools'])
const expected = omit(expectation.described, ['tools'])
deepStrictEqualExpectedEntries(actual, expected)
}

function deepStrictEqualExpectedEntries(actual, expected) {
actual = pick(actual, Object.keys(expected))
deepStrictEqual(actual, expected)
}
Expand Down
Loading

0 comments on commit 9868ee7

Please sign in to comment.