From df37c7f1199ac2f4e3aff7bf2cbfb9a56d8eef41 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 30 May 2023 15:14:09 +0200 Subject: dashboard: amend configs during tree origin testing There are cases when e.g. an LTS kernel does not build if provided with some downstream kernel config. Introduce a special AppendConfig option to KernelRepo that can help in this case. --- dashboard/app/tree_test.go | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'dashboard/app/tree_test.go') diff --git a/dashboard/app/tree_test.go b/dashboard/app/tree_test.go index 8ffcfdc07..30637c91b 100644 --- a/dashboard/app/tree_test.go +++ b/dashboard/app/tree_test.go @@ -633,6 +633,55 @@ var downstreamUpstreamBackports = []KernelRepo{ }, } +func TestTreeConfigAppend(t *testing.T) { + c := NewCtx(t) + defer c.Close() + + ctx := setUpTreeTest(c, []KernelRepo{ + { + URL: `https://downstream.repo/repo`, + Branch: `master`, + Alias: `downstream`, + CommitInflow: []KernelRepoLink{ + { + Alias: `lts`, + Merge: true, + }, + }, + LabelIntroduced: `downstream`, + }, + { + URL: `https://lts.repo/repo`, + Branch: `lts-master`, + Alias: `lts`, + LabelIntroduced: `lts`, + AppendConfig: "\nCONFIG_TEST=y", + }, + }) + ctx.uploadBug(`https://downstream.repo/repo`, `master`, dashapi.ReproLevelC) + ctx.entries = []treeTestEntry{ + { + alias: `downstream`, + results: []treeTestEntryPeriod{{fromDay: 0, result: treeTestCrash}}, + }, + { + alias: `lts`, + mergeAlias: `downstream`, + results: []treeTestEntryPeriod{{fromDay: 0, result: treeTestCrash}}, + }, + } + ctx.jobTestDays = []int{10} + tested := false + ctx.validateJob = func(resp *dashapi.JobPollResp) { + if resp.KernelBranch == "lts-master" { + tested = true + assert.Contains(t, string(resp.KernelConfig), "\nCONFIG_TEST=y") + } + } + ctx.moveToDay(10) + assert.True(t, tested) +} + func setUpTreeTest(ctx *Ctx, repos []KernelRepo) *treeTestCtx { ret := &treeTestCtx{ ctx: ctx, @@ -653,6 +702,7 @@ type treeTestCtx struct { perAlias map[string]KernelRepo jobTestDays []int manager string + validateJob func(*dashapi.JobPollResp) } func (ctx *treeTestCtx) now() time.Time { @@ -728,6 +778,9 @@ func (ctx *treeTestCtx) moveToDay(tillDay int) { if pollResp.ID == "" { break } + if ctx.validateJob != nil { + ctx.validateJob(pollResp) + } ctx.ctx.advanceTime(time.Minute) ctx.doJob(pollResp, seqDay) } -- cgit mrf-deployment