Skip to content

Commit

Permalink
Complete PREMIS val config in workflow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcantelon committed Nov 8, 2024
1 parent 24a5e29 commit 3b69aed
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions internal/workflow/processing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,10 @@ func (s *ProcessingWorkflowTestSuite) TestPackageRejection() {
Storage: storage.Config{
DefaultPermanentLocationID: locationID,
},
ValidatePREMIS: premis.Config{Enabled: true},
ValidatePREMIS: premis.Config{
Enabled: true,
XSDPath: "/home/enduro/premis.xsd",
},
}
s.SetupWorkflowTest(cfg)

Expand Down Expand Up @@ -913,7 +916,7 @@ func (s *ProcessingWorkflowTestSuite) TestPackageRejection() {
)

s.env.OnActivity(xmlvalidate.Name, sessionCtx,
&xmlvalidate.Params{XMLPath: filepath.Join(transferPath, "metadata", "premis.xml"), XSDPath: ""},
&xmlvalidate.Params{XMLPath: filepath.Join(transferPath, "metadata", "premis.xml"), XSDPath: "/home/enduro/premis.xsd"},
).Return(
&xmlvalidate.Result{Failures: []string{}}, nil,
)
Expand Down Expand Up @@ -974,7 +977,10 @@ func (s *ProcessingWorkflowTestSuite) TestPreprocessingChildWorkflow() {
Storage: storage.Config{
DefaultPermanentLocationID: locationID,
},
ValidatePREMIS: premis.Config{Enabled: true},
ValidatePREMIS: premis.Config{
Enabled: true,
XSDPath: "/home/enduro/premis.xsd",
},
}
s.SetupWorkflowTest(cfg)

Expand Down Expand Up @@ -1155,7 +1161,7 @@ func (s *ProcessingWorkflowTestSuite) TestPreprocessingChildWorkflow() {
s.env.OnActivity(
xmlvalidate.Name,
sessionCtx,
&xmlvalidate.Params{XMLPath: filepath.Join(transferPath, "metadata", "premis.xml"), XSDPath: ""},
&xmlvalidate.Params{XMLPath: filepath.Join(transferPath, "metadata", "premis.xml"), XSDPath: "/home/enduro/premis.xsd"},
).Return(
&xmlvalidate.Result{Failures: []string{}}, nil,
)
Expand Down Expand Up @@ -1384,10 +1390,13 @@ func (s *ProcessingWorkflowTestSuite) TestFailedSIP() {

func (s *ProcessingWorkflowTestSuite) TestFailedPIPA3m() {
cfg := config.Configuration{
A3m: a3m.Config{ShareDir: s.CreateTransferDir()},
Preservation: pres.Config{TaskQueue: temporal.A3mWorkerTaskQueue},
Storage: storage.Config{DefaultPermanentLocationID: locationID},
ValidatePREMIS: premis.Config{Enabled: true},
A3m: a3m.Config{ShareDir: s.CreateTransferDir()},
Preservation: pres.Config{TaskQueue: temporal.A3mWorkerTaskQueue},
Storage: storage.Config{DefaultPermanentLocationID: locationID},
ValidatePREMIS: premis.Config{
Enabled: true,
XSDPath: "/home/enduro/premis.xsd",
},
}
s.SetupWorkflowTest(cfg)

Expand Down Expand Up @@ -1509,7 +1518,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPA3m() {
s.env.OnActivity(
xmlvalidate.Name,
sessionCtx,
&xmlvalidate.Params{XMLPath: filepath.Join(transferPath, "metadata", "premis.xml"), XSDPath: ""},
&xmlvalidate.Params{XMLPath: filepath.Join(transferPath, "metadata", "premis.xml"), XSDPath: "/home/enduro/premis.xsd"},
).Return(&xmlvalidate.Result{Failures: []string{}}, nil)

s.env.OnActivity(
Expand Down Expand Up @@ -1587,9 +1596,12 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPA3m() {

func (s *ProcessingWorkflowTestSuite) TestFailedPIPAM() {
cfg := config.Configuration{
Preservation: pres.Config{TaskQueue: temporal.AmWorkerTaskQueue},
Storage: storage.Config{DefaultPermanentLocationID: amssLocationID},
ValidatePREMIS: premis.Config{Enabled: true},
Preservation: pres.Config{TaskQueue: temporal.AmWorkerTaskQueue},
Storage: storage.Config{DefaultPermanentLocationID: amssLocationID},
ValidatePREMIS: premis.Config{
Enabled: true,
XSDPath: "/home/enduro/premis.xsd",
},
}
s.SetupWorkflowTest(cfg)

Expand Down Expand Up @@ -1668,7 +1680,7 @@ func (s *ProcessingWorkflowTestSuite) TestFailedPIPAM() {
s.env.OnActivity(
xmlvalidate.Name,
sessionCtx,
&xmlvalidate.Params{XMLPath: filepath.Join(extractPath, "data", "metadata", "premis.xml"), XSDPath: ""},
&xmlvalidate.Params{XMLPath: filepath.Join(extractPath, "data", "metadata", "premis.xml"), XSDPath: "/home/enduro/premis.xsd"},
).Return(&xmlvalidate.Result{Failures: []string{}}, nil)

s.env.OnActivity(
Expand Down

0 comments on commit 3b69aed

Please sign in to comment.