Skip to content

Commit

Permalink
feat: Correctly substitute image name when using -native image
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Broudoux <[email protected]>
  • Loading branch information
lbroudoux committed Mar 28, 2024
1 parent c194035 commit acd73cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/microcks-containers-ensemble.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ describe("MicrocksContainersEnsemble", () => {
})
await client.send(createCommand);

const ensemble = await new MicrocksContainersEnsemble(network, "quay.io/microcks/microcks-uber:nightly")
const ensemble = await new MicrocksContainersEnsemble(network, "quay.io/microcks/microcks-uber:1.9.0-native")
.withMainArtifacts([path.resolve(resourcesDir, "pastry-orders-asyncapi.yml")])
.withAsyncFeature()
.withAmazonSQSConnection({
Expand All @@ -256,7 +256,7 @@ describe("MicrocksContainersEnsemble", () => {
endpointOverride: 'http://localstack:4566'
})
.start();

// Initialize messages list and connect to mock endpoint.
let messages: string[] = [];
let sqsEndpoint = ensemble.getAsyncMinionContainer()?.getAmazonSQSMockQueue("Pastry orders API", "0.1.0", "SUBSCRIBE pastry/orders");
Expand Down Expand Up @@ -372,7 +372,7 @@ describe("MicrocksContainersEnsemble", () => {
});
client.send(sendCommand);
console.log('Sending bad message ' + i + ' on SQS queue');
delay(1000);
await delay(500);
}

let testResult = await testResultPromise;
Expand All @@ -397,7 +397,7 @@ describe("MicrocksContainersEnsemble", () => {
});
client.send(sendCommand);
console.log('Sending good message ' + i + ' on SQS queue');
delay(1000);
await delay(5000);
}

let testResult2 = await testResultPromise2;
Expand Down
3 changes: 3 additions & 0 deletions src/microcks-containers-ensemble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export class MicrocksContainersEnsemble {
*/
public withAsyncFeature(image?: string): this {
let asyncMinionImage = (image ? image : this.microcksContainer.getImageName().replace("microcks-uber", "microcks-uber-async-minion"));
if (asyncMinionImage.endsWith("-native")) {
asyncMinionImage = asyncMinionImage.substring(0, asyncMinionImage.length - "-native".length);
}
this.asyncMinionContainer = new MicrocksAsyncMinionContainer(this.network, asyncMinionImage);
return this;
}
Expand Down

0 comments on commit acd73cb

Please sign in to comment.