Skip to content

Commit

Permalink
Split coupled tests to fix timeout issues (#1827)
Browse files Browse the repository at this point in the history
* split coupled tests
  • Loading branch information
bogdanfazakas authored Jun 25, 2024
1 parent 865891c commit e257a64
Showing 1 changed file with 52 additions and 30 deletions.
82 changes: 52 additions & 30 deletions test/integration/PublishEditConsume.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ describe('Publish consume test', async () => {
)
})

it('Should publish the assets', async () => {
it('Should publish url asset', async () => {
urlAssetId = await createAsset(
'UrlDatatoken',
'URLDT',
Expand All @@ -209,31 +209,37 @@ describe('Publish consume test', async () => {
aquarius
)
assert(urlAssetId, 'Failed to publish url DDO')
})

arweaveAssetId = await createAsset(
'ArwaveDatatoken',
'ARWAVEDT',
it('Should publish ipfs asset', async () => {
ipfsAssetId = await createAsset(
'IpfsDatatoken',
'IPFSDT',
publisherAccount,
arweaveFile,
ifpsFile,
assetDdo,
providerUrl,
addresses.ERC721Factory,
aquarius
)
assert(urlAssetId, 'Failed to arwave publish DDO')
assert(urlAssetId, 'Failed to publish ipfs DDO')
})

ipfsAssetId = await createAsset(
'IpfsDatatoken',
'IPFSDT',
it('Should publish arwave asset', async () => {
arweaveAssetId = await createAsset(
'ArweaveDatatoken',
'ARWEAVEDT',
publisherAccount,
ifpsFile,
arweaveFile,
assetDdo,
providerUrl,
addresses.ERC721Factory,
aquarius
)
assert(urlAssetId, 'Failed to publish ipfs DDO')
assert(arweaveAssetId, 'Failed to publish ipfs DDO')
})

it('Should publish onchain asset', async () => {
const chainFile: Smartcontract = {
type: 'smartcontract',
address: addresses.Router,
Expand All @@ -246,11 +252,10 @@ describe('Publish consume test', async () => {
},
chainId: 8996
}

onchainFile.files[0] = chainFile
onchainAssetId = await createAsset(
'IpfsDatatoken',
'IPFSDT',
'ChainDatatoken',
'CHAINDT',
publisherAccount,
onchainFile,
assetDdo,
Expand All @@ -259,10 +264,12 @@ describe('Publish consume test', async () => {
aquarius
)
assert(onchainAssetId, 'Failed to publish onchain DDO')
})

it('Should publish graphql asset', async () => {
grapqlAssetId = await createAsset(
'IpfsDatatoken',
'IPFSDT',
'GraphDatatoken',
'GRAPHDT',
publisherAccount,
grapqlFile,
assetDdo,
Expand Down Expand Up @@ -335,9 +342,8 @@ describe('Publish consume test', async () => {
assert(graphqlMintTx, 'Failed minting graphql datatoken to consumer.')
})

it('Should order the datasets', async () => {
it('Should order url dataset', async () => {
datatoken = new Datatoken(consumerAccount, config.chainId)

urlOrderTx = await orderAsset(
resolvedUrlAssetDdo.id,
resolvedUrlAssetDdo.services[0].datatokenAddress,
Expand All @@ -348,7 +354,9 @@ describe('Publish consume test', async () => {
providerUrl
)
assert(urlOrderTx, 'Ordering url dataset failed.')
}).timeout(40000)

it('Should order arweave dataset', async () => {
arwaveOrderTx = await orderAsset(
resolvedArweaveAssetDdo.id,
resolvedArweaveAssetDdo.services[0].datatokenAddress,
Expand All @@ -359,29 +367,35 @@ describe('Publish consume test', async () => {
providerUrl
)
assert(arwaveOrderTx, 'Ordering arwave dataset failed.')
}).timeout(40000)

onchainOrderTx = await orderAsset(
resolvedOnchainAssetDdo.id,
resolvedOnchainAssetDdo.services[0].datatokenAddress,
it('Should order ipfs dataset', async () => {
ipfsOrderTx = await orderAsset(
resolvedIpfsAssetDdo.id,
resolvedIpfsAssetDdo.services[0].datatokenAddress,
await consumerAccount.getAddress(),
resolvedOnchainAssetDdo.services[0].id,
resolvedIpfsAssetDdo.services[0].id,
0,
datatoken,
providerUrl
)
assert(onchainOrderTx, 'Ordering onchain dataset failed.')
assert(ipfsOrderTx, 'Ordering ipfs dataset failed.')
}).timeout(40000)

ipfsOrderTx = await orderAsset(
resolvedIpfsAssetDdo.id,
resolvedIpfsAssetDdo.services[0].datatokenAddress,
it('Should order onchain dataset', async () => {
onchainOrderTx = await orderAsset(
resolvedOnchainAssetDdo.id,
resolvedOnchainAssetDdo.services[0].datatokenAddress,
await consumerAccount.getAddress(),
resolvedIpfsAssetDdo.services[0].id,
resolvedOnchainAssetDdo.services[0].id,
0,
datatoken,
providerUrl
)
assert(ipfsOrderTx, 'Ordering ipfs dataset failed.')
assert(onchainOrderTx, 'Ordering onchain dataset failed.')
}).timeout(40000)

it('Should order graphQl dataset', async () => {
grapqlOrderTx = await orderAsset(
resolvedGraphqlAssetDdo.id,
resolvedGraphqlAssetDdo.services[0].datatokenAddress,
Expand All @@ -392,7 +406,7 @@ describe('Publish consume test', async () => {
providerUrl
)
assert(grapqlOrderTx, 'Ordering graphql dataset failed.')
}).timeout(40000)
})

it('Should download the datasets files', async () => {
const urlDownloadUrl = await ProviderInstance.getDownloadUrl(
Expand Down Expand Up @@ -467,7 +481,7 @@ describe('Publish consume test', async () => {
}
})

it('Should update datasets metadata', async () => {
it('Should update url dataset', async () => {
resolvedUrlAssetDdo.metadata.name = 'updated url asset name'
const updateUrlTx = await updateAssetMetadata(
publisherAccount,
Expand All @@ -476,7 +490,9 @@ describe('Publish consume test', async () => {
aquarius
)
assert(updateUrlTx, 'Failed to update url asset metadata')
})

it('Should update arweave dataset', async () => {
resolvedArweaveAssetDdo.metadata.name = 'updated arwave asset name'
const updateArwaveTx = await updateAssetMetadata(
publisherAccount,
Expand All @@ -485,7 +501,9 @@ describe('Publish consume test', async () => {
aquarius
)
assert(updateArwaveTx, 'Failed to update arwave asset metadata')
})

it('Should update ipfs dataset', async () => {
resolvedIpfsAssetDdo.metadata.name = 'updated ipfs asset name'
const updateIpfsTx = await updateAssetMetadata(
publisherAccount,
Expand All @@ -494,7 +512,9 @@ describe('Publish consume test', async () => {
aquarius
)
assert(updateIpfsTx, 'Failed to update ipfs asset metadata')
})

it('Should update onchain dataset', async () => {
resolvedOnchainAssetDdo.metadata.name = 'updated onchain asset name'
const updateOnchainTx = await updateAssetMetadata(
publisherAccount,
Expand All @@ -503,7 +523,9 @@ describe('Publish consume test', async () => {
aquarius
)
assert(updateOnchainTx, 'Failed to update ipfs asset metadata')
})

it('Should update graphql dataset', async () => {
resolvedGraphqlAssetDdo.metadata.name = 'updated graphql asset name'
const updateGraphqlTx = await updateAssetMetadata(
publisherAccount,
Expand Down

0 comments on commit e257a64

Please sign in to comment.