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
break
  • Loading branch information
b1ron committed Jun 8, 2023
commit 1213116ff1cfab8965844600186548651ae3dae4
11 changes: 10 additions & 1 deletion internal/jstest/jstest.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ 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,
"--eval", evalBuilder(script, map[string]string{"foo": "bar"}), script,
}
dockerArgs = append(dockerArgs, shellArgs...)

Expand All @@ -179,8 +179,17 @@ func evalBuilder(script string, obj map[string]string) string {

eb.WriteByte(' ')

// avoids extraneous space
AlekSi marked this conversation as resolved.
Show resolved Hide resolved
i := len(obj) - 1

for key, value := range obj {
fmt.Fprintf(&eb, "TestData.%s = %s;", key, value)
AlekSi marked this conversation as resolved.
Show resolved Hide resolved

if i == 0 {
break
}
i--

eb.WriteByte(' ')
}

Expand Down