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

Run contrib unit tests with `--chroot` #8084

Merged
merged 9 commits into from Aug 19, 2019

Conversation

@Eric-Arellano
Copy link
Contributor

commented Jul 21, 2019

This is pre-work for being able to remote all Python tests. --chroot (i.e. change root) means that tests will execute in a mostly hermitic directory, rather than in the actual buildroot. This reflects how V2 works.

This implements part of #7281, particularly for contrib unit tests. A followup PR will land integration tests using --chroot.

In the process, we tweak the blacklist strategy as follows:

  • The progression goes from --no-chroot V1 -> --chroot V1 -> local V2 -> remote V2, where remote V2 is our ultimate goal.
  • By default, we assume unit tests are at the remote V2 stage and integration tests are at the --no-chroot V1 stage.
  • Contrib unit tests are no longer special cased, meaning that because they are unit tests they default to remote V2. However, they don't work yet, so we put them on the corresponding blacklists for however far along the progression that target is. This change allows us to have a path forward to remoting contrib unit tests.

@Eric-Arellano Eric-Arellano force-pushed the Eric-Arellano:chroot branch from e64f049 to d877737 Aug 17, 2019

@Eric-Arellano Eric-Arellano changed the title WIP: Run all CI tests with `--chroot` Run most integration tests with `--chroot` Aug 17, 2019

@@ -5,6 +5,7 @@
import subprocess
import sys
from contextlib import contextmanager
from pathlib import Path

This comment has been minimized.

Copy link
@Eric-Arellano

Eric-Arellano Aug 17, 2019

Author Contributor

This file is a refactor to make it easier to eventually get this working with --chroot. Should be same functionality.

@Eric-Arellano Eric-Arellano force-pushed the Eric-Arellano:chroot branch from d877737 to bae6792 Aug 17, 2019

@Eric-Arellano Eric-Arellano marked this pull request as ready for review Aug 17, 2019

Re-approach blacklist handling of contrib unit tests.
All unit tests are now attempted to be ran with remoting, followed by V2, followed by --chroot V1, followed by --no-chroot V1. The strategy is solely a function of whether the target appears in a particular blacklist. Previously, we always treated contrib unit tests as --no-chroot V1 but now they're getting merged into this blacklist scheme.
@@ -50,8 +50,9 @@ def rc(cls, value):
@classmethod

This comment has been minimized.

Copy link
@Eric-Arellano

Eric-Arellano Aug 17, 2019

Author Contributor

No changes in this file beyond f-strings.

pants.ini Outdated Show resolved Hide resolved
@@ -0,0 +1,34 @@
contrib/avro/tests/python/pants_test/contrib/avro/tasks:avro_java_gen

This comment has been minimized.

Copy link
@Eric-Arellano

Eric-Arellano Aug 17, 2019

Author Contributor

As described in PR description, we no longer special case contrib unit tests and they are now tied into the blacklist mechanism. This allows us to make more progress on getting them remoted.

@Eric-Arellano Eric-Arellano changed the title Run most integration tests with `--chroot` Run contrib unit tests and most integration tests with `--chroot` Aug 17, 2019

@Eric-Arellano Eric-Arellano changed the title Run contrib unit tests and most integration tests with `--chroot` Run contrib unit tests with `--chroot` Aug 18, 2019

@Eric-Arellano

This comment has been minimized.

Copy link
Contributor Author

commented Aug 18, 2019

I reduced the scope of this PR to only chroot contrib unit tests because we need to make a semi-breaking change to chroot integration tests and I want to keep that in a dedicated PR.

The main contribution of this PR becomes

  1. Getting contrib unit tests on track for V2 and remoting
  2. Defining the pathway from --no-chroot V1 up to V2 remote, as defined in PR description. Also provides infrastructure to achieve this via blacklists.
@stuhood
Copy link
Member

left a comment

Thanks!

@stuhood stuhood merged commit da0989f into pantsbuild:master Aug 19, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Eric-Arellano Eric-Arellano deleted the Eric-Arellano:chroot branch Aug 19, 2019

patliu85 added a commit to twitter/pants that referenced this pull request Aug 20, 2019
Run contrib unit tests with `--chroot` (pantsbuild#8084)
This is pre-work for being able to remote all Python tests. `--chroot` (i.e. `change root`) means that tests will execute in a mostly hermitic directory, rather than in the actual buildroot. This reflects how V2 works.
 
This implements part of pantsbuild#7281, particularly for contrib unit tests. A followup PR will land integration tests using `--chroot`.

In the process, we tweak the blacklist strategy as follows:
* The progression goes from `--no-chroot V1` -> `--chroot V1` -> `local V2` -> `remote V2`, where `remote V2` is our ultimate goal. 
* By default, we assume unit tests are at the `remote V2` stage and integration tests are at the `--no-chroot V1` stage.
* Contrib unit tests are no longer special cased, meaning that because they are unit tests they default to `remote V2`. However, they don't work yet, so we put them on the corresponding blacklists for however far along the progression that target is. This change allows us to have a path forward to remoting contrib unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.