Skip to content

Conversation

@lhotari
Copy link
Member

@lhotari lhotari commented Feb 19, 2021

Motivation

The feedback loop in fixing and debugging integration tests is extremely slow at the moment because of the long time to build the pulsar-test-latest-version docker image and the images pulsar and pulsar-all that it depends on.

Introduce a slim docker image which can run most integration tests.

Modifications

Adds a maven module for building java-test-image.
Produces a relatively slim 750MB image (+461MB to base image) which doesn't
depend on building pulsar and pulsar-all images like the current pulsar-test-latest-version image.
Image doesn't include CPP client, Python client, Pulsar SQL or Pulsar Connectors since most integration tests don't require those.

Enables a lot quicker feedback loop when debugging and fixing integration tests
locally since building the image takes less than 1.5 minutes on a modern laptop.

Adding this image is also a preparation for speeding up CI where this slim image would be used to run the "core" integration tests which don't require CPP client, Python client, Pulsar SQL or Pulsar Connectors.

Usage example to run single CLI integration test method against java-test-image:

./build/build_java_test_image.sh
export PULSAR_TEST_IMAGE_NAME=apachepulsar/java-test-image:latest
mvn -B -f tests/pom.xml test -DintegrationTests -DredirectTestOutputToFile=false -DtestRetryCount=0 -DfailIfNoTests=false -Dtest=CLITest#testCreateSubscriptionCommand

Adds changes to the integration test infrastructure so that the name of the docker image to use can be passed in PULSAR_TEST_IMAGE_NAME environment variable.

In addition, adds skipSourceReleaseAssembly maven property which can be used to skip building the apache-pulsar-*-src.tar.gz when it's not needed. This is to speed up building of the docker image. It's used in the provided build/build_java_test_image.sh script.

- Doesn't include CPP client, Python client, Pulsar SQL or Pulsar Connectors

- Produces a relatively slim 750MB image (+461MB to base image) which doesn't
  depend on building pulsar and pulsar-all images like the current
  pulsar-test-latest-version image

- Enables a lot quicker feedback loop when debugging and fixing integration tests
  locally since building the image takes less than 1.5 minutes on a modern laptop
- using this image is also a preparation for speeding up CI
  where this slim image would be used to run the "core" integration tests
  which don't require CPP client, Python client, Pulsar SQL or Pulsar Connectors

- Usage example to run single CLI integration test method against java-test-image:
  ./build/build_java_test_image.sh
  export PULSAR_TEST_IMAGE_NAME=apachepulsar/java-test-image:latest
  mvn -B -f tests/pom.xml test -DintegrationTests -DredirectTestOutputToFile=false -DtestRetryCount=0 -DfailIfNoTests=false -Dtest=CLITest#testCreateSubscriptionCommand
@lhotari lhotari force-pushed the lh-add-slim-java-test-image branch from 24c05b8 to 9c1e27a Compare February 19, 2021 07:52
@zymap zymap added this to the 2.8.0 milestone Feb 19, 2021
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@zymap zymap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be wonderful if you can paste your PR's description into the test README.md.

@sijie sijie merged commit b472978 into apache:master Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants