diff --git a/apps/cli/src/config.ts b/apps/cli/src/config.ts index 77fdad1b..33a75151 100644 --- a/apps/cli/src/config.ts +++ b/apps/cli/src/config.ts @@ -78,7 +78,7 @@ const DEFAULT_RAM_IMAGE_DOCKER = "/usr/share/cartesi-machine/images/linux.bin"; const DEFAULT_RAM_IMAGE_LINUX = "/usr/share/cartesi-machine/images/linux.bin"; const DEFAULT_RAM_IMAGE_MAC = "/opt/homebrew/share/cartesi-machine/images/linux.bin"; -const DEFAULT_SDK = "cartesi/sdk:0.12.0-alpha.0"; +export const DEFAULT_SDK = "cartesi/sdk:0.12.0-alpha.0"; type Builder = "directory" | "docker" | "empty" | "none" | "tar"; type DriveFormat = "ext2" | "sqfs"; diff --git a/apps/cli/test/builder/directory.test.ts b/apps/cli/test/builder/directory.test.ts index e3ce184e..facf0028 100644 --- a/apps/cli/test/builder/directory.test.ts +++ b/apps/cli/test/builder/directory.test.ts @@ -2,11 +2,11 @@ import fs from "fs-extra"; import path from "path"; import { describe, expect } from "vitest"; import { build } from "../../src/builder/directory"; -import { DirectoryDriveConfig } from "../../src/config"; +import { DEFAULT_SDK, DirectoryDriveConfig } from "../../src/config"; import { tmpdirTest } from "./tmpdirTest"; describe("when building with the directory builder", () => { - const image = "cartesi/sdk:0.11.0"; + const image = DEFAULT_SDK; tmpdirTest( "should fail when the directory doesn't exists", diff --git a/apps/cli/test/builder/docker.test.ts b/apps/cli/test/builder/docker.test.ts index b6c73bea..373faa91 100644 --- a/apps/cli/test/builder/docker.test.ts +++ b/apps/cli/test/builder/docker.test.ts @@ -3,11 +3,11 @@ import { beforeEach } from "node:test"; import path from "path"; import { describe, expect } from "vitest"; import { build } from "../../src/builder/docker"; -import { DockerDriveConfig } from "../../src/config"; +import { DEFAULT_SDK, DockerDriveConfig } from "../../src/config"; import { tmpdirTest } from "./tmpdirTest"; describe("when building with the docker builder", () => { - const image = "cartesi/sdk:0.11.0"; + const image = DEFAULT_SDK; beforeEach(({ name }) => { fs.mkdirpSync(path.join(__dirname, "output", name)); diff --git a/apps/cli/test/builder/empty.test.ts b/apps/cli/test/builder/empty.test.ts index e5fde98e..146cfda4 100644 --- a/apps/cli/test/builder/empty.test.ts +++ b/apps/cli/test/builder/empty.test.ts @@ -2,11 +2,11 @@ import fs from "fs-extra"; import path from "path"; import { describe, expect } from "vitest"; import { build } from "../../src/builder/empty"; -import { EmptyDriveConfig } from "../../src/config"; +import { DEFAULT_SDK, EmptyDriveConfig } from "../../src/config"; import { tmpdirTest } from "./tmpdirTest"; describe("when building with the empty builder", () => { - const image = "cartesi/sdk:0.11.0"; + const image = DEFAULT_SDK; tmpdirTest("should fail with an invalid size", async ({ tmpdir }) => { const destination = tmpdir; diff --git a/apps/cli/test/builder/tar.test.ts b/apps/cli/test/builder/tar.test.ts index 0460b35d..d21c0e00 100644 --- a/apps/cli/test/builder/tar.test.ts +++ b/apps/cli/test/builder/tar.test.ts @@ -2,11 +2,11 @@ import fs from "fs-extra"; import path from "path"; import { describe, expect } from "vitest"; import { build } from "../../src/builder/tar"; -import { TarDriveConfig } from "../../src/config"; +import { DEFAULT_SDK, TarDriveConfig } from "../../src/config"; import { tmpdirTest } from "./tmpdirTest"; describe("when building with the tar builder", () => { - const image = "cartesi/sdk:0.11.0"; + const image = DEFAULT_SDK; tmpdirTest("should not build a missing file", async ({ tmpdir }) => { const destination = tmpdir; diff --git a/apps/cli/test/exec/cartesi-machine.test.ts b/apps/cli/test/exec/cartesi-machine.test.ts index 99beccce..4585e273 100644 --- a/apps/cli/test/exec/cartesi-machine.test.ts +++ b/apps/cli/test/exec/cartesi-machine.test.ts @@ -1,12 +1,13 @@ import { satisfies } from "semver"; import { describe, expect, it } from "vitest"; +import { DEFAULT_SDK } from "../../src/config.js"; import { cartesiMachine } from "../../src/exec/index.js"; describe("cartesi-machine", () => { it("should report version", async () => { const version = await cartesiMachine.version({ forceDocker: true, - image: "cartesi/sdk:0.11.0", + image: DEFAULT_SDK, }); expect(version).toBeDefined(); expect( diff --git a/apps/cli/test/exec/crane.test.ts b/apps/cli/test/exec/crane.test.ts index 3cf9388a..96be7ea4 100644 --- a/apps/cli/test/exec/crane.test.ts +++ b/apps/cli/test/exec/crane.test.ts @@ -1,12 +1,13 @@ import { satisfies } from "semver"; import { describe, expect, it } from "vitest"; +import { DEFAULT_SDK } from "../../src/config.js"; import { crane } from "../../src/exec/index.js"; describe("crane", () => { it("should report version", async () => { const version = await crane.version({ forceDocker: true, - image: "cartesi/sdk:0.11.0", + image: DEFAULT_SDK, }); expect(version).toBeDefined(); expect( diff --git a/apps/cli/test/exec/genext2fs.test.ts b/apps/cli/test/exec/genext2fs.test.ts index 4fc21671..58e17195 100644 --- a/apps/cli/test/exec/genext2fs.test.ts +++ b/apps/cli/test/exec/genext2fs.test.ts @@ -1,12 +1,13 @@ import { satisfies } from "semver"; import { describe, expect, it } from "vitest"; +import { DEFAULT_SDK } from "../../src/config.js"; import { genext2fs } from "../../src/exec/index.js"; describe("genext2fs", () => { it("should report version", async () => { const version = await genext2fs.version({ forceDocker: true, - image: "cartesi/sdk:0.11.0", + image: DEFAULT_SDK, }); expect(version).toBeDefined(); diff --git a/apps/cli/test/exec/mksquashfs.test.ts b/apps/cli/test/exec/mksquashfs.test.ts index 783ade86..a99887b6 100644 --- a/apps/cli/test/exec/mksquashfs.test.ts +++ b/apps/cli/test/exec/mksquashfs.test.ts @@ -1,12 +1,13 @@ import { satisfies } from "semver"; import { describe, expect, it } from "vitest"; +import { DEFAULT_SDK } from "../../src/config.js"; import { mksquashfs } from "../../src/exec/index.js"; describe("mksquashfs", () => { it("should report version", async () => { const version = await mksquashfs.version({ forceDocker: true, - image: "cartesi/sdk:0.11.0", + image: DEFAULT_SDK, }); expect(version).toBeDefined(); expect(