aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/vcs
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-07-01 17:41:15 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-07-02 10:56:05 +0200
commit39ffeee9d8f9f2d27899311d06591a7ffaba3b26 (patch)
tree00980993d555840f2221a3e5e43a498285d4ac92 /pkg/vcs
parent85317734479539f614252c79b1e5c1445eedf8a7 (diff)
pkg/bisect: improve config minimization tests
Change a test to actually produce a new config as it is supposed to do during config minimization and check the resulting config. Add a regression test for the bug where we committed a broken config.
Diffstat (limited to 'pkg/vcs')
-rw-r--r--pkg/vcs/testos.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/vcs/testos.go b/pkg/vcs/testos.go
index c8746a684..ea369f529 100644
--- a/pkg/vcs/testos.go
+++ b/pkg/vcs/testos.go
@@ -30,8 +30,14 @@ func (ctx *testos) EnvForCommit(binDir, commit string, kernelConfig []byte) (*Bi
func (ctx *testos) Minimize(original, baseline []byte, trace io.Writer,
pred func(test []byte) (BisectResult, error)) ([]byte, error) {
- if string(baseline) == "minimize-fails" {
+ switch string(baseline) {
+ case "minimize-fails":
return nil, fmt.Errorf("minimization failure")
+ case "minimize-succeeds":
+ return []byte("new-minimized-config"), nil
+ case "baseline-broken-build":
+ return []byte("broken-build"), nil
+ default:
+ return original, nil
}
- return original, nil
}