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(
1212 "TS_WRAPPER_ZIP" : "$(rlocationpath //javascript/extractor/lib/typescript)" ,
1313 },
1414 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"],
1518 deps = [
1619 "//javascript/extractor" ,
1720 "//javascript/extractor:deps" ,
Original file line number Diff line number Diff line change @@ -161,6 +161,14 @@ public void close() {
161161 byte [] actual_utf8_bytes = StringUtil .stringToBytes (sw .toString ());
162162 String actual = new String (actual_utf8_bytes , Charset .forName ("UTF-8" ));
163163 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)
164172 boolean replaceExpectedOutput = false ;
165173 if (replaceExpectedOutput ) {
166174 System .out .println ("Replacing expected output for " + trap );
You can’t perform that action at this time.
0 commit comments