summaryrefslogtreecommitdiffhomepage
path: root/test/runtimes/nodejs
diff options
context:
space:
mode:
authorBrett Landau <brettlandau@google.com>2019-07-31 16:28:43 -0700
committergVisor bot <gvisor-bot@google.com>2019-07-31 16:30:07 -0700
commit77833ece3b6db2c7b3f2e33a9b8da3f9fd9b990b (patch)
treedbe06af2fdc3fe20649fb7d59a0296c17ef97fd7 /test/runtimes/nodejs
parentcbe145247a748177e62b268f402cbe76e5b1ca35 (diff)
Fix test execution bugs in proctor-go and proctor-python.
proctor-go had a bug where it would incorrectly identify a tool test as a disk test. Instead of searching for the test on disk as the identification method, we now check if the test name ends in ".go". If the test ends in ".go" it is run as a disk test, otherwise the test is run as a tool test. Python tests need to be run from within the directory they exist. Functionality to split the test name from it's parent directory has been added and a cmd.Dir argument has been set. PiperOrigin-RevId: 261021693
Diffstat (limited to 'test/runtimes/nodejs')
-rw-r--r--test/runtimes/nodejs/proctor-nodejs.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/runtimes/nodejs/proctor-nodejs.go b/test/runtimes/nodejs/proctor-nodejs.go
index 468025682..0885516e9 100644
--- a/test/runtimes/nodejs/proctor-nodejs.go
+++ b/test/runtimes/nodejs/proctor-nodejs.go
@@ -28,6 +28,7 @@ import (
var (
dir = os.Getenv("LANG_DIR")
+ testDir = filepath.Join(dir, "test")
testRegEx = regexp.MustCompile(`^test-.+\.js$`)
)
@@ -42,16 +43,15 @@ func main() {
func (n nodejsRunner) ListTests() ([]string, error) {
var testSlice []string
- root := filepath.Join(dir, "test")
- err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
+ err := filepath.Walk(testDir, func(path string, info os.FileInfo, err error) error {
name := filepath.Base(path)
if info.IsDir() || !testRegEx.MatchString(name) {
return nil
}
- relPath, err := filepath.Rel(root, path)
+ relPath, err := filepath.Rel(testDir, path)
if err != nil {
return err
}
@@ -60,7 +60,7 @@ func (n nodejsRunner) ListTests() ([]string, error) {
})
if err != nil {
- return nil, fmt.Errorf("walking %q: %v", root, err)
+ return nil, fmt.Errorf("walking %q: %v", testDir, err)
}
return testSlice, nil