Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Docker dependency from Maven testing #102

Closed
lazar-mitrovic opened this issue Jul 9, 2021 · 1 comment · Fixed by #103
Closed

Remove Docker dependency from Maven testing #102

lazar-mitrovic opened this issue Jul 9, 2021 · 1 comment · Fixed by #103
Labels
enhancement New feature or request

Comments

@lazar-mitrovic
Copy link
Collaborator

ATM we are using Docker to create layered images in order to have a reproducible builds for testing the Maven plugin.
See the rationale behind this decision here, and related discussion here.

This is creating an overhead by fetching an entire docker image with a duplicate GraalVM installation, a loads of additional logic related to Gradle <-> Docker interaction, but the biggest problem is that it limits Maven testing to Linux (since guest Docker image will always be Linux based).

I propose that whole Docker related part gets removed and replaced with Groovy / Kotlin logic which would invoke mvnw to download separate maven installation, custom settings.xml and environment variables which would change .m2 location, and a "folder-juggling" mechanism to simulate repository caching between each run.

I'll work on PoC for this and link it to this issue as soon as it's ready.

@melix
Copy link
Collaborator

melix commented Jul 12, 2021

One important aspect of this is to make sure that the locally built artifacts are fetched from a local repository which wouldn't get polluted by Maven. In other words, we should preserve the fact that we have a local repository which contains artifacts produced by this build (the common libraries and the Maven plugin), behaving like a remote repository and not like the local m2 cache.

Then we should have a local m2 cache which is pre-populated, but restorable in a state where those libraries are not found in the cache when a test starts. This should give us relative confidence that the plugin is working correctly, not perfect isolation but not having the Docker overhead.

melix added a commit to melix/native-build-tools that referenced this issue Jul 13, 2021
This commit reworks functional testing of the Maven plugin by executing
Maven in a sandbox, isolated "as much as possible". We cannot, unfortunately,
make sure that it's fully isolated but the following steps were taken:

- the libraries published by this repository are published in the "common"
repository
- the external dependencies required for functional testing are seeded into
another, shared repository
- when tests are executed, a local repository is set so that dependencies
are copied into that repository rather than using the local m2 repository

This should make functional testing faster and fix the problem that the
Maven plugin couldn't be tested on something else than Linux.

Fixes graalvm#102
lazar-mitrovic pushed a commit that referenced this issue Jul 13, 2021
This commit reworks functional testing of the Maven plugin by executing
Maven in a sandbox, isolated "as much as possible". We cannot, unfortunately,
make sure that it's fully isolated but the following steps were taken:

- the libraries published by this repository are published in the "common"
repository
- the external dependencies required for functional testing are seeded into
another, shared repository
- when tests are executed, a local repository is set so that dependencies
are copied into that repository rather than using the local m2 repository

This should make functional testing faster and fix the problem that the
Maven plugin couldn't be tested on something else than Linux.

Fixes #102
lazar-mitrovic pushed a commit that referenced this issue Jul 13, 2021
This commit reworks functional testing of the Maven plugin by executing
Maven in a sandbox, isolated "as much as possible". We cannot, unfortunately,
make sure that it's fully isolated but the following steps were taken:

- the libraries published by this repository are published in the "common"
repository
- the external dependencies required for functional testing are seeded into
another, shared repository
- when tests are executed, a local repository is set so that dependencies
are copied into that repository rather than using the local m2 repository

This should make functional testing faster and fix the problem that the
Maven plugin couldn't be tested on something else than Linux.

Fixes #102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants