Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jraddaoui committed Dec 1, 2023
1 parent f992fba commit 9ed1788
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions internal/sfa/activities/extract_package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ func TestExtractPackage(t *testing.T) {
processingDir: fs.NewDir(t, ""),
wantErr: "no entry found in extracted package directory",
},
{
name: "Fails with multiple entries",
processingDir: fs.NewDir(t, "", fs.WithDir("folder1"), fs.WithDir("folder2")),
zipFolders: []string{"folder1", "folder2"},
wantErr: "more than one entry found in extracted package directory",
},
}
for _, tt := range tests {
tt := tt
Expand Down
6 changes: 3 additions & 3 deletions internal/workflow/processing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ func (s *ProcessingWorkflowTestSuite) TestAMWorkflow() {
s.env.OnActivity(activities.BundleActivityName, mock.Anything, mock.Anything).Return(&activities.BundleActivityResult{FullPath: "/tmp/transfer", FullPathBeforeStrip: "/tmp/transfer"}, nil)

// SFA-preprocessing activities.
s.env.OnActivity(sfa_activities.ExtractPackageName, sessionCtx, &sfa_activities.ExtractPackageParams{}).Return(&sfa_activities.ExtractPackageResult{}, nil).Once()
s.env.OnActivity(sfa_activities.ExtractPackageName, sessionCtx, &sfa_activities.ExtractPackageParams{Key: "transfer.tgz"}).Return(&sfa_activities.ExtractPackageResult{}, nil).Once()
s.env.OnActivity(sfa_activities.CheckSipStructureName, sessionCtx, &sfa_activities.CheckSipStructureParams{}).Return(&sfa_activities.CheckSipStructureResult{Ok: true}, nil).Once()
s.env.OnActivity(sfa_activities.AllowedFileFormatsName, sessionCtx, &sfa_activities.AllowedFileFormatsParams{}).Return(&sfa_activities.AllowedFileFormatsResult{Ok: true}, nil).Once()
s.env.OnActivity(sfa_activities.MetadataValidationName, sessionCtx, &sfa_activities.MetadataValidationParams{}).Return(&sfa_activities.MetadataValidationResult{}, nil).Once()
s.env.OnActivity(sfa_activities.SipCreationName, sessionCtx, &sfa_activities.SipCreationParams{}).Return(&sfa_activities.SipCreationResult{}, nil).Once()
s.env.OnActivity(sfa_activities.SendToFailedBucketName, sessionCtx, &sfa_activities.SendToFailedBucketParams{}).Return(&sfa_activities.SendToFailedBucketResult{}, nil).Once().Maybe()
s.env.OnActivity(sfa_activities.SendToFailedBucketName, sessionCtx, &sfa_activities.SendToFailedBucketParams{}).Return(&sfa_activities.SendToFailedBucketResult{}, nil).Maybe()

// Archivematica specific activities.
s.env.OnActivity(activities.ZipActivityName,
Expand All @@ -269,7 +269,7 @@ func (s *ProcessingWorkflowTestSuite) TestAMWorkflow() {
).Return(&am.PollIngestActivityResult{Status: "COMPLETE"}, nil).Once()

// Post-preservation activities.
s.env.OnActivity(updatePackageLocalActivity, ctx, logger, pkgsvc, mock.AnythingOfType("*workflow.updatePackageLocalActivityParams")).Return(nil).Once()
s.env.OnActivity(updatePackageLocalActivity, ctx, logger, pkgsvc, mock.AnythingOfType("*workflow.updatePackageLocalActivityParams")).Return(nil).Times(2)
s.env.OnActivity(setStatusLocalActivity, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil).Never()
s.env.OnActivity(completePreservationActionLocalActivity, ctx, pkgsvc, mock.AnythingOfType("*workflow.completePreservationActionLocalActivityParams")).Return(nil).Once()
s.env.OnActivity(activities.CleanUpActivityName, sessionCtx, mock.AnythingOfType("*activities.CleanUpActivityParams")).Return(nil).Once()
Expand Down

0 comments on commit 9ed1788

Please sign in to comment.