aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/runtime
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2018-05-15 16:41:19 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-05-15 16:43:02 -0700
commit90e116c2358e2d1e71818f7d39ddb609581ee211 (patch)
tree998a51348dfe39c513d44a05bdc0935589fd9102 /src/test/java/com/google/devtools/build/lib/runtime
parent0015d18f57e3f94905b58967b9dd6a1e8b364596 (diff)
Add --ignore_all_rc_files startup options.
This overrides --bazelrc and --[no]master_bazelrc regardless of order. Like --bazelrc and --[no]master_bazelrc, it cannot be mentioned in an rc file, this would be a contradiction. This flag is useful for testing, and for having a version-agnostic way to turn off all rc files, such as in the canonical command line reporting. Now that blazerc and bazelrc are separate, this is necessary. If explicit values for --bazelrc or --master_bazelrc are provided which are now ignored, Bazel will warn the user. #4502 Alternatives considered - We could avoid this flag but would need to have some well-documented, reusable list of the startup flags that effectively come to the same effect. This would be necessary in our integration tests and in the CommandLineEvent and other places where rc files need to be completely disabled for correctness. We decided that this startup option was more straightforward and usable for both users and Bazel devs: it shouldn't be used when more fine-grained control is needed, but provides warnings if users are likely to be confused by the outcome. RELNOTES: None. PiperOrigin-RevId: 196750704
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/runtime')
-rw-r--r--src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java b/src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java
index 6c7f2929f1..71ad575314 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/CommandLineEventTest.java
@@ -93,11 +93,9 @@ public class CommandLineEventTest {
checkCommandLineSectionLabels(line);
assertThat(line.getSections(0).getChunkList().getChunk(0)).isEqualTo("testblaze");
- assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(2);
+ assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(1);
assertThat(line.getSections(1).getOptionList().getOption(0).getCombinedForm())
- .isEqualTo("--nomaster_blazerc");
- assertThat(line.getSections(1).getOptionList().getOption(1).getCombinedForm())
- .isEqualTo("--blazerc=/dev/null");
+ .isEqualTo("--ignore_all_rc_files");
assertThat(line.getSections(2).getChunkList().getChunk(0)).isEqualTo("someCommandName");
assertThat(line.getSections(3).getOptionList().getOptionCount()).isEqualTo(0);
assertThat(line.getSections(4).getChunkList().getChunkCount()).isEqualTo(0);
@@ -201,11 +199,9 @@ public class CommandLineEventTest {
// Expect the provided rc-related startup options are removed and replaced with the
// rc-prevention options.
assertThat(line.getSections(0).getChunkList().getChunk(0)).isEqualTo("testblaze");
- assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(2);
+ assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(1);
assertThat(line.getSections(1).getOptionList().getOption(0).getCombinedForm())
- .isEqualTo("--nomaster_blazerc");
- assertThat(line.getSections(1).getOptionList().getOption(1).getCombinedForm())
- .isEqualTo("--blazerc=/dev/null");
+ .isEqualTo("--ignore_all_rc_files");
assertThat(line.getSections(2).getChunkList().getChunk(0)).isEqualTo("someCommandName");
assertThat(line.getSections(3).getOptionList().getOptionCount()).isEqualTo(0);
assertThat(line.getSections(4).getChunkList().getChunkCount()).isEqualTo(0);
@@ -281,7 +277,7 @@ public class CommandLineEventTest {
checkCommandLineSectionLabels(line);
assertThat(line.getSections(0).getChunkList().getChunk(0)).isEqualTo("testblaze");
- assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(2);
+ assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(1);
assertThat(line.getSections(2).getChunkList().getChunk(0)).isEqualTo("someCommandName");
// In the canonical line, expect the options in priority order.
assertThat(line.getSections(3).getOptionList().getOptionCount()).isEqualTo(4);
@@ -347,7 +343,7 @@ public class CommandLineEventTest {
checkCommandLineSectionLabels(line);
assertThat(line.getSections(0).getChunkList().getChunk(0)).isEqualTo("testblaze");
- assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(2);
+ assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(1);
assertThat(line.getSections(2).getChunkList().getChunk(0)).isEqualTo("someCommandName");
assertThat(line.getSections(3).getOptionList().getOptionCount()).isEqualTo(4);
@@ -419,7 +415,7 @@ public class CommandLineEventTest {
// Unlike expansion flags, implicit requirements are not listed separately.
assertThat(line.getSections(0).getChunkList().getChunk(0)).isEqualTo("testblaze");
- assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(2);
+ assertThat(line.getSections(1).getOptionList().getOptionCount()).isEqualTo(1);
assertThat(line.getSections(2).getChunkList().getChunk(0)).isEqualTo("someCommandName");
assertThat(line.getSections(3).getOptionList().getOptionCount()).isEqualTo(1);
assertThat(line.getSections(3).getOptionList().getOption(0).getCombinedForm())