From 39ffeee9d8f9f2d27899311d06591a7ffaba3b26 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 1 Jul 2020 17:41:15 +0200 Subject: 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. --- pkg/vcs/testos.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pkg/vcs') 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 } -- cgit mrf-deployment