mirror of
https://github.com/google/nomulus.git
synced 2025-07-10 05:03:24 +02:00
Read golden images from src directly (#159)
This PR prevents Gradle from copying the golden images to build/resources/test, so the screenshot test would read golden images from src/test/resources directly and display the path in test log if the test fails. Because the path pointing to the actual file in src/ folder, the engineer can easily find it.
This commit is contained in:
parent
730f108e13
commit
8dd6797614
2 changed files with 15 additions and 1 deletions
|
@ -141,7 +141,15 @@ public class RepeatableRunner extends BlockJUnit4ClassRunner {
|
|||
int numSuccess = 0, numFailure = 0;
|
||||
Throwable lastException = null;
|
||||
for (int attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
|
||||
attemptNumber.set(attempt);
|
||||
// attemptNumber would be null if any exception happens during the
|
||||
// instantiation of test class object(including test rules). However,
|
||||
// those exceptions would not be actually thrown until statement.evaluate()
|
||||
// is invoked. So, we should just skip the setter and let the statement
|
||||
// be evaluated. Then we should be able to find the stack trace of
|
||||
// root cause in the test reports.
|
||||
if (attemptNumber != null) {
|
||||
attemptNumber.set(attempt);
|
||||
}
|
||||
try {
|
||||
statement.evaluate();
|
||||
numSuccess++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue