| Commit message (Collapse) | Author | Age |
|
|
|
| |
PiperOrigin-RevId: 199775400
|
|
|
|
|
|
|
|
|
|
|
|
| |
A bug in the lexer ignored indentation on the first line of a file. This now
causes an error.
Also, remove the COMMENT token from the lexer. Comments are now accessed separately. This will allow further optimizations in the lexer. It also aligns the code a bit more with the Go implementation.
RELNOTES[INC]:
Indentation on the first line of a file was previously ignored. This is now fixed.
PiperOrigin-RevId: 197889775
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also include the test target in the test log for easier debugging of tests.
Fixes #4960.
Change-Id: Ic79bf21e8eeba765b607755c1d290ee4e910d01f
Closes #4972.
Sample output:
```
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //src/test/shell/bazel:bazel_example_test
-----------------------------------------------------------------------------
```
Change-Id: I433cd9251a564b269da5566bb8401151ae4c99b7
PiperOrigin-RevId: 191891278
|
|
|
|
|
|
|
|
| |
This is technically an incompatible change, but I think it's unlikely to affect a lot of users. Note that this change leaves out Windows, where we set the PATH to the server env PATH plus the MSYS root determined from the shell path.
This is a cleanup, and it also makes unknown commit slightly safer.
PiperOrigin-RevId: 189981959
|
|
|
|
|
|
|
|
| |
Explicitly set local test jobs to 0 (= default, use local resources instead),
as otherwise this test will fail if --local_test_jobs is set in a system-wide
bazelrc.
PiperOrigin-RevId: 189887918
|
|
|
|
|
|
|
|
|
|
|
| |
When --run_under is used, the run-under wrapper will be injected in front of the normal test command line. So, it's incorrect to use the beginning of the command line to infer the test name. However, we can always get the underlying test executable with the TEST_BINARY environmental variable.
Rename TEST_NAME to EXE to avoid future confusion.
Fixes https://github.com/bazelbuild/bazel/issues/4588.
Change-Id: I6fd05cca5e5441c13ee16290c4028ec84adec983
PiperOrigin-RevId: 186590311
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://github.com/bazelbuild/bazel/commit/3904ac33a983fd8faebba1b52bcac5a3ff942029 (https://github.com/bazelbuild/bazel/commit/3904ac33a983fd8faebba1b52bcac5a3ff942029). Fix #4625 by running the test process in a sub-shell.
Apparently, nested background processes interfere with SIGINT handling in bash. I don't 100% understand why and how, but I do have a small bash script that demonstrates the problem: script A that spawns a background process, sends it a SIGINT, and verifies it was received. The script works, *unless* run in the background by a process B; this extra layer of backgrounding cause process A's logic to stop working. See experimental/users/olaola/shell/ for examples. See also https://stackoverflow.com/questions/48847722/nested-background-processes-and-sigint-handling
*** Original change description ***
Fixing test-setup.sh occasionally missing stdout/stderr, on systems where "tail --pid" is supported.
The solutions aren't mine, the new test was taken from Ola's unknown commit and the way to avoid race condition courtesy of sethkoehler@
Mitigates #4608 for compatible Linux systems.
TESTED=presubmits, manual shell tests on new bazel
RELNOTES: None
PiperOrigin-RevId: 186312008
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
https://github.com/bazelbuild/bazel/issues/4625
What I thought was a short fix is turning into a long hunt, so I better roll this back to get the build green again.
I'm not yet 100% certain what the interactions are, but there's a chance that it's back to the drawing board.
*** Original change description ***
Fixing test-setup.sh occasionally missing stdout/stderr, on systems where "tail --pid" is supported.
The solutions aren't mine, the new test was taken from Ola's unknown commit and the way to avoid race condition courtesy of sethkoehler@
Mitigates #4608 for compatible Linux systems.
TESTED=manual scripts and new test case.
RELNOTES: None
PiperOrigin-RevId: 185482604
|
|
|
|
|
|
|
|
|
|
|
|
| |
"tail --pid" is supported.
The solutions aren't mine, the new test was taken from Ola's unknown commit and the way to avoid race condition courtesy of sethkoehler@
Mitigates #4608 for compatible Linux systems.
TESTED=manual scripts and new test case.
RELNOTES: None
PiperOrigin-RevId: 185374273
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When --nobuild_runfile_manifests is passed, don't create runfiles
input or output manifests at all. This seems better than creating fake
manifest artifacts that are actually a middleman. Fail fast for local
tests and the run command when --nobuild_runfiles_manifests is
passed. (These cases were failing with obscure errors before under
--nobuild_runfile_manifests-I just improved the messaging. See
https://github.com/bazelbuild/bazel/issues/4177.)
Change-Id: I351d26f746ecbe47016b58e4662768a5b6a72ff2
PiperOrigin-RevId: 180659571
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some tests depend on the target pattern evaluation strategy used.
Make them specify the target pattern evaluator they need. Same,
if the tests depend on a particular human-readable output stream.
While there, also increase shard count for the bazel_repository_cache_test
to speed it up.
RELNOTES: None
PiperOrigin-RevId: 172328801
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
such as from /etc/bazel.bazelrc.
Fixes https://github.com/bazelbuild/bazel/issues/3727.
This should not be the final fix. There are remaining issues:
- This test should pass regardless of the UI used (either fix the experimental UI or fix the test to make fewer assertions).
- Outside bazelrcs should not pollute the test.
But this fixes the breakage.
RELNOTES: N/A
PiperOrigin-RevId: 169906770
|
|
|
|
|
|
|
| |
Tested manually (with a test that doesn't emit undeclared outputs), and added a test that failed before and passes after the test-setup.sh change.
RELNOTES: N/A
PiperOrigin-RevId: 169687782
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and TEST_UNDECLARED_OUTPUTS_ANNOTATIONS_DIR to Bazel.
After this change:
- Any files written to the TEST_UNDECLARED_OUTPUTS_DIR directory will be zipped up and added to an outputs.zip file under bazel-testlogs.
- Files will be listed in a MANIFEST file under bazel-testlogs.
- Any files written to TEST_UNDECLARED_OUTPUTS_ANNOTATIONS_DIR will be concatenated together into an ANNOTATIONS file under bazel-testlogs.
This provides a channel for tests to provide extra information outside of the test output itself. This is useful for things like verbose server logs.
Note: The //src/test/shell/bazel:bazel_test_test target has a pre-existing breakage (see https://github.com/bazelbuild/bazel/issues/3727). But the new tests pass.
RELNOTES: Tests can now write files to TEST_UNDECLARED_OUTPUTS_DIR and TEST_UNDECLARED_OUTPUTS_ANNOTATIONS_DIR and these will be reflected under bazel-testlogs.
PiperOrigin-RevId: 169282528
|
|
|
|
|
|
|
|
|
| |
By replacing uses of /bin/bash by /bin/sh, a tool which is more
reliably at this location. Then, enable most of the bazel tests
for FreeBSD as well.
Change-Id: Ic56a1705858f1ed67d1e96e2937e9389dd1d0e36
PiperOrigin-RevId: 164241635
|
|
|
|
|
|
|
|
|
|
|
| |
Add stdout to default XML file and generate XML file on timeout
This time corretly quote XML output:
- Remove invalid UTF-8 characters
- Wrap stdout in a CDATA
Change-Id: I70bf38641d1946418e7b8e3b4e44ba0820e7b3c6
PiperOrigin-RevId: 163317477
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Breaks XML format when there is weird characters in the output (Jenkins fails to read XML output for re2 test)
*** Original change description ***
Add stdout to default XML file and generate XML file on timeout
This should fix #1027 and get better error result on Jenkins.
Change-Id: I5ce30b64f634e01dd350af10748c4a9455a6bea8
PiperOrigin-RevId: 162598130
|
|
|
|
|
|
|
| |
This should fix #1027 and get better error result on Jenkins.
Change-Id: I5ce30b64f634e01dd350af10748c4a9455a6bea8
PiperOrigin-RevId: 162474168
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test-setup.sh currently uses the test target name as the "name"
attribute in the xml output's "testcase" element. This ensures names
in the xml are unique across the workspace for unsharded
tests. However, sharded tests all end up with the same "name"
attribute. This angers some junitxml processing tools, which can be
quite persnickity about uniqueness. Let's generate unique test names
of the form "mytest_shard_N/M" for sharded tests.
Change-Id: I6ea82f56846b88449da977dc6629a73b695a485e
PiperOrigin-RevId: 160397341
|
|
|
|
|
|
|
|
|
| |
A common extension to junitxml is to provide the duration of each test
case in seconds. Here, we add the duration to the xml file that
test-setup.sh provides if the test driver doesn't generate one.
Change-Id: I25f94f10bb99db7078919f3e0bcdf7bd3cbb637d
PiperOrigin-RevId: 160252993
|
|
|
|
|
|
|
|
| |
By removing the now unnecessary call to Path#resolveSymbolicLinks we can save a
few stat's per action execution.
Change-Id: Iee157e941c1cd3515ff5ea3b7f410824c24cf44d
PiperOrigin-RevId: 155946544
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bazel always miscounted the number of passes that a test was run,
resulting in confusing output like this:
philwo@philwo:~/src/errortest$ bazel test //tests:fail
[...]
//tests:fail FAILED in 1 out of 2 in 0.1s
ERROR .tests/fail
It shows "1 out of 2" even though just one pass happened.
With this fix, the output is correct:
philwo@philwo:~/src/errortest$ bazel test //tests:fail
[...]
//tests:fail FAILED in 0.1s
ERROR .tests/fail
Relevant to #2855.
PiperOrigin-RevId: 154043240
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The change that originally introduced local PATH lookup was made a very long
time ago, and it's unclear what the exact reasons were. This change makes the
local and remote test execution code paths more consistent, which minimizes
surprises.
Bazel currently forwards the local PATH by default, so this should be a
no-op. Ideally, we'd require PATH forwarding to be explicit, e.g., with
--action_env=PATH, --test_env=PATH, or --run_under=$(which command).
RELNOTES[INC]: Bazel now uses the test's PATH for commands specified as
--run_under; this can affect users who explicitly set PATH to a more
restrictive value than the default, which is to forward the local PATH
--
PiperOrigin-RevId: 147457058
MOS_MIGRATED_REVID=147457058
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The effect of this change on Bazel is that we now set the entire list of
env variables needed for the various protocols: sharding protocol, undeclared
outputs protocol, test warnings, unused runfiles, premature exit signalling,
and coverage. We also now set TEST_SIZE, TEST_TIMEOUT, and TEST_RANDOM_SEED.
I'm not sure if all of the Bazel-side infrastructure for those protocols is
ready yet. With further progress on code sharing, they should fall into place
soon, though.
Also set GUNIT_OUTPUT for now. Ideally, we'd change upstream to accept our
more generic names, but this should do for now.
--
PiperOrigin-RevId: 145660945
MOS_MIGRATED_REVID=145660945
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. no flag: only the direct reason is given (command execution termination status), and also the instruction to use "--verbose_failures"
2. flag "--verbose_failures": gives failed execution command and the instruction to use "--sandbox_debug --strategy"
3. flag "--verbose_failures --sandbox_debug": gives failed execution command, debugging message from sandboxing, and the instruction to use "--strategy"
Also removes "cd <sandbox_path>" in given failed command, since debugging is only necessary with flag "--verbose_failures --sandbox_debug" and the path is already given in sandboxing debugging message.
Addresses #2174.
Fixes bazel_sandboxing_test.sh and bazel_test_test.sh for the new error message.
Fixes timeout.
--
PiperOrigin-RevId: 144285435
MOS_MIGRATED_REVID=144285435
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Still breaks //src/test/shell/bazel:bazel_test_test
http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=linux-x86_64/lastCompletedBuild/testReport/(root)/(empty)/test_test_timeout/
--
PiperOrigin-RevId: 144107285
MOS_MIGRATED_REVID=144107285
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. no flag: only the direct reason is given (command execution termination status), and also the instruction to use "--verbose_failures"
2. flag "--verbose_failures": gives failed execution command and the instruction to use "--sandbox_debug --strategy"
3. flag "--verbose_failures --sandbox_debug": gives failed execution command, debugging message from sandboxing, and the instruction to use "--strategy"
Also removes "cd <sandbox_path>" in given failed command, since debugging is only necessary with flag "--verbose_failures --sandbox_debug" and the path is already given in sandboxing debugging message.
Addresses #2174.
Fixes bazel_sandboxing_test.sh and bazel_test_test.sh for the new error message.
--
PiperOrigin-RevId: 144058351
MOS_MIGRATED_REVID=144058351
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now a test marked as flaky = True will get re-executed up to three times if first
attempts failed. Failed logs of first attempts will get moved in an attempts subfolder.
Also fix a minor bug in the shell testing framework
Fixes #540. Happy new year!
--
PiperOrigin-RevId: 143182831
MOS_MIGRATED_REVID=143182831
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
--
PiperOrigin-RevId: 142691907
MOS_MIGRATED_REVID=142691907
|
|
|
|
|
|
|
|
|
|
| |
testing. Also
fixes bazel_test_test. Fixes #2228.
--
PiperOrigin-RevId: 142532524
MOS_MIGRATED_REVID=142532524
|
|
|
|
|
|
|
|
|
|
|
| |
This will silence the problems in #2227 and #2228 until the actual
underlying issues can be fixed.
--
Change-Id: Id2bc062104b4111bbcde8455f30059b3cb04eff6
Reviewed-on: https://cr.bazel.build/7870
PiperOrigin-RevId: 141892371
MOS_MIGRATED_REVID=141892371
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Roll-forward with fix.
Tested with `bazel build src:srcs //src/test/...` using a bootstrapped bazel.
Fixes #1923.
RELNOTES[INC]: Non test-only targets can no longer depends on test-only targets.
*** Original change description ***
Automated [] rollback of commit a9f20b0d6459d395444c45cf5e94a899f3443633.
*** Reason for rollback ***
Broke Bazel CI:
ERROR: /home/ci/workspace/Bazel/JAVA_VERSION/1.8/PLATFORM_NAME/linux-x86_64/src/BUILD:284:1: in filegroup rule //src:srcs: non-test target '//src:srcs' depends on testonly target '//src/java_tools/junitrunner/java/com/google/testing/junit/junit4:srcs' and doesn't have testonly attribute set.
ERROR: Analysis of target '//scripts/packages:packages' failed; build aborted.
http://ci.bazel.io/view/Bazel%20b...
***
--
MOS_MIGRATED_REVID=136589937
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Broke Bazel CI:
ERROR: /home/ci/workspace/Bazel/JAVA_VERSION/1.8/PLATFORM_NAME/linux-x86_64/src/BUILD:284:1: in filegroup rule //src:srcs: non-test target '//src:srcs' depends on testonly target '//src/java_tools/junitrunner/java/com/google/testing/junit/junit4:srcs' and doesn't have testonly attribute set.
ERROR: Analysis of target '//scripts/packages:packages' failed; build aborted.
http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/JAVA_VERSION=1.8,PLATFORM_NAME=linux-x86_64/923/console
*** Original change description ***
Enforce that non test-only targets cannot depends on test-only targets
This behavior was not enforced since we open-sourced Bazel even though this was
documented and the attributed existed.
Also removed the incorrect part from the documentations: we do not enforce
restrictions on javatests package.
Fixes #1923.
RELNOTES[INC]: Non test-only targets can no longer depends on test-only targets.
--
MOS_MIGRATED_REVID=136574806
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently a call to "bazel" in an integration test means calling a (quite
hidden) function in test-setup.sh which actually calls "$bazel" defined
in "shell/bazel/testenv.sh" which is equal to "$(rlocation io_bazel/src/bazel)".
This is extremely confusing and error prone.
The new mechanism is to add a wrapper script to shell/bin called bazel
and export this directory to the PATH.
Moreover, not every test loads the same test environment, for instance consider
how bazel_query_test loads the test environment:
- Load shell/integration/testenv.sh which loads,
- shell/bazel/test-setup.sh which loads,
- shell/bazel/testenv.sh which loads,
- shell/unittest.bash which loads,
- shell/testenv.sh
Again this is error prone and specially hard to understand, in fact
each test writer needs to decide which of these testenv to load.
This change fixes all of this by having only one testenv.sh
and summarizing the test setup in integration_test_setup.sh.
Namely, for any new integration test, the developer
needs to load integration_test_setup to get the environment set up including
the unittest framework (also it helps to attract contributions).
This change also allows to open sourcing client_sigint_test: Since bazel was a
function client_sigint_test was using a wrong process id to interrupt
the build. The problem is that $! returns
bash's id instead of the id of the process running in the background
when using a function instead of an executable.
A few tests needed to be adapted to the new infrastructure.
--
MOS_MIGRATED_REVID=136470360
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This behavior was not enforced since we open-sourced Bazel even though this was
documented and the attributed existed.
Also removed the incorrect part from the documentations: we do not enforce
restrictions on javatests package.
Fixes #1923.
RELNOTES[INC]: Non test-only targets can no longer depends on test-only targets.
--
MOS_MIGRATED_REVID=136459421
|
|
|
|
|
|
|
|
|
|
|
| |
There are multiple tests sharing the same counter file - if they end up
running at the same time in different shards, then they can conflict
with each other, effectively making the test flaky.
This ought to fix it. I hope.
--
MOS_MIGRATED_REVID=131715434
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the tmpdir wasn't below the execroot, Bazel would crash and print a stack
trace.
Also, the test was incorrect because the EOF wasn't quoted, so it was actually
just executing "echo TEST_TMPDIR=/path/to/tmpdir" which (surprise surprise)
matched TEST_TMPDIR=/path/to/tmpdir.
Finally, the test was _also_ incorrect because it was using the cached test
result for the second case, since changing the tmpdir doesn't invalidate the
test result. So it not only was comparing a constant string to a constant
string, but it wasn't even re-evaluating the constant string.
--
MOS_MIGRATED_REVID=130637221
|
|
|
|
|
|
|
|
|
|
|
| |
related to tests.
This allows for better caching and also makes it easy to run tests in a different directory than the global execroot.
The paths are rewritten to absolute paths in test-setup.sh, because Test Encyclopedia says that we pass absolute paths to tests in these variables.
--
MOS_MIGRATED_REVID=127432675
|
|
|
|
|
|
|
|
|
|
| |
It's still not a great test, but hopefully a few second variation won't make it
flake.
Fixes #1283.
--
MOS_MIGRATED_REVID=124866329
|
|
|
|
|
|
|
| |
--
Change-Id: I86178005713ad80da365b96070794feeb9cc05ab
Reviewed-on: https://bazel-review.googlesource.com/#/c/3751/
MOS_MIGRATED_REVID=123959813
|
|
|
|
|
|
|
| |
Fixes #1126.
--
MOS_MIGRATED_REVID=120707955
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=112409554
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=112404257
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, if the first run failed (in iteration order, which I don't
think is necessarily execution order) then
--runs_per_test_detects_flakes would report FAILED instead of FLAKY.
--
Change-Id: Ice7889d46203e1598d94a4e3c0bcbe13a45b0fe1
Reviewed-on: https://bazel-review.googlesource.com/#/c/2210/
MOS_MIGRATED_REVID=106693725
|
|
|
|
|
|
|
|
|
|
|
| |
The headers were modified with
`find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'`
And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan.
The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand.
--
MOS_MIGRATED_REVID=103938715
|
|
|
|
|
|
|
|
|
| |
Previously the timing out information wasn't propagated to the
user, leading to a wrong FAILED message whereas the test was
timing out.
--
MOS_MIGRATED_REVID=102535481
|
|
|
|
|
|
|
| |
non-sandboxing spawn strategy (this is a no-op until sandboxing is there).
--
MOS_MIGRATED_REVID=101219854
|
|
|
|
|
|
|
| |
Fixes #279.
--
MOS_MIGRATED_REVID=97661546
|
|
|
|
|
|
|
| |
Fixes #206.
--
MOS_MIGRATED_REVID=95525127
|
|
Fixes #138.
--
MOS_MIGRATED_REVID=91708374
|