Skip to content

Commit

Permalink
Run cruise-control tests for s390x architecture
Browse files Browse the repository at this point in the history
The extenstion to the current CircleCI setup allows to run the
cruise-control tests for non-Intel architectures. As first step
linux/s390x platform is used. New platforms can be added to the
existing matrix, once there is interest for it.

The idea is to run docker container on standard Intel host via standard
CirclCI setup in hardware emulation mode via dockere --platform parameter
and do the tests inside the container, similar to how it can be executed
on real ARM, Power or Z hardware. To make sure which architecture is emulated
inside the container - `uname -a` command is executed before the actual test.

Signed-off-by: Yulia Gaponenko <yulia.gaponenko1@de.ibm.com>
  • Loading branch information
barthy1 committed Nov 17, 2021
1 parent 1290039 commit 79898e8
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions .circleci/config.yml
@@ -1,7 +1,38 @@
version: 2
version: 2.1

jobs:

test-multi-arch:
parameters:
platform:
type: string
environment:
_JAVA_OPTIONS: "-Xms512m -Xmx1g"
DOCKER_CLI_EXPERIMENTAL: "enabled"
working_directory: ~/workspace
machine:
image: ubuntu-2004:202107-02
steps:
- checkout
- run: |
# install required qemu libraries
docker run --rm --privileged tonistiigi/binfmt:latest --install all
# run docker container with qemu emulation
docker run --rm \
--platform << parameters.platform >> \
--name qemu-cross-<< parameters.platform >> \
--mount type=bind,source=${PWD},target=/github_workspace \
--workdir /github_workspace \
<< parameters.platform >>/eclipse-temurin:11-jdk-focal uname -a; ./gradlew --no-daemon -PmaxParallelForks=1 build
- run:
command: mkdir ~/test-results
- run:
command: find ~/workspace -type f -regex ".*/test-results/.*xml" -exec ln {} ~/test-results/ \;
- store_test_results:
path: ~/test-results
- store_artifacts:
path: ~/test-results

build:
environment:
_JAVA_OPTIONS: "-Xms512m -Xmx1g"
Expand Down Expand Up @@ -46,16 +77,24 @@ jobs:
command: ./gradlew :artifactoryPublish :cruise-control:artifactoryPublish :cruise-control-core:artifactoryPublish :cruise-control-metrics-reporter:artifactoryPublish

workflows:
version: 2
version: 2.1
build-and-publish:
jobs:
- test-multi-arch:
matrix:
parameters:
platform: ["s390x"]
filters:
tags:
only: /.*/
- build:
filters:
tags:
only: /.*/
- publish:
requires:
- build
- test-multi-arch
filters:
branches:
ignore: /.*/
Expand Down

0 comments on commit 79898e8

Please sign in to comment.