summaryrefslogtreecommitdiff
path: root/python/python_test.go
AgeCommit message (Collapse)Author
2021-03-22Remove usages of FixtureFactory from misc packagesPaul Duffin
These packages have already been migrated to use per test build directory so have no need for a FixtureFactory. Bug: 183235980 Test: m nothing Change-Id: I667d1d992caaf0f615de91f89efdae11c44986c2
2021-03-17Convert python package to fixturesPaul Duffin
Bug: 182885307 Test: m nothing Change-Id: I78506a10f0e6ba8ad4952e8305f47ffd5a33b359
2021-03-17Fix hole in python testing code that ignored a broken testPaul Duffin
The test running code would only check errors if there were any reported. That ignored the "module with duplicate runfile path" test which was not reporting the expected error. This change corrects that mistake, and then fixes the test which had started to fail. It is possible that the failing test highlights a bug in the python code but if so that will need to be fixed in a follow up bug. Bug: 183046274 Test: m nothing Change-Id: I961b15a452725e7b15ba9d21b4a4a672ba3d004a
2020-12-01Add comments/refactor for python.goLiz Kammer
Test: all soong tests Test: m nothing Change-Id: Ib3b95d7c2831b97026e76a39af515fd51c6cb2c7
2020-11-12Pass Config to NewTestContext instead of ctx.RegisterColin Cross
Prepare for using Config when adding singletons by passing Config to NewTestContext and NewContext instead of to ctx.Register. This will enable a followup change to store SingletonMakeVarsProviders registered on the Context in the Config, which is necessary to run multiple tests in parallel without data races. Test: all soong tests Change-Id: Id229629a4e42ff4487d317241673837726c075fc
2020-11-02Consolidate python version properties in mutatorLiz Kammer
Test: m Bug: 165114590 Change-Id: Iaf874f7098317a52827b113167e3dc1ed044e907
2020-10-09Revert "Make lots of tests run in parallel"Colin Cross
This reverts commit 323dc60712491c71ccdc5363c42df61f0a192487. Reason for revert: Possible cause of test instability Bug: 170513220 Test: soong tests Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
2020-10-06Make lots of tests run in parallelColin Cross
Putting t.Parallel() in each test makes them run in parallel. Additional t.Parallel() could be added to each subtest, although that requires making a local copy of the loop variable for table driven tests. Test: m checkbuild Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
2020-07-27Add `data_native_bins` property to java_test_hostLiz Kammer
When multiple os/arch variants are supported, java_test_host could not find a matching arch due to java having arch:common, whereas native binaries support a specific architecture. This change adds the property `data_native_bins` in order to support binaries with the appropriate os/arch variants. Test: m FirmwareDtboVerification with data_native_bins Test: forrest Bug: 153848038 Change-Id: I45adebff0fde2811d5ef5620c697b97b768c951f
2019-12-18Move filesystem into ConfigColin Cross
The filesystem object was available through ModuleContext.Fs(), but gives too much access to the filesystem without enforicing correct dependencies. In order to support sandboxing the soong_build process move the filesystem into the Config. The next change will make it private. Bug: 146437378 Test: all Soong tests Change-Id: I5d3ae9108f120fd335b21efd612aefa078378813
2019-11-25Make TestContext.RegisterModuleType take an android.ModuleFactoryColin Cross
Avoid having to pass ModuleFactoryAdaptor to every call to RegisterModuleType in a test by wrapping RegisterModuleType. Test: all soong tests Change-Id: If8847d16487de0479cc3020b728256922b3cadba
2018-06-04Fix embedded_launcher can't find filesNan Zhang
The problem came from Python libraries doesn't know the information that we enabled embedded_launcher (only Python binary knows about that). And we can't simply remove runfiles dir for Python libraries since host Python mode need this. Bug: b/80441699 Test: m perf_profo_flames Change-Id: I73ffc4d7504f95a708ae7cca47bc6c15a673aa31
2018-03-22Add Python protobuf support.Nan Zhang
Python protobuf std libs will be wrapped in final binary/test par file. Bug: b/70568913 Test: manually create real examples. Change-Id: I7376ec9175f3e03d1adbd20858a7f74e826387ad
2018-03-15Extract failIfErrored() to android/testing.goLogan Chien
Bug: 74506774 Test: lunch aosp_walleye-userdebug && make # runs unit tests Change-Id: I1c09412d5988dca2cc1c5f041893b313ab1c163a
2018-03-09Remove timestamp based filelist file for tracking Python dependenciesNan Zhang
Each Python module will generate a zip file containing source & data files. The Python binary will collect all its dependencies and use merge_zips to merge each zip file to create a final .par file. Test: m -j checkbuild && real examples: Bug: b/70568913 Change-Id: I9ff232d461d33e1c06026e7dcb5b124bf02c3ce5
2017-10-10Let tests override environmentColin Cross
Pass an environment to TestConfig that will be used for all Config.Getenv calls. Test: none Change-Id: I683cd9c9e0db61c9bfd2adb27fca78f558f225c4
2017-09-05Add support for python_defaults modulesNan Zhang
Test: python_test.go Change-Id: I2077414a5b06da5e660a1b48bfdb2eb926fb702f
2017-09-05<Hermetic> Replace Soong Python bootstrap process with embeddedNan Zhang
launcher. For Python2, we bundle embedded launcher as bootstrapper within every .par file. This feature is only enabled for linux_x86_64 for now. We provide a user flag: hermetic_enabled within bp file. By default, Pyhon2 still use classic bootstrapping way to construct .par file and relys on host interpreter. Once embedded_launcher is enabled, launcher will be used to bootstrap .par file and execute user program. For Python3, the launcher will be ready soon, and for now it still relys on classic bootstrapping. Test: Real example is used to test. Bug: b/63018041 Change-Id: I28deba413d8ad3af407595e46f77d663e79a3705
2017-07-14Add integration testing infrastructureColin Cross
Fix mutator registration for tests to allow different tests in the same package to register different mutators. Allow tests to track the resulting ModuleBuildParams objects to use in assertions, and provide helpers for getting them. For example: config := android.TestConfig(buildDir) ctx := android.NewTestContext() ctx.RegisterModuleType(...) ctx.MockFileSystem(...) ctx.ParseBlueprintsFile("Android.bp") ctx.PrepareBuildActions(config) ctx.Register() // Get the Inputs value passed to the javac rule for the foo module inputs := ctx.ModuleForTests("foo".Rule("javac").Inputs Test: java_test.go Change-Id: I10c82967f5f3586d2c176f169906b571ed82fc73
2017-06-30Refactor factoriesColin Cross
Change module factories from returning a blueprint.Module and a list of property structs to returning an android.Module, which holds the list of property structs. Test: build.ninja identical except for Factory: comment lines Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
2017-06-12Fix the issue that /tmp/soong_python_test* isn't being removed.Nan Zhang
Bug: 62499851 Test: go test Change-Id: I84bd66cd1410dd9fc6add3ba5626d8ec4fe702d7
2017-05-17Add python_test_host module.Nan Zhang
bug: 31676493 Test: created py_test modules in real folder. and ran 'mma'. Change-Id: I22aa2fad74b11e4a31ea7a4c4a4f0ea64cd3fc94
2017-05-05Supported python build in host side.Nan Zhang
The base module handles all the common functionalites, such as version compatibilty check, version variations split, source file format check, source/data file duplicate check. The library/binary module focuses on how to generate binary build actions, such as setting up stub script, zipping, filling in __init__.py in runfiles dir tree. Bug: b/31676493 Test: go test under python package Change-Id: I06608369f350f7195873d459e1c8d1bdb811e77e