File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ java_test(
12
12
"TS_WRAPPER_ZIP" : "$(rlocationpath //javascript/extractor/lib/typescript)" ,
13
13
},
14
14
test_class = "com.semmle.js.extractor.test.AllTests" ,
15
+ # To use `replaceExpectedOutput` you need to uncomment the following line
16
+ # (to be allowed to override the .trap files on disk)
17
+ # tags = ["no-sandbox"],
15
18
deps = [
16
19
"//javascript/extractor" ,
17
20
"//javascript/extractor:deps" ,
Original file line number Diff line number Diff line change @@ -161,6 +161,14 @@ public void close() {
161
161
byte [] actual_utf8_bytes = StringUtil .stringToBytes (sw .toString ());
162
162
String actual = new String (actual_utf8_bytes , Charset .forName ("UTF-8" ));
163
163
File trap = new File (outputDir , f .getName () + ".trap" );
164
+ // NOTE: If you want to replace expected output, you MUST change
165
+ // the way this test is run under bazel to escape the bazel
166
+ // sandbox. Add `tags = ["no-sandbox"]` to the test rule in
167
+ // javascript/extractor/test/com/semmle/js/extractor/test/BUILD.bazel
168
+ //
169
+ // if you have problems with too much caching, you need to find the right bazel command,
170
+ // and run `./build --bazel test ... --cache_test_results=no`
171
+ // (at least I had problems getting the "no-cache" tag to work)
164
172
boolean replaceExpectedOutput = false ;
165
173
if (replaceExpectedOutput ) {
166
174
System .out .println ("Replacing expected output for " + trap );
You can’t perform that action at this time.
0 commit comments