diff --git a/hermetic/src/cli/tester.rs b/hermetic/src/cli/tester.rs index 013ab18..97b1b50 100644 --- a/hermetic/src/cli/tester.rs +++ b/hermetic/src/cli/tester.rs @@ -750,6 +750,7 @@ fn job_init() -> Container { Container { name: "init-tests".to_owned(), image: Some("stedolan/jq".to_owned()), + image_pull_policy: Some("IfNotPresent".to_owned()), command: Some(vec![ "/bin/bash".to_owned(), "-c".to_owned(), diff --git a/suite/Dockerfile b/suite/Dockerfile index ff0c368..36c8aff 100644 --- a/suite/Dockerfile +++ b/suite/Dockerfile @@ -15,6 +15,6 @@ RUN pnpm install COPY src/ ./src # Select all tests by default -ENV TEST_SELECTOR "correctness" +ENV TEST_SELECTOR="correctness" ENTRYPOINT ["/app/entrypoint.sh", "run", "test", "--testPathPattern", "$TEST_SELECTOR"] diff --git a/suite/src/__tests__/correctness/slow/ceramic-cas-integration.test.ts b/suite/src/__tests__/correctness/slow/ceramic-cas-integration.test.ts index 8106634..906241a 100644 --- a/suite/src/__tests__/correctness/slow/ceramic-cas-integration.test.ts +++ b/suite/src/__tests__/correctness/slow/ceramic-cas-integration.test.ts @@ -37,9 +37,7 @@ describe('Ceramic<->CAS basic integration', () => { // Test document creation is anchored correctly console.log('Waiting for anchor of genesis record') - await waitForAnchor(doc).catch((errStr) => { - throw new Error(errStr) - }) + await waitForAnchor(doc) expect(doc.state.log.length).toEqual(2) // Test document update @@ -50,14 +48,12 @@ describe('Ceramic<->CAS basic integration', () => { // Test document update is anchored correctly console.log('Waiting for anchor of update') - await waitForAnchor(doc).catch((errStr) => { - throw new Error(errStr) - }) + await waitForAnchor(doc) expect(doc.content).toEqual(newContent) expect(doc.state.log.length).toEqual(4) }) - test('multiple documents are anchored properly, multiple updates per anchor batch', async () => { + test('multiple documents are anchored properly', async () => { const content0 = { step: 0 } const content1 = { step: 1 } const content2 = { step: 2 } @@ -78,18 +74,10 @@ describe('Ceramic<->CAS basic integration', () => { // Test document creation is anchored correctly console.log('Waiting for anchor of genesis records') - await waitForAnchor(doc1).catch((errStr) => { - throw new Error(errStr) - }) - await waitForAnchor(doc2).catch((errStr) => { - throw new Error(errStr) - }) - await waitForAnchor(doc3).catch((errStr) => { - throw new Error(errStr) - }) - await waitForAnchor(doc4).catch((errStr) => { - throw new Error(errStr) - }) + await waitForAnchor(doc1) + await waitForAnchor(doc2) + await waitForAnchor(doc3) + await waitForAnchor(doc4) expect(doc1.state.anchorStatus).toEqual(AnchorStatus.ANCHORED) expect(doc1.state.log.length).toEqual(2) @@ -101,52 +89,36 @@ describe('Ceramic<->CAS basic integration', () => { expect(doc4.state.log.length).toEqual(2) // Test document updates + // The anchor option is no longer honored when ceramic-one does the anchroing. console.log('Updating documents') - await doc1.replace(content1, undefined, { anchor: true }) - await doc2.replace(content1, undefined, { anchor: false }) - await doc3.replace(content1, undefined, { anchor: false }) - await doc4.replace(content1, undefined, { anchor: false }) + await doc1.replace(content1) + await doc2.replace(content2) + await doc3.replace(content3) + await doc4.replace(content4) - await doc2.replace(content2, undefined, { anchor: true }) - await doc3.replace(content2, undefined, { anchor: false }) - await doc4.replace(content2, undefined, { anchor: false }) + // Test document updates are anchored correctly + console.log('Waiting for anchor of updates') - await doc3.replace(content3, undefined, { anchor: true }) - await doc4.replace(content3, undefined, { anchor: false }) + await waitForAnchor(doc1) + await waitForAnchor(doc2) + await waitForAnchor(doc3) + await waitForAnchor(doc4) - await doc4.replace(content4, undefined, { anchor: true }) expect(doc1.content).toEqual(content1) expect(doc2.content).toEqual(content2) expect(doc3.content).toEqual(content3) expect(doc4.content).toEqual(content4) - // Test document updates are anchored correctly - console.log('Waiting for anchor of updates') - await waitForAnchor(doc1).catch((errStr) => { - throw new Error(errStr) - }) - await waitForAnchor(doc2).catch((errStr) => { - throw new Error(errStr) - }) - await waitForAnchor(doc3).catch((errStr) => { - throw new Error(errStr) - }) - await waitForAnchor(doc4).catch((errStr) => { - throw new Error(errStr) - }) expect(doc1.state.anchorStatus).toEqual(AnchorStatus.ANCHORED) expect(doc2.state.anchorStatus).toEqual(AnchorStatus.ANCHORED) expect(doc3.state.anchorStatus).toEqual(AnchorStatus.ANCHORED) expect(doc4.state.anchorStatus).toEqual(AnchorStatus.ANCHORED) - expect(doc1.content).toEqual(content1) - expect(doc2.content).toEqual(content2) - expect(doc3.content).toEqual(content3) - expect(doc4.content).toEqual(content4) + expect(doc1.state.log.length).toEqual(4) - expect(doc2.state.log.length).toEqual(5) - expect(doc3.state.log.length).toEqual(6) - expect(doc4.state.log.length).toEqual(7) + expect(doc2.state.log.length).toEqual(4) + expect(doc3.state.log.length).toEqual(4) + expect(doc4.state.log.length).toEqual(4) }) })