Skip to content

Commit

Permalink
test the connector runtime in "real-life" (#478)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency io.camunda:zeebe-bom to v8.6.3

* always check image on build

* add another check step

* added clean exit after successful start

* timeout if something fails

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Lukas <[email protected]>
  • Loading branch information
renovate[bot] and jonathanlukas authored Oct 16, 2024
1 parent 0e6708b commit fb5364e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: mvn verify -PcheckFormat -Pbuild-image -B
- name: check docker compose
run: docker compose -f docker/docker-compose.yml up
- uses: adambirds/[email protected]
name: start docker compose
with:
compose-file: "./docker/docker-compose.yml"
test-command: "java -jar runtime/target/script-connector-runtime.jar test"
- name: try to run connector runtime
run: java -jar runtime/target/script-connector-runtime.jar test
timeout-minutes: 1
- name: Publish Unit Test Results
id: publish
uses: EnricoMi/publish-unit-test-result-action@v2
Expand Down
24 changes: 22 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "2"

networks:
zeebe_network:
driver: bridge
Expand All @@ -15,16 +13,30 @@ services:
- "9600:9600"
networks:
- zeebe_network
healthcheck:
test: [ "CMD-SHELL", "timeout 10s bash -c ':> /dev/tcp/127.0.0.1/9600' || exit 1" ]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
script-connector-runtime:
container_name: script-connector-runtime
image: ghcr.io/camunda-community-hub/script-connector/runtime:latest
environment:
- ZEEBE_CLIENT_BROKER_GATEWAY-ADDRESS=zeebe:26500
- ZEEBE_CLIENT_SECURITY_PLAINTEXT=true
- management.endpoints.web.exposure.include=health
- management.endpoint.health.probes.enabled=true
depends_on:
- zeebe
networks:
- zeebe_network
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:8080/actuator/health/readiness" ]
interval: 30s
timeout: 1s
retries: 5
start_period: 30s
script-connector-bundled:
container_name: script-connector-bundled
image: camunda/connectors-bundle:8.6.2
Expand All @@ -35,10 +47,18 @@ services:
- CAMUNDA_CONNECTOR_WEBHOOK_ENABLED=false
- SPRING_MAIN_WEB-APPLICATION-TYPE=none
- OPERATE_CLIENT_ENABLED=false
- management.endpoints.web.exposure.include=health
- management.endpoint.health.probes.enabled=true
depends_on:
- zeebe
networks:
- zeebe_network
volumes:
- ./../connector/target/script-connector-1.2.1-SNAPSHOT-shaded.jar:/opt/custom/script-connector.jar
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:8080/actuator/health/readiness" ]
interval: 30s
timeout: 1s
retries: 5
start_period: 30s

1 change: 1 addition & 0 deletions runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
</dependency>
</dependencies>
<build>
<finalName>${artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package io.camunda.community.connector.script;

import java.util.Arrays;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
if (Arrays.asList(args).contains("test")) {
System.exit(0);
}
}
}
5 changes: 4 additions & 1 deletion runtime/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ camunda:
enabled: false
webhook:
enabled: false

zeebe:
client:
security:
plaintext: true

0 comments on commit fb5364e

Please sign in to comment.