mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
add integration test for compute with a rawcode algo
This commit is contained in:
parent
418e2fadb2
commit
40b2ccffea
@ -1,7 +1,15 @@
|
||||
import { assert } from 'chai'
|
||||
|
||||
import { config } from '../config'
|
||||
import { Ocean, Account, DDO, MetaData, ComputeJobStatus, Config } from '../../../src'
|
||||
import {
|
||||
Ocean,
|
||||
Account,
|
||||
DDO,
|
||||
MetaData,
|
||||
ComputeJobStatus,
|
||||
Config,
|
||||
MetaDataAlgorithm
|
||||
} from '../../../src'
|
||||
import { getMetadata, createComputeService } from '../utils'
|
||||
import { ServiceCompute } from '../../../src/ddo/Service'
|
||||
|
||||
@ -88,9 +96,28 @@ describe('Compute', () => {
|
||||
} catch {}
|
||||
})
|
||||
|
||||
it('should start a compute job', async () => {
|
||||
it('should start a compute job with a published algo', async () => {
|
||||
const response = await ocean.compute.start(account, agreementId, algorithm.id)
|
||||
|
||||
assert.equal(response.status, ComputeJobStatus.Started)
|
||||
})
|
||||
|
||||
it('should start a compute job with a rawcode algo', async () => {
|
||||
const algoMeta: MetaDataAlgorithm = {
|
||||
rawcode: `console.log('Hello world!')`,
|
||||
container: {
|
||||
entrypoint: 'node $ALGO',
|
||||
image: 'node',
|
||||
tag: '10'
|
||||
}
|
||||
}
|
||||
const response = await ocean.compute.start(
|
||||
account,
|
||||
agreementId,
|
||||
undefined,
|
||||
algoMeta
|
||||
)
|
||||
|
||||
assert.equal(response.status, ComputeJobStatus.Started)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user