aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/tree_test.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-05-30 15:14:09 +0200
committerAleksandr Nogikh <wp32pw@gmail.com>2023-05-30 16:02:38 +0200
commitdf37c7f1199ac2f4e3aff7bf2cbfb9a56d8eef41 (patch)
tree71b4a2e531f3bd3745523e87206ebebee6be612c /dashboard/app/tree_test.go
parent8d5c7541d29fecb0d8adc7f44caedd9abe9c9dca (diff)
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.
Diffstat (limited to 'dashboard/app/tree_test.go')
-rw-r--r--dashboard/app/tree_test.go53
1 files changed, 53 insertions, 0 deletions
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)
}