Skip to content

Commit

Permalink
wip fix integration tests formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanIakovlev committed Oct 25, 2024
1 parent 6022b70 commit 4097a1e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
az network vnet delete \
--resource-group integration-test-vm \
--name ${{ github.event.inputs.vm_name }}-vnet
- name: Create VM with NSG
id: create_vm
uses: azure/arm-deploy@v2
Expand Down Expand Up @@ -158,7 +158,6 @@ jobs:
env:
DEV_API_BASE_URL: http://${{ needs.deploy-and-run.outputs.vm_ip }}:4000
strategy:
max-parallel: 1
matrix:
dynamicCoordinates: ${{ fromJson(github.event.inputs.dynamicCoordinates) }}
defaults:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ async function findAttachments(apiBaseUrl, coordinates) {

async function compareAttachment(sha256) {
const [devAttachment, prodAttachment] = await Promise.all(
[callFetch(`${getDevApiBaseUrl()}/attachments/${sha256}`), callFetch(`${prodApiBaseUrl}/attachments/${sha256}`)].map(p =>
p.then(r => r.text())
)
[
callFetch(`${getDevApiBaseUrl()}/attachments/${sha256}`),
callFetch(`${prodApiBaseUrl}/attachments/${sha256}`)
].map(p => p.then(r => r.text()))
)
strictEqual(devAttachment, prodAttachment)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,26 @@ describe('Validate curation', function () {
})

it(`should reflect the PR in definition preview via definitions/${coordinates}/pr`, async function () {
const curatedDefinition = await callFetch(`${getDevApiBaseUrl()}/definitions/${coordinates}/pr/${prNumber}`).then(r =>
r.json()
const curatedDefinition = await callFetch(`${getDevApiBaseUrl()}/definitions/${coordinates}/pr/${prNumber}`).then(
r => r.json()
)
strictEqual(curatedDefinition.described.releaseDate, curation.described.releaseDate)
})

it(`should get of list of PRs for component via /curations/${type}/${provider}/${namespace}/${name}`, async function () {
const response = await callFetch(`${getDevApiBaseUrl()}/curations/${type}/${provider}/${namespace}/${name}`).then(r =>
r.json()
const response = await callFetch(`${getDevApiBaseUrl()}/curations/${type}/${provider}/${namespace}/${name}`).then(
r => r.json()
)
const proposedPR = response.contributions.filter(c => c.prNumber === prNumber)
ok(proposedPR)
})

it('should get PRs for components via post /curations', async function () {
const revisionlessCoordinates = `${type}/${provider}/${namespace}/${name}`
const response = await callFetch(`${getDevApiBaseUrl()}/curations`, buildPostOpts([revisionlessCoordinates])).then(r =>
r.json()
)
const response = await callFetch(
`${getDevApiBaseUrl()}/curations`,
buildPostOpts([revisionlessCoordinates])
).then(r => r.json())
const proposedPR = response[revisionlessCoordinates].contributions.filter(c => c.prNumber === prNumber)
ok(proposedPR)
})
Expand Down

0 comments on commit 4097a1e

Please sign in to comment.