-
Notifications
You must be signed in to change notification settings - Fork 121
Convert python wheel tests to acceptance #2396
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
cb5d4d6 to
18515e8
Compare
a74be26 to
db270e3
Compare
852e8ec to
db270e3
Compare
a8d2479 to
916021c
Compare
270677e to
be7b6a9
Compare
60c5697 to
fe50cb1
Compare
pietern
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.
LGTM
Leaving the stamp of approval to @andrewnester.
|
|
||
| if args.expect is not None: | ||
| if args.expect != len(result): | ||
| sys.exit(f"Expected {args.expect}, got {len(result)}") |
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.
The inclusion of an expectation in this command feels off.
Could we compose this with a function/command/helper that asserts on the number of lines in an output?
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.
Well, this is not a generic command, this is an acceptance test helper. Given its narrow context, I think it's okay.
If we see more use cases where a separate line-counting script would makes things simpler, we can always extract that.
| type: whl | ||
| path: "./my_test_code" | ||
| build: "python3 setup.py bdist_wheel" | ||
| build: python setup.py bdist_wheel |
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.
Is python3 not aliased?
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.
There is no 'python3' in virtualenv on Windows (as we learned in #2034).
| Deployment complete! | ||
| Updating deployment state... | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/python-wheel/default/files... | ||
| Uploading my_test_code-0.0.1-py3-none-any.whl... |
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.
The order is a bit confusing now, shall we do the package name replacement instead in these lines and then the output will be determenistic?
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 agree it's not ideal. I see this as -- we record a set of steps to be taken, ignoring the order.
do the package name replacement
I'd rather see the names, given that we focus on multiple wheels being supported there. If we replace both, we won't catch situation if it uploaded one wheel twice instead of two separate wheels once.
Changes
Rewrite bundle/tests/python_wheel_test.go into acceptance tests. The same configs are used, but the test now runs 'bundle deploy' and in addition to checking the files on the file system, also checks that the files were uploaded and records jobs/create request.
There is a new test helper bin/find.py which filters out paths based on regex, asserts on number of expected results. I've added it because 'find' on Windows behaves differently, so this helps avoid cross-platform differences.