aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/test
Commit message (Collapse)AuthorAge
* Enable automatic trimming of test configuration when entering non-test rules.Gravatar mstaib2018-06-14
| | | | | | | | | | | | | | Note that this is not sufficient to see caching between builds on its own; currently when any flag changes, the analysis cache is reset. A follow-up will turn off this behavior when only test flags change while trim_test_configuration is on. config_settings which examine test options are treated the same as test rules; that is, they can only be successfully analyzed at the top level or when connected to the top level by an unbroken chain of test rules. RELNOTES: None. PiperOrigin-RevId: 200614584
* Add skylarkbuildapi bootstraps for apple, cpp, platform, and testing packagesGravatar cparsons2018-06-12
| | | | | RELNOTES: None. PiperOrigin-RevId: 200246780
* Migrate remaining assorted skylark types to skylarkbuildapiGravatar cparsons2018-06-11
| | | | | RELNOTES: None. PiperOrigin-RevId: 200100871
* Fix bug in skyframe-based test-suite expansionGravatar ulfjack2018-06-07
| | | | | | | | | | It was tracking filtered tests and then applying the filter at the next higher level. I also added a bunch of comments - we actually have four implementations of test suite expansion, and they are not consistent. Sorry about that. PiperOrigin-RevId: 199629485
* Clean up code that directly imports nested classes like Builder, Entry, etc.Gravatar jcater2018-05-01
| | | | PiperOrigin-RevId: 194985157
* Expose an actions provider on RuleConfiguredTarget instances.Gravatar cparsons2018-03-06
| | | | | | | | | Given a target (for example from a skylark aspect), one will be able to access a list of actions that the target generated using "target.actions". This is without additional memory footprint. Actions themselves are not fully exposed to skylark (and thus there isn't much meaning to gather from them in skylark yet). Access methods will follow soon. RELNOTES: None. PiperOrigin-RevId: 188098079
* Migrate a few trivial uses of @SkylarkSignature to use @SkylarkCallable insteadGravatar cparsons2018-03-01
| | | | | RELNOTES: None. PiperOrigin-RevId: 187531006
* Move BazelRuleClassProvider.TESTING_SUPPORT to its own class in rules/test.Gravatar lpino2018-01-29
| | | | PiperOrigin-RevId: 183672444
* Allow access to some TestAttempt fields for testingGravatar ulfjack2017-12-13
| | | | PiperOrigin-RevId: 178893146
* BEP: Extend TestResult to optionally contain meta dataGravatar aehlig2017-11-29
| | | | | | | | Extend the protocol to support also showing meta data about an action execution, if the underlying test action is able to report it. PiperOrigin-RevId: 177294531
* Return SpawnResults using a List instead of a Set.Gravatar ruperts2017-11-21
| | | | | | | | | Currently we don't care about the list order of SpawnResults. However, we may care about the list order later. Also, if the equals() method for SpawnResults is ever changed then it may be problematic to return SpawnResults in a Set. Aside: ActionResults use SpawnResults to calculate cumulative execution times for Actions, and may provide other metrics in future. RELNOTES: None. PiperOrigin-RevId: 176579460
* More SpawnResult-related plumbing changes to Actions, Strategies, ↵Gravatar ruperts2017-10-07
| | | | | | | | | ActionContexts, etc., so that SpawnResult metadata is returned upwards. Note that the TODOs mostly refer to changes that will appear in a subsequent CL (a CL to return SpawnResults, contained in ActionResults, from Actions/AbstractActions). I split off the remaining SpawnResult-related changes into this CL and kept the ActionResult-related changes separate. RELNOTES: None. PiperOrigin-RevId: 171355611
* Move RuleConfiguredTarget to lib.analysis.configuredtargets.Gravatar gregce2017-09-19
| | | | | | This is a trivial change with a large file footprint. PiperOrigin-RevId: 169169864
* Rename some of native declared providers according to the new naming scheme.Gravatar dslomov2017-08-21
| | | | | RELNOTES: None PiperOrigin-RevId: 165910455
* Move core test classes to lib.analysis.testGravatar ulfjack2017-08-11
| | | | | | | | These are depended upon by analysis code, so need to live in the same library as lib.analysis. Moving them here makes it possible to split the build-base library into separate libraries for analysis, execution, and rules. PiperOrigin-RevId: 164847161
* Revert collect_coverage change that enables the new Java coverageGravatar elenairina2017-08-10
| | | | | | in blaze. This should be enabled only after the blaze release, otherwise it makes code coverage drop, mainly due to including auto-generated files in the coverage report. PiperOrigin-RevId: 164724689
* Use java.time.Duration for timeoutsGravatar ulfjack2017-08-09
| | | | PiperOrigin-RevId: 164577062
* Move RuleConfiguredTargetFactory to lib.analysisGravatar ulfjack2017-08-07
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164446955
* Move most test options from BuildConfiguration to TestConfiguration.Gravatar tomlu2017-08-07
| | | | | | --test_env isn't moved in this CL since it's exposed to Skylark via BuildConfiguration, making it a somewhat riskier refactor. PiperOrigin-RevId: 164266168
* Break out --test_filter into a test configuration fragment.Gravatar tomlu2017-08-03
| | | | | | The other test configuration options will follow in subsequent CLs to keep size manageable. PiperOrigin-RevId: 164068510
* Better names for declared providers-related classes.Gravatar dslomov2017-08-01
| | | | | | | | Follows https://docs.google.com/document/d/1aAIVWvHPERDz2cv_PCFGwr8dvh5FcAkENFoRsNS4clk/. RELNOTES: None. PiperOrigin-RevId: 163728291
* Make native declared providers not implement TransitiveInfoCollection.Gravatar dslomov2017-07-12
| | | | | | | | | | | | (Almost) all native declared providers are accessed as such and not as native non-declared providers (inheritors of TransitiveInfoCollaction). There are still three providers that use TransitiveInfoCollection.WithLegacySkylarkName mechanism, I'll address them in the follow-up CL. RELNOTES: None. PiperOrigin-RevId: 161655315
* Make native declared providers type-safe.Gravatar dslomov2017-07-10
| | | | | RELNOTES: None. PiperOrigin-RevId: 161395570
* BEP: Report test warningsGravatar aehlig2017-07-10
| | | | | | | | Also report test warnings, if any, for completed test actions in the build event protocol. RELNOTES: None PiperOrigin-RevId: 161384061
* Cache flaky tests (remove the cachable flag from test result data)Gravatar ulfjack2017-07-07
| | | | | | | | | | | | | | | | | | | The cachable flag was only set to false for flaky tests. Before this CL, we did not cache flaky tests on subsequent runs, instead rerunning them, even though this is both very expensive and inconsistent with our normal handling, which is to cache passes but not errors. If cache_test_results is enabled, we now also cached timed out test results. If cache_test_results=auto (the default), we now also cache flaky tests. We still do not cache failed tests; the TestRunnerAction checks if the previous test result was marked as passed (which also applies to flaky tests, but not to failed or timed-out tests). Also add some unit tests. PiperOrigin-RevId: 161187950
* Add ActionEnvironment, which is a wrapper class for a fixed+inherited envGravatar ulfjack2017-06-28
| | | | | | | | | | | | | | | | We are currently tracking the action environment (computed from --action_env), and the test action environment (computed from --test_env, and not including the action env) as two pairs of fields, and a lot of callers haven't been updated to handle both parts (TestRunnerAction does, but many 'normal' actions don't). However, both parts have always both be handled, and moving them into a single abstraction makes it harder to accidentally miss one part. We'll subsequently need to update all the action implementations to use the new abstraction, and also update the Skylark API (or bypass it and always apply the action environment for all actions, except we don't know which configuration to use). PiperOrigin-RevId: 160386181
* TestAttempt: remove unused constructorsGravatar aehlig2017-06-20
| | | | | RELNOTES: None. PiperOrigin-RevId: 159537816
* Extract ActionContext to a top-level classGravatar ulfjack2017-06-19
| | | | PiperOrigin-RevId: 159423459
* Rewrite the Executor/ActionExecutionContext splitGravatar ulfjack2017-06-19
| | | | | | | Move everything to ActionExecutionContext, and drop Executor whereever possible. This clarifies the API, makes it simpler to test, and simplifies the code. PiperOrigin-RevId: 159414816
* Use the correct JVM for LcovMerger instead of whatever "java" gets us.Gravatar lberki2017-06-09
| | | | | | | Fixes #2904. RELNOTES: None. PiperOrigin-RevId: 158516169
* Track the test environment in Skyframe, like the action environmentGravatar ulfjack2017-06-09
| | | | | | | | Instead of passing a client env into the test strategies, use the same mechansim as --action_env, by depending on the right set of Skyframe nodes that correspond to client env entries. PiperOrigin-RevId: 158401670
* Move ExecutionRequirements to the lib.actions packageGravatar ulfjack2017-06-06
| | | | | | | | | It was previously the odd-one out in lib.analysis.actions, due to other code that wanted to depend on it without pulling in all of analysis. However, it's needed to interpret Spawn instances, and Spawn lives in lib.actions, so it makes more sense to move it there, and remove the special-casing. PiperOrigin-RevId: 158116684
* BEP: report more test-result files and add a constants classGravatar aehlig2017-05-26
| | | | | | | | | | | In a test result, report more standard files, if present. Also, add a class with the constants used to name those files. Note that we have to identify files generated by a test with strings rather than an enum, as we want to support extensions of bazel to add their own files reported by tests. RELNOTES: None. PiperOrigin-RevId: 157204042
* Automated g4 rollback of commit e2edf2e141a09c025a958d580c7cac7b57c70d83.Gravatar Googler2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Rollforward with fix. *** Original change description *** Automated g4 rollback of commit c78c947e6a8cbb323304f872a3dcabb989a3d76b. *** Reason for rollback *** Breaks android targets in the nightly - see [] *** Original change description *** Do not retain transitive data in AndroidLocalTestBase... *** ROLLBACK_OF=156745610 RELNOTES: None PiperOrigin-RevId: 157028029
* Automated g4 rollback of commit c4134802dd15d6ef5cca6521f6bf6aac395ee2ad.Gravatar kchodorow2017-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Roll forward of directory name change *** Original change description *** Automated g4 rollback of commit 1d9e1ac90197b1d3d7b137ba3c1ada67bb9ba31b. *** Reason for rollback *** Breaks //src/test/shell/integration:force_delete_output_test *** Original change description *** Symlink output directories to the correct directory name If the workspace directory is /path/to/my/proj and the name in the WORKSPACE file is "floop", this will symlink the output directories to output_base/execroot/floop instead of output_base/execroot/proj. More prep for #1262, fixes #1681. PiperOrigin-RevId: 156892980
* Automated g4 rollback of commit c78c947e6a8cbb323304f872a3dcabb989a3d76b.Gravatar cpeyser2017-05-23
| | | | | | | | | | | | | | *** Reason for rollback *** Breaks android targets in the nightly - see [] *** Original change description *** Do not retain transitive data in AndroidLocalTestBase. The argument strings and artifacts were both transitive and flattened, causing O(N^2) memory consumption. PiperOrigin-RevId: 156745610
* Do not retain transitive data in AndroidLocalTestBase.Gravatar Googler2017-05-15
| | | | | | The argument strings and artifacts were both transitive and flattened, causing O(N^2) memory consumption. PiperOrigin-RevId: 156083738
* Add a custom interface for cache hit processing in actionsGravatar ulfjack2017-05-10
| | | | | | | | | | | | The new interface mirrors ActionExecutionContext, but is restricted to exactly the parts used right now. I did consider using ActionExecutionContext, but it contains some parts that we don't want to make available for cache hits. The end goal is to allow the build event stream access to artifact metadata, in particular for TestResult and TestSummary events, which in turn requires making artifact metadata available when the TestRunnerAction is a cache hit. PiperOrigin-RevId: 155612573
* Automated g4 rollback of commit 56e8d90674a35ebe727f74cd2d47108bfcaa4515.Gravatar ulfjack2017-05-09
| | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Looks like it broke stuff - the presubmit bypass was added by accident. *** Original change description *** Add a custom interface for cache hit processing in actions The new interface mirrors ActionExecutionContext, but is restricted to exactly the parts used right now. I did consider using ActionExecutionContext, but it contains some parts that we don't want to make available for cache hits. The end goal is to allow the build event stream access to artifact metadata, in particular for TestResult and TestSummary events, which in turn requires making artifact metadata available when the TestRunnerAc... *** PiperOrigin-RevId: 155493797
* BEP: Also report the configuration in testGravatar Klaus Aehlig2017-05-09
| | | | | | | | In multi-configuration builds, test can be run for different configurations as well. So we have to report the configuration for each test as well. Change-Id: I939cce7464823fbcd3c7161a50b41b94bbed8812 PiperOrigin-RevId: 155493397
* Add a custom interface for cache hit processing in actionsGravatar ulfjack2017-05-09
| | | | | | | | | | | | The new interface mirrors ActionExecutionContext, but is restricted to exactly the parts used right now. I did consider using ActionExecutionContext, but it contains some parts that we don't want to make available for cache hits. The end goal is to allow the build event stream access to artifact metadata, in particular for TestResult and TestSummary events, which in turn requires making artifact metadata available when the TestRunnerAction is a cache hit. PiperOrigin-RevId: 155492447
* Set the local CPU reservation for tests based on their "cpu:<n>" tag.Gravatar philwo2017-05-03
| | | | | | | | | | | | | | | | | | This lets users specify that their test needs a minimum of <n> CPU cores to run and not be flaky. Example for a reservation of 4 CPUs: sh_test( name = "test", size = "large", srcs = ["test.sh"], tags = ["cpu:4"], ) This could also be used by remote execution strategies to tune their resource adjustment. RELNOTES: You can increase the CPU reservation for tests by adding a "cpu:<n>" (e.g. "cpu:4" for four cores) tag to their rule in a BUILD file. This can be used if tests would otherwise overwhelm your system if there's too much parallelism. PiperOrigin-RevId: 154856091
* Fix typo in comment in TestResult.java.Gravatar philwo2017-04-24
| | | | PiperOrigin-RevId: 153831526
* Remove --microcoverage supportGravatar cushon2017-04-24
| | | | | | This feature is unused and depends on emma, which is obsolete. PiperOrigin-RevId: 153713051
* Refactor all ctor callsites of PathFragment to instead call a static ↵Gravatar nharmata2017-04-05
| | | | | | | | | | | | 'create' method. This paves the way for changing PathFragment to e.g. an abstract class with multiple subclasses. This way we can split out the windows-specific stuff into one of these concrete classes, making the code more readable and also saving memory (since the shallow heap size of the NonWindowsPathFragment subclass will hopefully be smaller than that of the current PathFragment). This also lets us pursue gc churn optimizations. We can now do interning in PathFragment#create and can also get rid of unnecessary intermediate PathFragment allocations. RELNOTES: None PiperOrigin-RevId: 152145768
* BEP: provide events a generic converter classGravatar aehlig2017-04-04
| | | | | | | | | | | Change the BuildEvent interface to accept a generic class of converters. In this way, we won't have to change it again in the future, once more converters are needed. In fact, a new converter is needed right now (will be added in a follow-up patch) to allow build events to know the name of named artifact groups already reported in the stream. Change-Id: Ibb32ea5fff361e21bcf2d34818d8351a1da7a2e3 PiperOrigin-RevId: 152131870
* Automated g4 rollback of commit 1d9e1ac90197b1d3d7b137ba3c1ada67bb9ba31b.Gravatar hlopko2017-04-04
| | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks //src/test/shell/integration:force_delete_output_test *** Original change description *** Symlink output directories to the correct directory name If the workspace directory is /path/to/my/proj and the name in the WORKSPACE file is "floop", this will symlink the output directories to output_base/execroot/floop instead of output_base/execroot/proj. More prep for #1262, fixes #1681. PiperOrigin-RevId: 152126545
* Change the tag experimental_testrunner into a couple of flags.Gravatar kush2017-03-31
| | | | | | | | | | | | | | | Note 1) Explanation of the flags: --explicit_java_test_deps: This is a flag independent of the others, and forces users to specify the JUnit deps. We should try to make this flag default to true in a future release, irrespective of the work around persistent java tests. --experimental_testrunner: Bazel-only flag affecting switching from the BazelTestRunner to the ExperimentalTestRunner which will run the tests in a separate classloader. --explicit_java_test_deps is desired for this to ensure once we split the classpaths of the TestRunner and the TestTarget, the TestTarget does not hit a ClassNotFoundException, due to missing JUnit deps. --test_strategy=experimental_worker: This is the existing flag, which in turn depends on --experimental_testrunner flag, since only the ExperimentalTestRunner is capable to running java tests persistently. Note 2) There was no clean way to check for the flags defined in JavaOptions within TestActionBuilder (as I was checking the "tag=experimental_testrunner" before), without making TeasActionBuilder's build rules depend on java rules (yikes!). Hence, I created a new method compatibleWithStrategy() within each fragment, so I could check if WorkerTestStrategy could be compatible with the user specified flags. Thanks to Greg for suggesting this approach! RELNOTES: None PiperOrigin-RevId: 151729869
* Also report starting times of test actionsGravatar aehlig2017-03-31
| | | | | | | | | Record the starting times of test actions, so that they can be reported in the build event protocol. Change-Id: I28e8d7d6ad39d91f4ffdd8a6161a5fc30f9a39b8 PiperOrigin-RevId: 151724760
* Symlink output directories to the correct directory nameGravatar kchodorow2017-03-31
| | | | | | | | | | If the workspace directory is /path/to/my/proj and the name in the WORKSPACE file is "floop", this will symlink the output directories to output_base/execroot/floop instead of output_base/execroot/proj. More prep for #1262, fixes #1681. PiperOrigin-RevId: 151712384