Skip to content

Commit 1a79c2f

Browse files
authored
Merge pull request #289 from m-lab/validation
Fix validation
2 parents 773ca2e + 27ca7ea commit 1a79c2f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

etl/etl_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func TestValidation(t *testing.T) {
1111
// These should fail:
1212
// Leading character before gs://
1313
_, err := etl.ValidateTestPath(
14-
`xgs://m-lab-sandbox/ndt/2016/01/26/20160126T000000Z-mlab1-prg01-ndt-0007.tgz`)
14+
`xgs://m-lab-sandbox/ndt/2016/01/26/20160126T123456Z-mlab1-prg01-ndt-0007.tgz`)
1515
if err == nil {
1616
t.Error("Should be invalid: ")
1717
}
@@ -35,12 +35,12 @@ func TestValidation(t *testing.T) {
3535
t.Error(err)
3636
}
3737
data, err = etl.ValidateTestPath(
38-
`gs://m-lab-sandbox/ndt/2016/07/14/20160714T000000Z-mlab1-lax04-ndt-0001.tar`)
38+
`gs://m-lab-sandbox/ndt/2016/07/14/20160714T123456Z-mlab1-lax04-ndt-0001.tar`)
3939
if err != nil {
4040
t.Error(err)
4141
}
4242
data, err = etl.ValidateTestPath(
43-
`gs://m-lab-sandbox/ndt/2016/07/14/20160714T000000Z-mlab1-lax04-ndt-0001.tar.gz`)
43+
`gs://m-lab-sandbox/ndt/2016/07/14/20160714T123456Z-mlab1-lax04-ndt-0001.tar.gz`)
4444
if err != nil {
4545
t.Error(err)
4646
}

etl/globals.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
const start = `^gs://(?P<prefix>.*)/(?P<exp>[^/]*)/`
99
const datePath = `(?P<datepath>\d{4}/[01]\d/[0123]\d)/`
10-
const dateTime = `(\d{4}[01]\d[0123]\d)T000000Z`
10+
const dateTime = `(\d{4}[01]\d[0123]\d)T\d{6}Z`
1111
const mlabN_podNN = `-(mlab\d)-([[:alpha:]]{3}\d[0-9t])-`
1212
const exp_NNNN = `(.*)-(\d{4})`
1313
const suffix = `(?:\.tar|\.tar.gz|\.tgz)$`
@@ -18,7 +18,7 @@ var (
1818
// This matches any valid test file name, and some invalid ones.
1919
TaskPattern = regexp.MustCompile(start + // #1 #2
2020
datePath + // #3 - YYYY/MM/DD
21-
dateTime + // #4 - YYYYMMDDT000000Z
21+
dateTime + // #4 - YYYYMMDDTHHMMSSZ
2222
mlabN_podNN + // #5 #6 - e.g. -mlab1-lax04-
2323
exp_NNNN + // #7 #8 e.g. ndt-0001
2424
suffix) // #9 typically .tgz

0 commit comments

Comments
 (0)