aboutsummaryrefslogtreecommitdiff
path: root/python/tests
Commit message (Collapse)AuthorAgeFilesLines
* Remove flags that enable the new python path behaviorCole Faust2022-10-213-3/+0
| | | | | | | | | The new behavior has been enabled by default, and these flags aren't necessary anymore. Fixes: 245583294 Test: m py_dont_import_folder_of_entrypoint_test && /ssd/aosp-master/out/host/linux-x86/testcases/py_dont_import_folder_of_entrypoint_test/x86_64/py_dont_import_folder_of_entrypoint_test Change-Id: I5b6f98da51791bc5d28662ef799a10c1bb6a35a0
* [LSC] Add LOCAL_LICENSE_KINDS to build/soongBob Badour2022-09-292-0/+8
| | | | | | | | | | | | | Added SPDX-license-identifier-Apache-2.0 to: python/tests/dont_import_folder_of_entrypoint/Android.bp python/tests/top_level_dirs/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Change-Id: I7a1ea160c685361318f9a8543e10b83eeb9dcb7f
* Add binary properties to python_defaults and add modern_python_path_defaultsCole Faust2022-09-261-2/+1
| | | | | | | | | | | | | So that we can more easily enable these new flags on several modules. It seems you can still apply a python_defaults to a python_library even with this change, so I didn't break it out into a separate python_binary_defaults. Bug: 245583294 Test: m py_dont_import_folder_of_entrypoint_test && out/host/linux-x86/testcases/py_dont_import_folder_of_entrypoint_test/x86_64/py_dont_import_folder_of_entrypoint_test Change-Id: Iecf9c1845df4630bafdea9957eb2450c15f8596b
* Add flag to not add directory of entrypoint to sys.pathCole Faust2022-09-263-0/+39
| | | | | | | | | | | | | | | | | | | | The python interpreter will by default add the directory of the entrypoint script to the beginning of sys.path. This can be disabled in python 3.11+ (which is not released yet) using the PYTHON_SAFE_PATH environment variable or the -P flag. As a workaround to have this behavior in older python versions, we can make an __soong_entrypoint_redirector__.py file at the root of the zip file that is the entrypoint, and then that file will redirect to the real entrypoint. This brings non-embedded-launcher python modules closer to the embedded launcher version. The embedded launcher binaries already act like this because they start at an __main__.py file at the root of the zip file. Bug: 245583294 Test: m py_dont_import_folder_of_entrypoint_test && out/host/linux-x86/nativetest64/py_dont_import_folder_of_entrypoint_test/py_dont_import_folder_of_entrypoint_test Change-Id: I39aaf04fb19c3ba7f5c9d98220872d6d08abf736
* Merge "Add flag to not add top-level modules to PYTHONPATH"Cole Faust2022-09-263-0/+26
|\
| * Add flag to not add top-level modules to PYTHONPATHCole Faust2022-09-233-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | stub_template_host.txt added all the top-level modules to the PYTHONPATH, which isn't correct, and caused absl.logging to override the built-in logging module. Removing this also makes it more consistent with python binaries built with embedded_launcher: true. embedded_launcher: true binaries don't add the top-level modules. Fixes: 245583294 Test: m py_dont_add_top_level_dirs_test && out/host/linux-x86/testcases/py_dont_add_top_level_dirs_test/x86_64/py_dont_add_top_level_dirs_test Change-Id: Id3069565d2b2c4b2bda0ff5301e757a7b4201751
* | [LSC] Add LOCAL_LICENSE_KINDS to build/soongBob Badour2022-09-221-0/+4
|/ | | | | | | | | | | | Added SPDX-license-identifier-Apache-2.0 to: python/tests/proto_pkg_path/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Change-Id: I17e9945a265d0ede3e291ed6f5d410dde035fbe5
* Make protobufs respect pkg_path properlyCole Faust2022-09-204-0/+44
| | | | | | | | | | | | | | | | | | | | | | | Currently, python protobuf sources are generated as if pkg_path didn't exist, but then are moved into the pkg_path directory after being generated. This means they're generated with import statements in them that don't include the pkg_path. These import statements won't work at all when pkg_path is at least 2 levels deep, but currently erroneously work with a 1 level deep pkg_path because we mistakenly add the top-level modules in a soong-built python zip to the PYTHONPATH. We want to remove those modules from the PYTHONPATH, so the generated protobuf source files have to use the correct imports. Since there are existing cases of code that needs to be updated, guard this new behavior behind a flag, protos_respect_pkg_path. We will set this to true on modules individually as we update them, and then eventually change the default to true and remove this flag. Bug: 247578564 Test: m py_proto_pkg_path_test && out/host/linux-x86/nativetest64/py_proto_pkg_path_test/py_proto_pkg_path_test Change-Id: I3695cf5521837da087592f2ad5350201035b7b0e
* Mark par_test as not unit testsJulien Desprez2021-04-201-2/+8
| | | | | | | | | They seem to be used as Soong validation. They are not implemented against the python unit tests framework, so we can execute them as such in CI automatically. Change-Id: I8fe662d5d3399d60c8a05acc79b4dd51b5d138a6 Test: presubmit Bug: 183730987
* Add LOCAL_LICENSE_KINDS to build/soongBob Badour2021-02-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added SPDX-license-identifier-Apache-2.0 to: Android.bp android/Android.bp android/soongconfig/Android.bp androidmk/Android.bp apex/Android.bp bazel/Android.bp bp2build/Android.bp bpf/Android.bp bpfix/Android.bp cc/Android.bp cc/config/Android.bp cc/libbuildversion/Android.bp cc/libbuildversion/tests/Android.bp cc/ndk_api_coverage_parser/Android.bp cc/ndkstubgen/Android.bp cc/symbolfile/Android.bp cmd/dep_fixer/Android.bp cmd/diff_target_files/Android.bp cmd/extract_apks/Android.bp cmd/extract_jar_packages/Android.bp cmd/extract_linker/Android.bp cmd/fileslist/Android.bp cmd/host_bionic_inject/Android.bp cmd/javac_wrapper/Android.bp cmd/merge_zips/Android.bp cmd/multiproduct_kati/Android.bp cmd/path_interposer/Android.bp cmd/pom2bp/Android.bp cmd/pom2mk/Android.bp cmd/sbox/Android.bp cmd/soong_build/Android.bp cmd/soong_env/Android.bp cmd/soong_ui/Android.bp cmd/zip2zip/Android.bp cmd/zipsync/Android.bp cuj/Android.bp dexpreopt/Android.bp dexpreopt/dexpreopt_gen/Android.bp env/Android.bp etc/Android.bp filesystem/Android.bp finder/Android.bp finder/cmd/Android.bp genrule/Android.bp jar/Android.bp java/Android.bp java/config/Android.bp kernel/Android.bp linkerconfig/Android.bp linkerconfig/proto/Android.bp makedeps/Android.bp partner/Android.bp phony/Android.bp python/Android.bp python/tests/Android.bp remoteexec/Android.bp rust/Android.bp rust/config/Android.bp scripts/Android.bp sdk/Android.bp sh/Android.bp shared/Android.bp symbol_inject/Android.bp symbol_inject/cmd/Android.bp sysprop/Android.bp tradefed/Android.bp ui/build/Android.bp ui/logger/Android.bp ui/metrics/Android.bp ui/metrics/proc/Android.bp ui/status/Android.bp ui/terminal/Android.bp ui/tracer/Android.bp xml/Android.bp zip/Android.bp zip/cmd/Android.bp Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to: finder/fs/Android.bp third_party/zip/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: Ia47ca14f16b8c9f84f9d533a07e5b00e2c04e8d4
* Add tests for py(2|3)-cmdDan Willemsen2020-02-194-2/+127
| | | | | Test: m par_test{,3} py{2,3}-cmd; ./runtest.sh Change-Id: I4aadd9fc85be4381bd9a0843064ceaa87150b5ee
* Test par file argument handlingDan Willemsen2019-12-032-0/+11
| | | | | | | This had been broken with my python3 launcher. Test: build/soong/python/tests/runtest.sh Change-Id: I0524e5a80244bf1080cb28237b23ef0d023e03dc
* Add python3 embedded launcher supportDan Willemsen2019-11-043-3/+29
| | | | | Test: m par_test{,3}; build/soong/python/tests/runtest.sh Change-Id: I9c0fac9e2947616fdeedbfc55026dc3065966e71
* Add par_testDan Willemsen2019-02-144-0/+158
This test adds a number of checks for the visible python state inside a hermetic par file. Test: build/soong/python/tests/runtests.sh Change-Id: I7188d862a309a09623169e1f967bde86707d41af