-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-6907] Simply test setup by reusing Python tarball in tox & dataflow integration tests #9277
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
Conversation
| def cmdArgs = project.mapToArgString([ | ||
| "test_opts": testOpts, | ||
| "sdk_location": "${project.buildDir}/apache-beam.tar.gz", | ||
| "sdk_location": files(configurations.distTarBall.files).singleFile, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line actually can be removed for all similar integration tests sine the default sdk_location (defined in run_integration_test.sh) is pointing to the correct location. However, I left it here since people who read this configuration will know how it's set and related to :sdks:python:sdist. I'm open to discussion if you think it can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am ok to keep this. It feels like there may be a shorter way to reference the file defined by this configuration. Did you try configurations.distTarBall? Somehow it seems to work in
beam/sdks/python/container/build.gradle
Line 46 in 28a4057
| from configurations.sdkSourceTarball |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid not. We need full path of this tarball, but configurations.distTarBall returns a string configuration ':sdks:python:test-suites:dataflow:py2:distTarBall'
|
Run Python Dataflow ValidatesRunner |
|
Glad to see I'll go ahead to fix tox broken and also run postcommit. |
|
beam_PreCommit_Python_Commit #7937 passed. Tox tests are fixed. |
|
Run Python 2 PostCommit |
|
Run Python 3.7 PostCommit |
fd2892d to
89ff650
Compare
tvalentyn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @markflyhigh !
| project.exec { | ||
| executable 'sh' | ||
| args '-c', ". ${project.ext.envdir}/bin/activate && cd ${copiedPyRoot} && scripts/run_tox.sh $tox_env ${project.buildDir}/apache-beam.tar.gz" | ||
| args '-c', ". ${project.ext.envdir}/bin/activate && cd ${copiedPyRoot} && scripts/run_tox.sh $tox_env $distTarBall" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this PR - do you remember why do we pass a tarball to tox suite? It looks like we started doing that with #8067.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tox will build tarball for venv install automatically if not provided. This build depends on shared file when running in parallel and cause our test flaky. So we prebuild the tarball and pass it from --installpkg flag to avoid that issue.
| def cmdArgs = project.mapToArgString([ | ||
| "test_opts": testOpts, | ||
| "sdk_location": "${project.buildDir}/apache-beam.tar.gz", | ||
| "sdk_location": files(configurations.distTarBall.files).singleFile, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am ok to keep this. It feels like there may be a shorter way to reference the file defined by this configuration. Did you try configurations.distTarBall? Somehow it seems to work in
beam/sdks/python/container/build.gradle
Line 46 in 28a4057
| from configurations.sdkSourceTarball |
| // Set run order for basic tasks. | ||
| // This should be called after applyPythonNature() since TaskContainer | ||
| // requires task instances created first before setting the order. | ||
| project.ext.setTaskOrder = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... this feels a bit hacky. setupVirtualEnv is already in dependsOn of installGcpTest.
As for sdks:python:sdist, is it possible to add a dependency on distTarBall configuration instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, set setupVirtualenvrun after installGcpTest is not required in here. The main purpose is to set installGcpTest run after sdks:python:sdist in each project.
I don't know if depend on distTarBall will work or not but worth to try, so that we may be able to get rid of setTaskOrder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we can do installGcpTest.mustRunAfter configurations.distTarBall. This build shows correct run order. I'll go ahead and change the code.
89ff650 to
b3c2915
Compare
|
Run Python 2 PostCommit |
|
Java PreCommit failure is not related to this change. Tests are done. PTAL @tvalentyn |
|
LGTM, thanks a lot, @markflyhigh. Please run all test suites that were affected by this change before merging, I would suggest to merge this change on green and give @lukecwik a heads-up since Luke is looking into test heath ATM. |
|
Run Python PreCommit |
|
Run Python 3.7 PostCommit |
|
+cc: @lukecwik |
|
Rerun Python37_PostCommit #17 and Python_PreCommit #738, and they all passed. |
|
Run Java PreCommit |
|
Run Python 2 PostCommit |
Building Python tarball concurrently in each test suite caused race condition and make postcommit flaky (see BEAM-7527).
This change let Python tarball built once by
sdks:python:sdistand then used in everywhere. So in order to use this tarball in other projects, tests/other tasks needs to depends onsdks:python:sdistand projects can usedependenciesto referencedistTarBallfromsdks:pythonconfigurations.Tests are needed especially Dataflow VR tests which is affected by the build race condition.
+R: @tvalentyn
Update:
beam_PostCommit_Py_VR_Dataflow_PR #119 is done.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username).[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.