Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set TestData object to allow more tests to run #474

Merged
merged 25 commits into from
Jun 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
b1ron committed Jun 8, 2023
commit fc0ec257cf8fbb7fb6baf360653cd129a9055240
6 changes: 5 additions & 1 deletion internal/jstest/jstest.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ func runShellWithScript(dir, script string) ([]byte, error) {
}

dockerArgs := []string{"compose", "run", "-T", "--rm", "mongo"}
shellArgs := []string{"--verbose", "--norc", "mongodb://host.docker.internal:27017/", "--eval", evalBuilder(script, nil), script}
shellArgs := []string{
"--verbose", "--norc", "mongodb://host.docker.internal:27017/",
"--eval", evalBuilder(script, nil), script,
}
dockerArgs = append(dockerArgs, shellArgs...)

cmd := exec.Command(bin, dockerArgs...)
Expand All @@ -169,6 +172,7 @@ func evalBuilder(script string, obj map[string]string) string {
eb.WriteByte(' ')
scriptName := filepath.Base(script)
fmt.Fprintf(&eb, "TestData.testName = %q;", strings.TrimSuffix(scriptName, filepath.Ext(scriptName)))

if obj == nil {
return eb.String()
}
Expand Down