-
Notifications
You must be signed in to change notification settings - Fork 552
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
11040: ci(smoke-test): multi-arch container smoke test r=megglos a=megglos ## Description Docker builds and smoke tests are only run on Linux machines as building docker containers on macOS and windows runners introduces complexity to the CI setup that we consider not worth the effort: - macOS runners require the setup of [colima as a docker runtime](actions/runner-images#6216) which adds another 1.5-2m to the runtime - on macOS testcontainers failed to detect the docker environment unless [additional environment variables](https://www.testcontainers.org/features/configuration/#customizing-docker-host-detection) have been set - some docker related actions are not supported on windows runners like [`docker/build-push-action`](docker/build-push-action#18 (comment)) - the docker setup on Githubs windows runners seems to be bound to the `windows/amd64` platform, see e.g. this [log](https://github.com/camunda/zeebe/actions/runs/3500015748/jobs/5862231609) Usage of native arm64 runners is listed as a separate sub-task on #10986. ## Related issues closes #11020 Co-authored-by: Meggle (Sebastian Bathke) <sebastian.bathke@camunda.com> Co-authored-by: Sebastian Bathke (Meggle) <sebastian.bathke@camunda.com>
- Loading branch information
Showing
4 changed files
with
132 additions
and
4 deletions.
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
76 changes: 76 additions & 0 deletions
76
qa/integration-tests/src/test/java/io/camunda/zeebe/it/smoke/ContainerClusterSmokeIT.java
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,76 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.1. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.1. | ||
*/ | ||
package io.camunda.zeebe.it.smoke; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import io.camunda.zeebe.client.api.response.DeploymentEvent; | ||
import io.camunda.zeebe.client.api.response.ProcessInstanceResult; | ||
import io.camunda.zeebe.model.bpmn.Bpmn; | ||
import io.camunda.zeebe.model.bpmn.BpmnModelInstance; | ||
import io.camunda.zeebe.qa.util.testcontainers.ZeebeTestContainerDefaults; | ||
import io.zeebe.containers.cluster.ZeebeCluster; | ||
import java.util.concurrent.TimeUnit; | ||
import org.testcontainers.junit.jupiter.Container; | ||
import org.testcontainers.junit.jupiter.Testcontainers; | ||
|
||
@Testcontainers | ||
final class ContainerClusterSmokeIT { | ||
|
||
@Container | ||
private final ZeebeCluster cluster = | ||
ZeebeCluster.builder() | ||
.withBrokersCount(1) | ||
.withGatewaysCount(1) | ||
.withPartitionsCount(1) | ||
.withEmbeddedGateway(false) | ||
.withImage(ZeebeTestContainerDefaults.defaultTestImage()) | ||
.build(); | ||
|
||
/** A smoke test which checks that a gateway of a cluster can be accessed. */ | ||
@ContainerSmokeTest | ||
void connectSmokeTest() { | ||
// given | ||
try (final var client = cluster.newClientBuilder().build()) { | ||
// when | ||
final var topology = client.newTopologyRequest().send(); | ||
|
||
// then | ||
final var result = topology.join(5L, TimeUnit.SECONDS); | ||
assertThat(result.getBrokers()).as("There is one connected broker").hasSize(1); | ||
} | ||
} | ||
|
||
@ContainerSmokeTest | ||
void deployModelAndStartInstance() { | ||
// given | ||
final BpmnModelInstance processModel = | ||
Bpmn.createExecutableProcess("smoke").startEvent().endEvent().done(); | ||
try (final var client = cluster.newClientBuilder().build()) { | ||
// when | ||
final DeploymentEvent deploymentEvent = | ||
client | ||
.newDeployResourceCommand() | ||
.addProcessModel(processModel, "smoke.bpmn") | ||
.send() | ||
.join(); | ||
final ProcessInstanceResult processInstanceResult = | ||
client | ||
.newCreateInstanceCommand() | ||
.bpmnProcessId("smoke") | ||
.latestVersion() | ||
.withResult() | ||
.send() | ||
.join(); | ||
|
||
// then | ||
assertThat(processInstanceResult.getProcessDefinitionKey()) | ||
.isEqualTo(deploymentEvent.getProcesses().get(0).getProcessDefinitionKey()); | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
qa/integration-tests/src/test/java/io/camunda/zeebe/it/smoke/ContainerSmokeTest.java
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,25 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.1. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.1. | ||
*/ | ||
package io.camunda.zeebe.it.smoke; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
import org.junit.jupiter.api.Tag; | ||
|
||
/** | ||
* {@code @ContainerSmokeTest} is used to signal that the annotated method is a container based | ||
* smoke test case, a special kind of {@link @SmokeTest} that verifies the system running within | ||
* containers. | ||
*/ | ||
@Target({ElementType.TYPE, ElementType.METHOD}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Tag("container") | ||
@SmokeTest | ||
public @interface ContainerSmokeTest {} |
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