-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
experiment/generate_tests - upgrade py2 -> py3 #13784
experiment/generate_tests - upgrade py2 -> py3 #13784
Conversation
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.
Can't get this to work locally, is this a problem with my setup?
With bazel:
spiffxp@spiffxp-macbookpro:test-infra (experiment-generate_tests %)$ bazel run //experiment:generate_tests -- --yaml-config-path=experiment/test_config.yaml
DEBUG: /private/var/tmp/_bazel_spiffxp/7630f8dce3b74fcdbfbd9bad8e6632e4/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:256:5: rbe_default is using checked-in configs 'struct(config_repos = [], create_cc_configs = True, create_java_configs = True, env = {"ABI_LIBC_VERSION": "glibc_2.19", "ABI_VERSION": "clang", "BAZEL_COMPILER": "clang", "BAZEL_HOST_SYSTEM": "i686-unknown-linux-gnu", "BAZEL_TARGET_CPU": "k8", "BAZEL_TARGET_LIBC": "glibc_2.19", "BAZEL_TARGET_SYSTEM": "x86_64-unknown-linux-gnu", "CC": "clang", "CC_TOOLCHAIN_NAME": "linux_gnu_x86"}, java_home = "/usr/lib/jvm/java-8-openjdk-amd64", name = "9.0.0")'
INFO: Analyzed target //experiment:generate_tests (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //experiment:generate_tests up-to-date:
bazel-bin/experiment/generate_tests
INFO: Elapsed time: 0.585s, Critical Path: 0.37s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
Traceback (most recent call last):
File "/private/var/tmp/_bazel_spiffxp/7630f8dce3b74fcdbfbd9bad8e6632e4/execroot/io_k8s_test_infra/bazel-out/darwin-fastbuild/bin/experiment/generate_tests.runfiles/io_k8s_test_infra/experiment/generate_tests.py", line 388, in <module>
ARGS.testgrid_output_path)
File "/private/var/tmp/_bazel_spiffxp/7630f8dce3b74fcdbfbd9bad8e6632e4/execroot/io_k8s_test_infra/bazel-out/darwin-fastbuild/bin/experiment/generate_tests.runfiles/io_k8s_test_infra/experiment/generate_tests.py", line 361, in main
output_dir, job_name, yaml_config['jobs'][job_name], yaml_config)
File "/private/var/tmp/_bazel_spiffxp/7630f8dce3b74fcdbfbd9bad8e6632e4/execroot/io_k8s_test_infra/bazel-out/darwin-fastbuild/bin/experiment/generate_tests.runfiles/io_k8s_test_infra/experiment/generate_tests.py", line 330, in for_each_job
job_config, prow_config, testgrid_config = generator.generate()
File "/private/var/tmp/_bazel_spiffxp/7630f8dce3b74fcdbfbd9bad8e6632e4/execroot/io_k8s_test_infra/bazel-out/darwin-fastbuild/bin/experiment/generate_tests.runfiles/io_k8s_test_infra/experiment/generate_tests.py", line 181, in generate
args.extend(get_args(self.job_name, self.common))
File "/private/var/tmp/_bazel_spiffxp/7630f8dce3b74fcdbfbd9bad8e6632e4/execroot/io_k8s_test_infra/bazel-out/darwin-fastbuild/bin/experiment/generate_tests.runfiles/io_k8s_test_infra/experiment/generate_tests.py", line 82, in get_args
return substitute(job_name, field.get('args', []))
File "/private/var/tmp/_bazel_spiffxp/7630f8dce3b74fcdbfbd9bad8e6632e4/execroot/io_k8s_test_infra/bazel-out/darwin-fastbuild/bin/experiment/generate_tests.runfiles/io_k8s_test_infra/experiment/generate_tests.py", line 76, in substitute
for line in lines]
File "/private/var/tmp/_bazel_spiffxp/7630f8dce3b74fcdbfbd9bad8e6632e4/execroot/io_k8s_test_infra/bazel-out/darwin-fastbuild/bin/experiment/generate_tests.runfiles/io_k8s_test_infra/experiment/generate_tests.py", line 76, in <listcomp>
for line in lines]
File "/private/var/tmp/_bazel_spiffxp/7630f8dce3b74fcdbfbd9bad8e6632e4/execroot/io_k8s_test_infra/bazel-out/darwin-fastbuild/bin/experiment/generate_tests.runfiles/io_k8s_test_infra/experiment/generate_tests.py", line 69, in get_sha1_hash
sha1_hash.update(data)
TypeError: Unicode-objects must be encoded before hashing
Without bazel:
spiffxp@spiffxp-macbookpro:test-infra (experiment-generate_tests %)$ python --version
Python 3.7.4
spiffxp@spiffxp-macbookpro:test-infra (experiment-generate_tests %)$ ./experiment/generate_tests.py --yaml-config-path=experiment/test_config.yaml
Traceback (most recent call last):
File "./experiment/generate_tests.py", line 388, in <module>
ARGS.testgrid_output_path)
File "./experiment/generate_tests.py", line 361, in main
output_dir, job_name, yaml_config['jobs'][job_name], yaml_config)
File "./experiment/generate_tests.py", line 330, in for_each_job
job_config, prow_config, testgrid_config = generator.generate()
File "./experiment/generate_tests.py", line 181, in generate
args.extend(get_args(self.job_name, self.common))
File "./experiment/generate_tests.py", line 82, in get_args
return substitute(job_name, field.get('args', []))
File "./experiment/generate_tests.py", line 76, in substitute
for line in lines]
File "./experiment/generate_tests.py", line 76, in <listcomp>
for line in lines]
File "./experiment/generate_tests.py", line 69, in get_sha1_hash
sha1_hash.update(data)
TypeError: Unicode-objects must be encoded before hashing
3dc865a
to
a72e112
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: clarketm The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Additional conversions for python2 -> python3 ( #13164 ) migration and targets
experiment/generate_tests
.