diff options
author | Michael Pratt <mpratt@google.com> | 2020-06-15 13:34:33 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-06-15 13:36:24 -0700 |
commit | 885605c5e412f9ced42766094368c86be1002cff (patch) | |
tree | 86b4ae8c4760406cb3aaad92092e1b8fa605ceb4 /test | |
parent | eb6d3d7710946c39d0ffb6e0a6307e0c2f3bd135 (diff) |
Remove blacklist from //test/runtimes
Updates #2972
PiperOrigin-RevId: 316534165
Diffstat (limited to 'test')
-rw-r--r-- | test/runtimes/BUILD | 10 | ||||
-rw-r--r-- | test/runtimes/defs.bzl | 22 | ||||
-rw-r--r-- | test/runtimes/exclude_go1.12.csv (renamed from test/runtimes/blacklist_go1.12.csv) | 0 | ||||
-rw-r--r-- | test/runtimes/exclude_java11.csv (renamed from test/runtimes/blacklist_java11.csv) | 0 | ||||
-rw-r--r-- | test/runtimes/exclude_nodejs12.4.0.csv (renamed from test/runtimes/blacklist_nodejs12.4.0.csv) | 0 | ||||
-rw-r--r-- | test/runtimes/exclude_php7.3.6.csv (renamed from test/runtimes/blacklist_php7.3.6.csv) | 0 | ||||
-rw-r--r-- | test/runtimes/exclude_python3.7.3.csv (renamed from test/runtimes/blacklist_python3.7.3.csv) | 0 | ||||
-rw-r--r-- | test/runtimes/runner/BUILD | 4 | ||||
-rw-r--r-- | test/runtimes/runner/exclude_test.go (renamed from test/runtimes/runner/blacklist_test.go) | 10 | ||||
-rw-r--r-- | test/runtimes/runner/main.go | 38 |
10 files changed, 42 insertions, 42 deletions
diff --git a/test/runtimes/BUILD b/test/runtimes/BUILD index 4cd627222..022de5ff7 100644 --- a/test/runtimes/BUILD +++ b/test/runtimes/BUILD @@ -4,30 +4,30 @@ package(licenses = ["notice"]) runtime_test( name = "go1.12", - blacklist_file = "blacklist_go1.12.csv", + exclude_file = "exclude_go1.12.csv", lang = "go", ) runtime_test( name = "java11", - blacklist_file = "blacklist_java11.csv", + exclude_file = "exclude_java11.csv", lang = "java", ) runtime_test( name = "nodejs12.4.0", - blacklist_file = "blacklist_nodejs12.4.0.csv", + exclude_file = "exclude_nodejs12.4.0.csv", lang = "nodejs", ) runtime_test( name = "php7.3.6", - blacklist_file = "blacklist_php7.3.6.csv", + exclude_file = "exclude_php7.3.6.csv", lang = "php", ) runtime_test( name = "python3.7.3", - blacklist_file = "blacklist_python3.7.3.csv", + exclude_file = "exclude_python3.7.3.csv", lang = "python", ) diff --git a/test/runtimes/defs.bzl b/test/runtimes/defs.bzl index f836dd952..dc3667f05 100644 --- a/test/runtimes/defs.bzl +++ b/test/runtimes/defs.bzl @@ -10,10 +10,10 @@ def _runtime_test_impl(ctx): "--image", ctx.attr.image, ] - if ctx.attr.blacklist_file: + if ctx.attr.exclude_file: args += [ - "--blacklist_file", - ctx.files.blacklist_file[0].short_path, + "--exclude_file", + ctx.files.exclude_file[0].short_path, ] # Build a runner. @@ -28,7 +28,7 @@ def _runtime_test_impl(ctx): return [DefaultInfo( executable = runner, runfiles = ctx.runfiles( - files = ctx.files._runner + ctx.files.blacklist_file + ctx.files._proctor, + files = ctx.files._runner + ctx.files.exclude_file + ctx.files._proctor, collect_default = True, collect_data = True, ), @@ -43,7 +43,7 @@ _runtime_test = rule( "lang": attr.string( mandatory = True, ), - "blacklist_file": attr.label( + "exclude_file": attr.label( mandatory = False, allow_single_file = True, ), @@ -68,12 +68,12 @@ def runtime_test(name, **kwargs): **kwargs ) -def blacklist_test(name, blacklist_file): - """Test that a blacklist parses correctly.""" +def exclude_test(name, exclude_file): + """Test that a exclude file parses correctly.""" go_test( - name = name + "_blacklist_test", + name = name + "_exclude_test", library = ":runner", - srcs = ["blacklist_test.go"], - args = ["--blacklist_file", "test/runtimes/" + blacklist_file], - data = [blacklist_file], + srcs = ["exclude_test.go"], + args = ["--exclude_file", "test/runtimes/" + exclude_file], + data = [exclude_file], ) diff --git a/test/runtimes/blacklist_go1.12.csv b/test/runtimes/exclude_go1.12.csv index 8c8ae0c5d..8c8ae0c5d 100644 --- a/test/runtimes/blacklist_go1.12.csv +++ b/test/runtimes/exclude_go1.12.csv diff --git a/test/runtimes/blacklist_java11.csv b/test/runtimes/exclude_java11.csv index c012e5a56..c012e5a56 100644 --- a/test/runtimes/blacklist_java11.csv +++ b/test/runtimes/exclude_java11.csv diff --git a/test/runtimes/blacklist_nodejs12.4.0.csv b/test/runtimes/exclude_nodejs12.4.0.csv index 4ab4e2927..4ab4e2927 100644 --- a/test/runtimes/blacklist_nodejs12.4.0.csv +++ b/test/runtimes/exclude_nodejs12.4.0.csv diff --git a/test/runtimes/blacklist_php7.3.6.csv b/test/runtimes/exclude_php7.3.6.csv index 456bf7487..456bf7487 100644 --- a/test/runtimes/blacklist_php7.3.6.csv +++ b/test/runtimes/exclude_php7.3.6.csv diff --git a/test/runtimes/blacklist_python3.7.3.csv b/test/runtimes/exclude_python3.7.3.csv index 2b9947212..2b9947212 100644 --- a/test/runtimes/blacklist_python3.7.3.csv +++ b/test/runtimes/exclude_python3.7.3.csv diff --git a/test/runtimes/runner/BUILD b/test/runtimes/runner/BUILD index 63924b9c5..3972244b9 100644 --- a/test/runtimes/runner/BUILD +++ b/test/runtimes/runner/BUILD @@ -14,8 +14,8 @@ go_binary( ) go_test( - name = "blacklist_test", + name = "exclude_test", size = "small", - srcs = ["blacklist_test.go"], + srcs = ["exclude_test.go"], library = ":runner", ) diff --git a/test/runtimes/runner/blacklist_test.go b/test/runtimes/runner/exclude_test.go index 0ff69ab18..c08755894 100644 --- a/test/runtimes/runner/blacklist_test.go +++ b/test/runtimes/runner/exclude_test.go @@ -25,13 +25,13 @@ func TestMain(m *testing.M) { os.Exit(m.Run()) } -// Test that the blacklist parses without error. +// Test that the exclude file parses without error. func TestBlacklists(t *testing.T) { - bl, err := getBlacklist() + ex, err := getExcludes() if err != nil { - t.Fatalf("error parsing blacklist: %v", err) + t.Fatalf("error parsing exclude file: %v", err) } - if *blacklistFile != "" && len(bl) == 0 { - t.Errorf("got empty blacklist for file %q", *blacklistFile) + if *excludeFile != "" && len(ex) == 0 { + t.Errorf("got empty excludes for file %q", *excludeFile) } } diff --git a/test/runtimes/runner/main.go b/test/runtimes/runner/main.go index 57540e00e..7989dca84 100644 --- a/test/runtimes/runner/main.go +++ b/test/runtimes/runner/main.go @@ -31,9 +31,9 @@ import ( ) var ( - lang = flag.String("lang", "", "language runtime to test") - image = flag.String("image", "", "docker image with runtime tests") - blacklistFile = flag.String("blacklist_file", "", "file containing blacklist of tests to exclude, in CSV format with fields: test name, bug id, comment") + lang = flag.String("lang", "", "language runtime to test") + image = flag.String("image", "", "docker image with runtime tests") + excludeFile = flag.String("exclude_file", "", "file containing list of tests to exclude, in CSV format with fields: test name, bug id, comment") ) // Wait time for each test to run. @@ -52,10 +52,10 @@ func main() { // defered functions before exiting. It returns an exit code that should be // passed to os.Exit. func runTests() int { - // Get tests to blacklist. - blacklist, err := getBlacklist() + // Get tests to exclude.. + excludes, err := getExcludes() if err != nil { - fmt.Fprintf(os.Stderr, "Error getting blacklist: %s\n", err.Error()) + fmt.Fprintf(os.Stderr, "Error getting exclude list: %s\n", err.Error()) return 1 } @@ -66,7 +66,7 @@ func runTests() int { // Get a slice of tests to run. This will also start a single Docker // container that will be used to run each test. The final test will // stop the Docker container. - tests, err := getTests(d, blacklist) + tests, err := getTests(d, excludes) if err != nil { fmt.Fprintf(os.Stderr, "%s\n", err.Error()) return 1 @@ -77,7 +77,7 @@ func runTests() int { } // getTests executes all tests as table tests. -func getTests(d *dockerutil.Docker, blacklist map[string]struct{}) ([]testing.InternalTest, error) { +func getTests(d *dockerutil.Docker, excludes map[string]struct{}) ([]testing.InternalTest, error) { // Start the container. d.CopyFiles("/proctor", "test/runtimes/proctor/proctor") if err := d.Spawn(dockerutil.RunOpts{ @@ -108,9 +108,9 @@ func getTests(d *dockerutil.Docker, blacklist map[string]struct{}) ([]testing.In itests = append(itests, testing.InternalTest{ Name: tc, F: func(t *testing.T) { - // Is the test blacklisted? - if _, ok := blacklist[tc]; ok { - t.Skipf("SKIP: blacklisted test %q", tc) + // Is the test excluded? + if _, ok := excludes[tc]; ok { + t.Skipf("SKIP: excluded test %q", tc) } var ( @@ -143,14 +143,14 @@ func getTests(d *dockerutil.Docker, blacklist map[string]struct{}) ([]testing.In return itests, nil } -// getBlacklist reads the blacklist file and returns a set of test names to +// getBlacklist reads the exclude file and returns a set of test names to // exclude. -func getBlacklist() (map[string]struct{}, error) { - blacklist := make(map[string]struct{}) - if *blacklistFile == "" { - return blacklist, nil +func getExcludes() (map[string]struct{}, error) { + excludes := make(map[string]struct{}) + if *excludeFile == "" { + return excludes, nil } - f, err := os.Open(*blacklistFile) + f, err := os.Open(*excludeFile) if err != nil { return nil, err } @@ -171,9 +171,9 @@ func getBlacklist() (map[string]struct{}, error) { if err != nil { return nil, err } - blacklist[record[0]] = struct{}{} + excludes[record[0]] = struct{}{} } - return blacklist, nil + return excludes, nil } // testDeps implements testing.testDeps (an unexported interface), and is |