-
Notifications
You must be signed in to change notification settings - Fork 17
BCDA-9089: Add IOTA file pattern to cclf parser #1319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
4dd04df
ca5330f
a2f2f5e
d234932
675c587
e9210f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -197,15 +197,16 @@ func TestValidateCSVFileName(t *testing.T) { | |
|
|
||
| func TestGetCCLFMetadata(t *testing.T) { | ||
| const ( | ||
| sspID, cecID, ngacoID, ckccID, kcfID, dcID, testID, sbxID = "A9999", "E9999", "V999", "C9999", "K9999", "D9999", "TEST999", "SBXBD001" | ||
| sspProd, sspTest = "P.BCD." + sspID, "T.BCD." + sspID | ||
| cecProd, cecTest = "P.CEC", "T.CEC" | ||
| ngacoProd, ngacoTest = "P." + ngacoID + ".ACO", "T." + ngacoID + ".ACO" | ||
| ckccProd, ckccTest = "P." + ckccID + ".ACO", "T." + ckccID + ".ACO" | ||
| kcfProd, kcfTest = "P." + kcfID + ".ACO", "T." + kcfID + ".ACO" | ||
| dcProd, dcTest = "P." + dcID + ".ACO", "T." + dcID + ".ACO" | ||
| testProd, testTest = "P." + testID + ".ACO", "T." + testID + ".ACO" | ||
| sbxProd, sbxTest = "P." + sbxID + ".ACO", "T." + sbxID + ".ACO" | ||
| sspID, iotaID, cecID, ngacoID, ckccID, kcfID, dcID, testID, sbxID = "A9999", "IOTA965", "E9999", "V999", "C9999", "K9999", "D9999", "TEST999", "SBXBD001" | ||
| sspProd, sspTest = "P.BCD." + sspID, "T.BCD." + sspID | ||
| iotaProd, iotaTest = "P.BCD." + iotaID, "T.BCD." + iotaID | ||
| cecProd, cecTest = "P.CEC", "T.CEC" | ||
| ngacoProd, ngacoTest = "P." + ngacoID + ".ACO", "T." + ngacoID + ".ACO" | ||
| ckccProd, ckccTest = "P." + ckccID + ".ACO", "T." + ckccID + ".ACO" | ||
| kcfProd, kcfTest = "P." + kcfID + ".ACO", "T." + kcfID + ".ACO" | ||
| dcProd, dcTest = "P." + dcID + ".ACO", "T." + dcID + ".ACO" | ||
| testProd, testTest = "P." + testID + ".ACO", "T." + testID + ".ACO" | ||
| sbxProd, sbxTest = "P." + sbxID + ".ACO", "T." + sbxID + ".ACO" | ||
| ) | ||
|
|
||
| start := time.Now() | ||
|
|
@@ -228,6 +229,7 @@ func TestGetCCLFMetadata(t *testing.T) { | |
| assert.NoError(t, err) | ||
| sspProdFile, sspTestFile, sspRunoutFile := gen(sspProd, validTime), gen(sspTest, validTime), | ||
| strings.Replace(gen(sspProd, validTime), "ZC8Y", "ZC8R", 1) | ||
| iotaProdFile, iotaTestFile, iotaRunoutFile := gen(iotaProd, validTime), gen(iotaTest, validTime), strings.Replace(gen(iotaProd, validTime), "ZC8Y", "ZC8R", 1) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe Im misreading but IOTAs middle section should be ZC(Y|R), as opposed to some of the others which tracks the CCLF file number (eg ZC8Y). If so, then I would expect this to fail?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also, it looks like the naming convention doesn't support a performance year. It looks like it's missing?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! I cant load jira right now but it looks like the example was
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the PR and the ticket to match new requirements -- both zip archive name and contained files should track with other cclf file conventions, with an extra "PRT" section in the latter |
||
| cecProdFile, cecTestFile := gen(cecProd, validTime), gen(cecTest, validTime) | ||
| ngacoProdFile, ngacoTestFile := gen(ngacoProd, validTime), gen(ngacoTest, validTime) | ||
| ckccProdFile, ckccTestFile := gen(ckccProd, validTime), gen(ckccTest, validTime) | ||
|
|
@@ -285,6 +287,42 @@ func TestGetCCLFMetadata(t *testing.T) { | |
| fileType: models.FileTypeRunout, | ||
| }, | ||
| }, | ||
| { | ||
| "Production IOTA file", iotaID, iotaProdFile, "", | ||
| cclfFileMetadata{ | ||
| env: "production", | ||
| name: iotaProdFile, | ||
| cclfNum: 8, | ||
| acoID: iotaID, | ||
| timestamp: validTime, | ||
| perfYear: perfYear, | ||
| fileType: models.FileTypeDefault, | ||
| }, | ||
| }, | ||
| { | ||
| "Test IOTA file", iotaID, iotaTestFile, "", | ||
| cclfFileMetadata{ | ||
| env: "test", | ||
| name: iotaTestFile, | ||
| cclfNum: 8, | ||
| acoID: iotaID, | ||
| timestamp: validTime, | ||
| perfYear: perfYear, | ||
| fileType: models.FileTypeDefault, | ||
| }, | ||
| }, | ||
| { | ||
| "Runout IOTA file", iotaID, iotaRunoutFile, "", | ||
| cclfFileMetadata{ | ||
| env: "production", | ||
| name: iotaRunoutFile, | ||
| cclfNum: 8, | ||
| acoID: iotaID, | ||
| timestamp: validTime, | ||
| perfYear: perfYear, | ||
| fileType: models.FileTypeRunout, | ||
| }, | ||
| }, | ||
| { | ||
| "Production CEC file", cecID, cecProdFile, "", | ||
| cclfFileMetadata{ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could we rename the other names to follow this convention or could we just call this variable
iota?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding to this, isn't the suffix the same as others, too?
ZC[0|8](Y|R)(\d{2})Edit: I am referring to the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"iota" is actually a keyword in golang 😓
I updated it to "iotaPrt" since it contains an additional "PRT" section