Skip to content

Commit

Permalink
DEVPROD-746 Delete unused bvtu level exec timeout (#7438)
Browse files Browse the repository at this point in the history
  • Loading branch information
bynn authored Jan 25, 2024
1 parent 871b5ef commit e90bc45
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 61 deletions.
1 change: 0 additions & 1 deletion docs/Project-Configuration/Project-Configuration-Files.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ buildvariants:
- name: compile
- name: passing_test
variant: osx-108
exec_timeout_secs: 20
priority: 10
batchtime: 20 // overrides build variant batchtime of 60
- name: failing_test
Expand Down
13 changes: 6 additions & 7 deletions model/lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2450,13 +2450,12 @@ func TestCreateTasksFromGroup(t *testing.T) {
const tgName = "name"
const bvName = "first_build_variant"
in := BuildVariantTaskUnit{
Name: tgName,
IsGroup: true,
Variant: bvName,
Priority: 0,
DependsOn: []TaskUnitDependency{{Name: "new_dependency"}},
RunOn: []string{},
ExecTimeoutSecs: 0,
Name: tgName,
IsGroup: true,
Variant: bvName,
Priority: 0,
DependsOn: []TaskUnitDependency{{Name: "new_dependency"}},
RunOn: []string{},
}
p := &Project{
BuildVariants: []BuildVariant{
Expand Down
11 changes: 2 additions & 9 deletions model/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ type BuildVariantTaskUnit struct {
DependsOn []TaskUnitDependency `yaml:"depends_on,omitempty" bson:"depends_on"`

// the distros that the task can be run on
RunOn []string `yaml:"run_on,omitempty" bson:"run_on"`
// currently unsupported (TODO EVG-578)
ExecTimeoutSecs int `yaml:"exec_timeout_secs,omitempty" bson:"exec_timeout_secs"`
Stepback *bool `yaml:"stepback,omitempty" bson:"stepback,omitempty"`
RunOn []string `yaml:"run_on,omitempty" bson:"run_on"`
Stepback *bool `yaml:"stepback,omitempty" bson:"stepback,omitempty"`

CommitQueueMerge bool `yaml:"commit_queue_merge,omitempty" bson:"commit_queue_merge"`

Expand Down Expand Up @@ -223,10 +221,6 @@ func (bvt *BuildVariantTaskUnit) Populate(pt ProjectTask, bv BuildVariant) {
if len(bvt.AllowedRequesters) == 0 {
bvt.AllowedRequesters = pt.AllowedRequesters
}
// TODO these are copied but unused until EVG-578 is completed
if bvt.ExecTimeoutSecs == 0 {
bvt.ExecTimeoutSecs = pt.ExecTimeoutSecs
}
if bvt.Stepback == nil {
bvt.Stepback = pt.Stepback
}
Expand Down Expand Up @@ -1659,7 +1653,6 @@ func (p *Project) tasksFromGroup(bvTaskGroup BuildVariantTaskUnit) []BuildVarian
Priority: bvTaskGroup.Priority,
DependsOn: bvTaskGroup.DependsOn,
RunOn: bvTaskGroup.RunOn,
ExecTimeoutSecs: bvTaskGroup.ExecTimeoutSecs,
Stepback: bvTaskGroup.Stepback,
Activate: bvTaskGroup.Activate,
CommitQueueMerge: bvTaskGroup.CommitQueueMerge,
Expand Down
4 changes: 0 additions & 4 deletions model/project_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,6 @@ func getParserBuildVariantTaskUnit(name string, pt parserTask, bvt parserBVTaskU
AllowForGitTag: bvt.AllowForGitTag,
GitTagOnly: bvt.GitTagOnly,
Priority: bvt.Priority,
ExecTimeoutSecs: bvt.ExecTimeoutSecs,
Stepback: bvt.Stepback,
RunOn: bvt.RunOn,
CommitQueueMerge: bvt.CommitQueueMerge,
Expand Down Expand Up @@ -1430,9 +1429,6 @@ func getParserBuildVariantTaskUnit(name string, pt parserTask, bvt parserBVTaskU
if len(res.AllowedRequesters) == 0 {
res.AllowedRequesters = pt.AllowedRequesters
}
if res.ExecTimeoutSecs == 0 {
res.ExecTimeoutSecs = pt.ExecTimeoutSecs
}
if res.Stepback == nil {
res.Stepback = pt.Stepback
}
Expand Down
2 changes: 0 additions & 2 deletions model/project_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ func TestTranslateTasks(t *testing.T) {
assert.Equal(t, "bv0", out.BuildVariants[0].Name)
require.Len(t, out.BuildVariants[0].Tasks, 3)
assert.Equal(t, "my_task", out.BuildVariants[0].Tasks[0].Name)
assert.Equal(t, 30, out.BuildVariants[0].Tasks[0].ExecTimeoutSecs)
assert.True(t, utility.FromBoolPtr(out.BuildVariants[0].Tasks[0].PatchOnly))
assert.Equal(t, "your_task", out.BuildVariants[0].Tasks[1].Name)
assert.True(t, utility.FromBoolPtr(out.BuildVariants[0].Tasks[1].GitTagOnly))
Expand All @@ -456,7 +455,6 @@ func TestTranslateTasks(t *testing.T) {
assert.Equal(t, "my_tg", bvt.Name)
assert.Nil(t, bvt.PatchOnly)
assert.Contains(t, bvt.RunOn, "my_distro")
assert.Equal(t, 20, bvt.ExecTimeoutSecs)
assert.True(t, bvt.IsGroup)
assert.False(t, bvt.IsPartOfGroup)
assert.Zero(t, bvt.GroupName)
Expand Down
11 changes: 4 additions & 7 deletions model/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ func TestPopulateBVT(t *testing.T) {

Convey("should inherit the unset fields from the Project", func() {
So(bvt.Name, ShouldEqual, "task1")
So(bvt.ExecTimeoutSecs, ShouldEqual, 500)
So(bvt.Stepback, ShouldNotBeNil)
So(bvt.Patchable, ShouldNotBeNil)
So(len(bvt.DependsOn), ShouldEqual, 1)
Expand All @@ -200,11 +199,10 @@ func TestPopulateBVT(t *testing.T) {

Convey("updating a BuildVariantTaskUnit with set fields", func() {
bvt := BuildVariantTaskUnit{
Name: "task1",
Variant: "bv",
ExecTimeoutSecs: 2,
Stepback: utility.TruePtr(),
DependsOn: []TaskUnitDependency{{Name: "task2"}, {Name: "task3"}},
Name: "task1",
Variant: "bv",
Stepback: utility.TruePtr(),
DependsOn: []TaskUnitDependency{{Name: "task2"}, {Name: "task3"}},
}
projectTask := project.FindProjectTask("task1")
So(projectTask, ShouldNotBeNil)
Expand All @@ -213,7 +211,6 @@ func TestPopulateBVT(t *testing.T) {

Convey("should not inherit set fields from the Project", func() {
So(bvt.Name, ShouldEqual, "task1")
So(bvt.ExecTimeoutSecs, ShouldEqual, 2)
So(bvt.Stepback, ShouldNotBeNil)
So(*bvt.Stepback, ShouldBeTrue)
So(len(bvt.DependsOn), ShouldEqual, 2)
Expand Down
51 changes: 20 additions & 31 deletions validator/project_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4519,14 +4519,12 @@ func TestTVToTaskUnit(t *testing.T) {
"MapsTasksAndPopulates": {
expectedTVToTaskUnit: map[model.TVPair]model.BuildVariantTaskUnit{
{TaskName: "setup", Variant: "rhel"}: {
Name: "setup",
Variant: "rhel",
Priority: 20,
ExecTimeoutSecs: 20,
Name: "setup",
Variant: "rhel",
Priority: 20,
}, {TaskName: "compile", Variant: "ubuntu"}: {
Name: "compile",
Variant: "ubuntu",
ExecTimeoutSecs: 10,
CommitQueueMerge: true,
DependsOn: []model.TaskUnitDependency{
{
Expand All @@ -4535,9 +4533,8 @@ func TestTVToTaskUnit(t *testing.T) {
},
},
}, {TaskName: "compile", Variant: "suse"}: {
Name: "compile",
Variant: "suse",
ExecTimeoutSecs: 10,
Name: "compile",
Variant: "suse",
DependsOn: []model.TaskUnitDependency{
{
Name: "setup",
Expand Down Expand Up @@ -4568,10 +4565,9 @@ func TestTVToTaskUnit(t *testing.T) {
Name: "rhel",
Tasks: []model.BuildVariantTaskUnit{
{
Name: "setup",
Variant: "rhel",
Priority: 20,
ExecTimeoutSecs: 20,
Name: "setup",
Variant: "rhel",
Priority: 20,
},
},
}, {
Expand All @@ -4581,7 +4577,6 @@ func TestTVToTaskUnit(t *testing.T) {
Name: "compile",
Variant: "ubuntu",
CommitQueueMerge: true,
ExecTimeoutSecs: 10,
DependsOn: []model.TaskUnitDependency{
{
Name: "setup",
Expand All @@ -4594,9 +4589,8 @@ func TestTVToTaskUnit(t *testing.T) {
Name: "suse",
Tasks: []model.BuildVariantTaskUnit{
{
Name: "compile",
Variant: "suse",
ExecTimeoutSecs: 10,
Name: "compile",
Variant: "suse",
DependsOn: []model.TaskUnitDependency{
{
Name: "setup",
Expand All @@ -4612,16 +4606,14 @@ func TestTVToTaskUnit(t *testing.T) {
"MapsTaskGroupTasksAndPopulates": {
expectedTVToTaskUnit: map[model.TVPair]model.BuildVariantTaskUnit{
{TaskName: "setup", Variant: "rhel"}: {
Name: "setup",
Variant: "rhel",
Priority: 20,
ExecTimeoutSecs: 20,
Name: "setup",
Variant: "rhel",
Priority: 20,
}, {TaskName: "compile", Variant: "ubuntu"}: {
Name: "compile",
Variant: "ubuntu",
IsPartOfGroup: true,
GroupName: "compile_group",
ExecTimeoutSecs: 10,
CommitQueueMerge: true,
DependsOn: []model.TaskUnitDependency{
{
Expand All @@ -4630,11 +4622,10 @@ func TestTVToTaskUnit(t *testing.T) {
},
},
}, {TaskName: "compile", Variant: "suse"}: {
Name: "compile",
Variant: "suse",
IsPartOfGroup: true,
GroupName: "compile_group",
ExecTimeoutSecs: 10,
Name: "compile",
Variant: "suse",
IsPartOfGroup: true,
GroupName: "compile_group",
DependsOn: []model.TaskUnitDependency{
{
Name: "setup",
Expand Down Expand Up @@ -4671,10 +4662,9 @@ func TestTVToTaskUnit(t *testing.T) {
Name: "rhel",
Tasks: []model.BuildVariantTaskUnit{
{
Name: "setup",
Variant: "rhel",
Priority: 20,
ExecTimeoutSecs: 20,
Name: "setup",
Variant: "rhel",
Priority: 20,
},
},
}, {
Expand Down Expand Up @@ -4720,7 +4710,6 @@ func TestTVToTaskUnit(t *testing.T) {
for _, dep := range expectedTaskUnit.DependsOn {
assert.Contains(t, taskUnit.DependsOn, dep)
}
assert.Equal(t, expectedTaskUnit.ExecTimeoutSecs, taskUnit.ExecTimeoutSecs)
assert.Equal(t, expectedTaskUnit.Stepback, taskUnit.Stepback)
assert.Equal(t, expectedTaskUnit.CommitQueueMerge, taskUnit.CommitQueueMerge, fmt.Sprintf("%s/%s", expectedTaskUnit.Variant, expectedTaskUnit.Name))
assert.Equal(t, expectedTaskUnit.Variant, taskUnit.Variant)
Expand Down

0 comments on commit e90bc45

Please sign in to comment.