Commit d43ae0d
authored
Clean
* Clean test_{runner,scalafmt_helper}, add env vars
Did a little cleaning up while trying to get protobuf to stop
recompiling so often. Didn't impact that problem, but good cleanups
regardless.
Also added two environment variables to make diagnosing test failures
(or slowdowns) easier:
- Defining `RULES_SCALA_TEST_ONLY`will cause only one specific test case
to run, with full Bazel output. This is helpful for pinpointing and
working on a specific test without hunting for it or recreating its
commands.
- Defining `RULES_SCALA_TEST_VERBOSE` will cause all tests to emit full
Bazel output. This is more useful when running all the tests from a
specific script from `test/shell/test_*.sh`.
Also, today I learned that `SECONDS` is a special Bash variable. Making
it `local` screwed it up and showed all tests as taking zero seconds.
* Don't clean test_cross_build, shutdown at end
This speeds up the `test_cross_build.sh` tests substantially,
particularly between runs. Here are the times for two runs before this
change; the first is after running `bazel clean` and `bazel shutdown` in
the `test_cross_build` directory:
```txt
$ /usr/bin/time ./test_cross_build.sh
running test test_cross_build
Test "test_cross_build" successful (73 sec)
running test test_scalafmt
Test "test_scalafmt" successful (94 sec)
167.01 real 0.37 user 0.50 sys
$ /usr/bin/time ./test_cross_build.sh
running test test_cross_build
Test "test_cross_build" successful (8 sec)
running test test_scalafmt
Test "test_scalafmt" successful (92 sec)
99.96 real 0.35 user 0.48 sys
```
Here are the times for two equivalent runs after this change:
```txt
$ /usr/bin/time ./test_cross_build.sh
running test test_cross_build
Test "test_cross_build" successful (71 sec)
running test test_scalafmt
Test "test_scalafmt" successful (6 sec)
77.50 real 0.33 user 0.44 sys
$ /usr/bin/time ./test_cross_build.sh
running test test_cross_build
Test "test_cross_build" successful (5 sec)
running test test_scalafmt
Test "test_scalafmt" successful (2 sec)
7.21 real 0.26 user 0.38 sys
```
The effect is even more dramatic when setting compiler flags in
`.bazelrc`, as I've tried while building protobuf-v28.3 under Bazel
6.5.0.test_{runner,scalafmt_helper}, add diagnostic env vars, and improve test_cross_build performance (#1646)1 parent f758956 commit d43ae0d
File tree
3 files changed
+64
-35
lines changed- test/shell
3 files changed
+64
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | | - | |
18 | | - | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
65 | 74 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
69 | 86 | | |
70 | 87 | | |
71 | 88 | | |
72 | | - | |
73 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
74 | 93 | | |
75 | 94 | | |
76 | 95 | | |
77 | 96 | | |
78 | 97 | | |
79 | 98 | | |
80 | | - | |
| 99 | + | |
81 | 100 | | |
82 | 101 | | |
83 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
18 | | - | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
24 | 26 | | |
25 | | - | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
34 | | - | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | | - | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | | - | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | | - | |
| 59 | + | |
57 | 60 | | |
0 commit comments