mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
test_all: make a way of ignoring integration test failures
Use this to ignore known failures
This commit is contained in:
@@ -45,6 +45,7 @@ type Run struct {
|
||||
NoRetries bool // don't retry if set
|
||||
OneOnly bool // only run test for this backend at once
|
||||
NoBinary bool // set to not build a binary
|
||||
Ignore map[string]struct{}
|
||||
// Internals
|
||||
cmdLine []string
|
||||
cmdString string
|
||||
@@ -138,9 +139,15 @@ func (r *Run) findFailures() {
|
||||
oldFailedTests := r.failedTests
|
||||
r.failedTests = nil
|
||||
excludeParents := map[string]struct{}{}
|
||||
ignored := 0
|
||||
for _, matches := range failRe.FindAllSubmatch(r.output, -1) {
|
||||
failedTest := string(matches[1])
|
||||
r.failedTests = append(r.failedTests, failedTest)
|
||||
// Skip any ignored failures
|
||||
if _, found := r.Ignore[failedTest]; found {
|
||||
ignored++
|
||||
} else {
|
||||
r.failedTests = append(r.failedTests, failedTest)
|
||||
}
|
||||
// Find all the parents of this test
|
||||
parts := strings.Split(failedTest, "/")
|
||||
for i := len(parts) - 1; i >= 1; i-- {
|
||||
@@ -155,6 +162,12 @@ func (r *Run) findFailures() {
|
||||
}
|
||||
}
|
||||
r.failedTests = newTests
|
||||
if len(r.failedTests) == 0 && ignored > 0 {
|
||||
log.Printf("%q - Found %d ignored errors only - marking as good", r.cmdString, ignored)
|
||||
r.err = nil
|
||||
r.dumpOutput()
|
||||
return
|
||||
}
|
||||
if len(r.failedTests) != 0 {
|
||||
r.runFlag = testsToRegexp(r.failedTests)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user