mirror of
https://github.com/rclone/rclone
synced 2024-12-17 06:25:56 +01:00
test_all: add ignoretests parameter for skipping certain tests
Use like this for a `backend:` in `config.yaml` ignoretests: - "fs/operations" - "fs/sync"
This commit is contained in:
parent
cb9f4f8461
commit
84cebb6872
@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"slices"
|
||||
|
||||
"github.com/rclone/rclone/fs"
|
||||
yaml "gopkg.in/yaml.v2"
|
||||
@ -35,6 +36,7 @@ type Backend struct {
|
||||
CleanUp bool // when running clean, run cleanup first
|
||||
Ignore []string // test names to ignore the failure of
|
||||
Tests []string // paths of tests to run, blank for all
|
||||
IgnoreTests []string // paths of tests not to run, blank for none
|
||||
ListRetries int // -list-retries if > 0
|
||||
ExtraTime float64 // factor to multiply the timeout by
|
||||
}
|
||||
@ -42,15 +44,15 @@ type Backend struct {
|
||||
// includeTest returns true if this backend should be included in this
|
||||
// test
|
||||
func (b *Backend) includeTest(t *Test) bool {
|
||||
// Is this test ignored
|
||||
if slices.Contains(b.IgnoreTests, t.Path) {
|
||||
return false
|
||||
}
|
||||
// Empty b.Tests imples do all of them except the ignored
|
||||
if len(b.Tests) == 0 {
|
||||
return true
|
||||
}
|
||||
for _, testPath := range b.Tests {
|
||||
if testPath == t.Path {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(b.Tests, t.Path)
|
||||
}
|
||||
|
||||
// MakeRuns creates Run objects the Backend and Test
|
||||
|
Loading…
Reference in New Issue
Block a user