forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(test-tooling): add new besu AIO image builder utility
1. This will help author test cases for the Besu connector that are designed to be testing the latest version of the image instead of a pinned one that we pull from the registry as part of the test case. 2. We need tests for both latest and pinned image versions if we want to make sure that the connector is backward compatible with older ledger versions. Signed-off-by: Peter Somogyvari <[email protected]>
- Loading branch information
Showing
4 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
"Authz", | ||
"authzn", | ||
"AWSSM", | ||
"baio", | ||
"benchmarkjs", | ||
"Besu", | ||
"Bools", | ||
|
49 changes: 49 additions & 0 deletions
49
packages/cactus-test-tooling/src/main/typescript/corda/build-image-besu-all-in-one-latest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import path from "node:path"; | ||
import { buildContainerImage } from "../public-api"; | ||
import { LoggerProvider, LogLevelDesc } from "@hyperledger/cactus-common"; | ||
|
||
export interface IBuildImageBesuAllInOneLatestResponse { | ||
readonly imageName: Readonly<string>; | ||
readonly imageVersion: Readonly<string>; | ||
/** | ||
* The concatenation of `imageName` a colon character and `imageVersion`. | ||
*/ | ||
readonly imageTag: Readonly<string>; | ||
} | ||
|
||
export interface IBuildImageBesuAllInOneLatestRequest { | ||
readonly logLevel?: Readonly<LogLevelDesc>; | ||
} | ||
|
||
export async function buildImageBesuAllInOneLatest( | ||
req: IBuildImageBesuAllInOneLatestRequest, | ||
): Promise<IBuildImageBesuAllInOneLatestResponse> { | ||
if (!req) { | ||
throw new Error("Expected arg req to be truthy."); | ||
} | ||
const logLevel: LogLevelDesc = req.logLevel || "WARN"; | ||
const log = LoggerProvider.getOrCreate({ | ||
level: logLevel, | ||
label: "build-image-besu-all-in-one-latest.ts", | ||
}); | ||
const projectRoot = path.join(__dirname, "../../../../../../../"); | ||
|
||
const buildDirRel = "./tools/docker/besu-all-in-one/"; | ||
|
||
const buildDirAbs = path.join(projectRoot, buildDirRel); | ||
|
||
log.info("Invoking container build with build dir: %s", buildDirAbs); | ||
|
||
const imageName = "baio"; | ||
const imageVersion = "latest"; | ||
const imageTag = `${imageName}:${imageVersion}`; | ||
|
||
await buildContainerImage({ | ||
buildDir: buildDirAbs, | ||
imageFile: "Dockerfile", | ||
imageTag, | ||
logLevel: logLevel, | ||
}); | ||
|
||
return { imageName, imageVersion, imageTag }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters