Test normal job run log is preferred over legacy one

Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
Babak K. Shandiz 2025-04-11 12:40:26 +01:00
parent 940bd10a1d
commit 2d21b4624c
No known key found for this signature in database
GPG key ID: 9472CAEFF56C742E
2 changed files with 12 additions and 2 deletions

View file

@ -2039,8 +2039,9 @@ func TestViewRun(t *testing.T) {
// ├── 2_cool job with no step logs.txt
// ├── 3_sad job with no step logs.txt
// ├── -9999999999_legacy cool job with no step logs.txt
// └── -9999999999_legacy sad job with no step logs.txt
// ├── -9999999999_legacy sad job with no step logs.txt
// ├── 4_cool job with both legacy and new logs.txt
// └── -9999999999_cool job with both legacy and new logs.txt
func Test_attachRunLog(t *testing.T) {
tests := []struct {
name string
@ -2149,6 +2150,15 @@ func Test_attachRunLog(t *testing.T) {
wantJobFilename: "-9999999999_legacy cool job with no step logs.txt",
wantStepMatch: false,
},
{
name: "matching job name with both normal and legacy filename",
job: shared.Job{
Name: "cool job with both legacy and new logs",
},
wantJobMatch: true,
wantJobFilename: "4_cool job with both legacy and new logs.txt",
wantStepMatch: false,
},
{
name: "one job name is a suffix of another",
job: shared.Job{