mirror of
https://github.com/google/nomulus.git
synced 2025-07-10 21:23:22 +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
|
@ -97,6 +97,10 @@ sourceSets {
|
|||
}
|
||||
}
|
||||
|
||||
processTestResources {
|
||||
exclude '**/webdriver/*'
|
||||
}
|
||||
|
||||
configurations {
|
||||
css
|
||||
jaxb
|
||||
|
@ -140,6 +144,8 @@ dependencies {
|
|||
"${rootDir}/third_party/objectify/v4_1/objectify-4.1.3.jar")
|
||||
testImplementation project(':third_party')
|
||||
|
||||
testRuntime files(sourceSets.test.resources.srcDirs)
|
||||
|
||||
compile deps['com.beust:jcommander']
|
||||
compile deps['com.google.api-client:google-api-client']
|
||||
maybeRuntime deps['com.google.api-client:google-api-client-appengine']
|
||||
|
|
|
@ -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