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

fix: make --dry=json jq and JSON.parse-friendly #894

Merged
merged 6 commits into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
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
2 changes: 0 additions & 2 deletions cli/internal/scope/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,10 @@ func ResolvePackages(opts *Opts, scm scm.SCM, ctx *context.Context, tui cli.Ui,
}
}
}
tui.Output(fmt.Sprintf(ui.Dim("• Packages changed since %s in scope: %s"), opts.Since, strings.Join(filteredPkgs.UnsafeListOfStrings(), ", ")))
} else if changedPackages.Len() > 0 {
// --since was specified, there are changes, but no scope was specified.
// Run the packages that have changed
filteredPkgs = changedPackages
tui.Output(fmt.Sprintf(ui.Dim("• Packages changed since %s: %s"), opts.Since, strings.Join(filteredPkgs.UnsafeListOfStrings(), ", ")))
} else if scopePkgs.Len() > 0 {
// There was either a global change, or no changes, or no --since flag
// There was a --scope flag, run the desired scopes
Expand Down
27 changes: 6 additions & 21 deletions cli/scripts/e2e/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,17 @@ function runSmokeTests<T>(
)
);
assert.fixture(
`• Packages changed since main: a`,
sinceCommandOutputNoCache[0],
"Calculates changed packages (--since)"
);
assert.fixture(
`• Packages in scope: a`,
sinceCommandOutputNoCache[1],
"Packages in scope"
);
assert.fixture(
sinceCommandOutputNoCache[1],
`• Running test in 1 packages`,
sinceCommandOutputNoCache[2],
"Runs only in changed packages"
);
assert.fixture(
sinceCommandOutputNoCache[3],
sinceCommandOutputNoCache[2],
`a:test: cache miss, executing ${getHashFromOutput(
sinceCommandOutputNoCache,
"a#test"
Expand All @@ -131,22 +126,17 @@ function runSmokeTests<T>(
);

assert.fixture(
`• Packages changed since main: a`,
sinceCommandOutput[0],
"Calculates changed packages (--since)"
);
assert.fixture(
`• Packages in scope: a`,
sinceCommandOutput[1],
"Packages in scope"
);
assert.fixture(
sinceCommandOutput[1],
`• Running test in 1 packages`,
sinceCommandOutput[2],
"Runs only in changed packages"
);
assert.fixture(
sinceCommandOutput[3],
sinceCommandOutput[2],
`a:test: cache miss, executing ${getHashFromOutput(
sinceCommandOutput,
"a#test"
Expand All @@ -159,23 +149,18 @@ function runSmokeTests<T>(
repo.turbo("run", ["test", "--since=main", "--stream"], options)
);
assert.equal(
`• Packages changed since main: a`,
sinceCommandSecondRunOutput[0],
"Calculates changed packages (--since) after a second run"
);
assert.equal(
`• Packages in scope: a`,
sinceCommandSecondRunOutput[1],
"Packages in scope after a second run"
);
assert.equal(
sinceCommandSecondRunOutput[1],
`• Running test in 1 packages`,
sinceCommandSecondRunOutput[2],
"Runs only in changed packages after a second run"
);

assert.fixture(
sinceCommandSecondRunOutput[3],
sinceCommandSecondRunOutput[2],
`a:test: cache hit, replaying output ${getHashFromOutput(
sinceCommandSecondRunOutput,
"a#test"
Expand Down