aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
14 daysFix a bug in run_tool_with_logging scriptZhuoyao Zhang
Fix the case when call a tool with run_tool_with_logging with a single arg start with -- (e.g. adb --help), make sure when we pass that arg to the logger, it treat it as the value for the --tool_args option instead of a separate option Test: atest run_tool_with_logging_test Test: manually run source build/envsetup.sh and run adb --help and check the event log is sent to clearcut. Tested with both bash and zsh Bug: 341382247 Change-Id: I1e09907f267b453cb62876e171064daa021e3d91
2024-05-07Remove the ANDROID_ENABLE_TOOL_LOGGING environment variableZhuoyao Zhang
Reduce the number of variables required to toggle logging. This simplifies configuration and usage. Test: atest run_tool_with_logging_test Bug: 331638854 Change-Id: I6f2a820b59a0d1f45aba9ffb3e33e7ace601e9c6
2024-05-02Merge "Add an integration test" into mainZhuoyao Zhang
2024-05-02Add an integration testZhuoyao Zhang
Add a test to verify that the parameters passed from the envsetup.sh function are compatible with the actual tool event logger implementation. Note that this change adds support for extra logger arguments. This enables calling the real logger binary with a 'dry run' flag to avoid actual logging during test execution. Test: atest rul_tool_with_logging_test Bug: 331638854 Change-Id: I6b280c53baae03477d4f52f0084efb1f500bd5d0
2024-04-30"Steal" single value variables in rbc inheritanceCole Faust
This behavior of "stealing" values from parent makefiles is needed to match make. We already had similar behavior for list variables via the __move_items function, but were missing it for single value variables. Test: ./out/rbcrun -mode rbc ./build/make/tests/run.rbc Change-Id: Ib320b9b1cce0224184f585c7a391be1b5353b440
2024-04-19Add Trendy team for the run_tool_with_logging_testZhuoyao Zhang
Test: None Bug: 331638854 Change-Id: I58e74d93428cf6b9d39d37995c8105dfe247d676
2024-04-17Add a facility to log tool invocationsZhuoyao Zhang
Add a function to log the invocation of tools run from the Android build environment. This enables analyzing and optimizing developer flows. Note that there are no tools currently leveraging the logging facility. Logging is also disabled by default and not configured to use any particular logger. Test: atest run_tool_with_logging_test bug: 331638854 Change-Id: I001ba3c6c30b3ffc95d0fdb30ea7178a991c680f
2023-07-05Add test for b failingCole Faust
Because we've introduced bugs before where b doesn't exit with the correct status code when bazel fails. Bug: 289436072 Test: ./build/make/tests/b_tests.sh Change-Id: Ia9cb990c627f7b68636e6277a7c637d62312826d
2023-06-11Make RELEASE_PLATFORM_VERSION a release config flag to set platform version.Joe Onorato
Bug: 282838389 Test: Treehugger Merged-In: Ic6dacbdee7d2408aa8b25b4df59bf9bbc566d747 Change-Id: Ie61a7d986c2b8fe2c16117f6678b9e5a71711647
2023-05-02Fix whitespace in soong_config_set callsCole Faust
In make, soong_config_set uses an $(eval) to set it's value, expanding the value of the soong config variable _before_ evaluating the value. Because of this, make will strip trailing whitespace like it does on regular assignments. Make rbcrun match this behavior. Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: I907e85cdf50f6fac54331c0d1044f0d53bec22ed
2023-03-22Add a test for b builds with --Cole Faust
Using -- to indicate the end of arguments has caused issues multiple times in the past. Test: ./build/make/tests/roboleaf_tests.sh Change-Id: I4aef2f1672b917587dd9a2dbe15934db0b0ae0cd
2023-02-07Make words() work on a list of non-stringsCole Faust
words() attempts to join all the elements of a list and then resplit them to more closely match make. But sometimes, like when calling words() on a product variable, not all of the elements are strings. In that case, just return the list unchanged. Bug: 267407943 Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: I738d0c86c8935f446807cc79623f796e8cae3c01
2023-01-12Merge "Add test for bazel server shutdown/restart"Treehugger Robot
2023-01-05Fix printing variables that have inherit references in themCole Faust
Inherit references (@inherit in make, 1-tuples in starlark) usually appear in list product variables, where they're evaluated before printing. But sometimes they can be copied into a regular global variable, in which case they won't be evaluated before printing. The 1-tuples were failing to print, so adapt them to their make representation before printing. Fixes: 264554449 Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: I5ac6eb996c25ee5e77aa26ed5c4b6b6cc31819d1
2022-12-13Make clear_var_list set nonexistant variables to empty stringsCole Faust
Make's clear-var-list causes the variables to exist as empty strings. Mimic that functionality in starlark for the variable diff and ?=. Bug: 262303006 Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: I5f9c8cf342d875b1022c5c74906e59fa68fcd6c9
2022-12-13Add rbc implementation of clear_var_listCole Faust
Bug: 262303006 Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: Ib5d7d37a7d7fa40ec990d9506fe0bef7da5b5bcd
2022-12-02Add test for bazel server shutdown/restartCole Faust
We recently had an issue where the bazel server couldn't be shutdown/restart because it was being run in a docker container with a PID 1 that wasn't capable of reaping zombie processes. Bug: 234449134 Test: abtd run of this test because it's not run on presubmit Change-Id: I1e179902364ea84fd55003389f3045de2e998991
2022-10-27Call lunch before using b.Jingwen Chen
lunch is required to set up PATH to access build/bazel/bin/b as b. Test: run the test Bug: 255711288 Fixes: 255711288 Change-Id: Ie5bad8ffdacc3d59114f70d7f533486ebd12f778
2022-10-05envsetup: add bmod to get Bazel label of a Soong module.Jingwen Chen
This benefits interactive workflows of folks who are used to typing just module names on the command line, and lowers the cognitive load to find the package name, and can be used to check if a module is converted. Can be used as : $ bmod libaapt2 //frameworks/base/tools/aapt2:libaapt2 $ b build $(bmod aapt2) If the mod is not in the bp2build metrics file, it returns: $ bmod nonexistent nonexistent is not converted to Bazel. Test: build/make/core/tests/b_tests.sh Change-Id: I245665a393621a47598e6743c0fedcd87ac33631
2022-09-28Merge "remove zsh from roboleaf_tests.sh"Sam Delmerico
2022-09-28remove zsh from roboleaf_tests.shSam Delmerico
zsh command was not found on the build server. Remove it from this test. Bug: 249559295 Test: build/make/tests/roboleaf_tests.sh Change-Id: I7a79b183d9fd40829ab03bc54ce899efaa974a60
2022-09-28re-enable b run commands in test suiteSam Delmerico
Zsh has some incompatibilties that we've been trying to work around in the b command. Hopefully this prevents future issues. Bug: 242759256 Test: build/make/tests/roboleaf_tests.sh Change-Id: I5e887932e943112377d38e77a77a0f294b43d9b6
2022-09-28re-enable b test suiteSam Delmerico
Bug: 244771601 Test: build/make/tests/roboleaf_tests.sh Change-Id: I648960b336acd31709aafe858fcbc5be9dc8397a
2022-09-21temporarily disable roboleaf_tests.shSam Delmerico
When I enabled the envsetup_tests target on CI, this script was failing. Rather than break the build again by enabling CI on a potentially failing script, let's just disable this for now, enable the CI target, and then this script can be enabled and tested in presubmits before submitting. Bug: 244771601 Test: build/make/tests/roboleaf_tests.sh Change-Id: I7c3469b49258e37c0ff9b49dd8805031216a7570
2022-09-09add test suite for b commandSam Delmerico
Ensuring that the b command works properly cross-terminal has been a little tricky, so some test commands would help in testing changes. Test: build/make/tests/roboleaf_tests.sh Change-Id: Iecff678fbba6e81c211aadd3665839c1c21acc8c
2022-09-09move lunch specific tests to separate fileSam Delmerico
This is in preparation to add some more tests to this file. Test: build/make/tests/envsetup_tests.sh Change-Id: Ic32115d2a6073f3265b84846f489f3acb8bfad88
2022-05-05Add function for flattening 2d listsCole Faust
Bug: 226974242 Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: Iae977b34ca0ac156ec795c54f4951c769fa994dd
2022-04-28Add implementations for firstword/lastwordCole Faust
Bug: 226974242 Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: Ibb992f42a59212bae48acd55647b2d0872c2f69e
2022-04-20Merge "Correct abspath implementation"Treehugger Robot
2022-04-19Correct abspath implementationCole Faust
realpath doesn't return a path if the file doesn't exist, but $(abspath) in make does. Bug: 229132189 Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: Ief7f634024cc52a9e8c5e478666b15512512f0d8
2022-04-18Sort inherited products correctlyCole Faust
We pass the filename without the extension to rblf.inherit(). Removing the extension changes the sort order when one file's name is a prefix of another: ``` >>> sorted(["base", "base-secondary"]) ['base', 'base-secondary'] >>> sorted(["base.mk", "base-secondary.mk"]) ['base-secondary.mk', 'base.mk'] ``` Correct the sort order so that global variables get their correct ordering. Bug: 229132189 Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: I22367eb49b33956b71ac1b966fe78c1308b94257
2022-04-12Evaluate intermediate products properlyCole Faust
When an intermediate product is evaluated, it needs to act as if it's the only product being evaulated. However, currently, if it inherited a makefile that was also being inherited by the overall top level product via a different path, it would not get the values from that makefile. Copy the configs dictionary before evaluating each product that needs artifact path requirements, and create seperate postfix orders for all of them that don't contain any products that they don't inherit from. Bug: 221312707 Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: I235ad78d587a2e315ba446b5e126d8f6d0fbbea7
2022-04-05Add mksort implementationCole Faust
Bug: 218736658 Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: I0069e7059453c16d299cc650f56c320d905f1958
2022-04-05Merge "Fix single value variable inheritance order"Treehugger Robot
2022-04-04Merge "Revert "Fix inheritance order""Treehugger Robot
2022-04-04Merge "Remove regex functionality from rbcrun"Treehugger Robot
2022-04-04Fix single value variable inheritance orderCole Faust
List variables needed to be percolated in the order of inherit() calls. children.keys() was in that order, due to starlark dictionaries being iterable in the order of insertion, but the previous cl broke that behavior by sorting them. Instead, only sort the children for single value variables. Fixes: 226206409 Fixes: 228044099 Test: ./out/rbcrun ./build/make/tests/run.rbc and testing aosp_arm64 Change-Id: I5b91514e87b158b615e4d4ec7868fccb0248379b
2022-04-04Revert "Fix inheritance order"Cole Faust
This reverts commit 670c587c09ae68e72077f5bca70e71feebc523cb. Reason for revert: Breaks RBC product config for more products than it fixes: b/228044099 Change-Id: I614663311f67b3631a0cee427453c550fc426c8b
2022-03-31Fix inheritance orderCole Faust
The children to inherit from were not sorted. This wasn't a problem for list variables, because all those inheritances get merged together based on the @inherit/ values in the list variables. But for single value variables it made a difference. Bug: 226206409 Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: Ib56bbb91a79fe8c7cb780c253f5bd8d6c0e87765
2022-03-30Remove regex functionality from rbcrunCole Faust
As a first step to making .rbc files compatible with bazel, remove regex support since bazel doesn't have it. Fixes: 227384703 Test: ./out/rbcrun ./build/make/tests/run.rbc Change-Id: I8b946c20cc42897a47a5516a167732f4e16b6158
2022-03-23Fix single value inheritanceCole Faust
Single-value product variables resolve to the first instance of that variable in prefix order. What we have right now is taking the value from the current makefile if it's set, but if it's not, we take it from the last child, not the first. Fixes: 226206409 Test: Manually Change-Id: Id23f7c269ff9a352bf0b67cb57156b72449f978e
2021-12-08Allow multiple patterns in rblf_wildcardCole Faust
This is to match the functionality of make's $(wildcard) Bug: 201700692 Test: go test Change-Id: Ib20c4a4aa9642a2d76b5da5c7accd60e6b91c8fc
2021-12-02Pass input variables to product configCole Faust
Passing variables via a makefile instead of rblf_cli / rblf_env allows us to give them correct types while converting the makefile to starlark, as opposed to the variables always being strings when given via rblf_cli / rblf_env. This also allows us to remove some hand-converted starlark code. Bug: 201700692 Test: ./out/soong/rbcrun ./build/make/tests/run.rbc Change-Id: I58c4f20b29171c14e5ae759beb26a849426f6961
2021-12-01Correctly copy the board configuration input variablesCole Faust
dict(**h[0]) was only copying the top level dictionary object, but not any other dictionaries/lists inside of it. This was causing us to not find all the changes to variables the board configuration was making, and so some variables were not included in the output. Bug: 201700692 Test: ./build/bazel/ci/rbc_regression_test.sh mainline_system_x86_64-userdebug Test: ./out/soong/rbcrun ./build/make/tests/run.rbc Change-Id: I4467eead7e597f6f49119a8c4832126f39d646e7
2021-11-18Runtime reporting of the conversion errors.Sasha Smundak
Bug: 204062171 Test: rbcrun build/make/tests/conversion_error.rbc (displays a message, stops) rbcrun RBC_MK2RBC_CONTINUE=t build/make/tests/conversion_error.rbc (displays a message and continues) Change-Id: Idf0fe6bbb08b1eca1f392d81950eed4a214f3289
2021-11-18Runtime support for dist-for-goals.Sasha Smundak
Convert dist-for-goals. Bug: 198496782 Test: rbcrun build/make/tests/run.rbc Change-Id: I46ef9e897143aecf8bd28ad8569d48e74530b0e5
2021-11-17Add notdir implementationCole Faust
mk2rbc would already translate notdir calls, but since there was no implementation it would fail at runtime. Bug: 201700692 Test: m rbcrun; rbcrun build/make/tests/run.rbc Change-Id: Ie0f4e7b65448e612fa56f87b0bc138648cc0ad58
2021-11-09Add soong_config_getCole Faust
Having a function to get soong config variables makes it easier to convert to starlark. Bug: 201700692 Test: m RBC_PRODUCT_CONFIG=1 RBC_BOARD_CONFIG=1 nothing and check output files Change-Id: I8627555df10d3f66f6154c00be9f0565076f1f94
2021-10-25Add board_platform_in/board_platform_is runtime functions.Sasha Smundak
Bug: 190051051 Test: treehugger Change-Id: I27269fc0f0f7063635fbb1b1645919b604afb762
2021-10-25Better Soong namespace support in the RBC runtime.Sasha Smundak
Includes: * Defining namespace again should have no effect * Allow appending to a variable defined in a namespace * Consistent naming * Print namespace variable assignments even if they are empty Bug: 200297238 Test: rbcrun make/build/tests/run.rbc Change-Id: I64aa22c4498ae89e4bc3a077d6206ad37d5c7c38