Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phwissmann committed Dec 18, 2024
1 parent 77a6f49 commit ae043ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
5 changes: 4 additions & 1 deletion internal/core/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ func createExpectedValidConfigS3() task.TransferConfig {
return task.TransferConfig{
Method: "S3",
S3: task.S3TransferConfig{
Endpoint: "http://localhost:8000",
Endpoint: "https://endpoint/api/v1",
ChunkSize: 64,
ConcurrentFiles: 4,
PoolSize: 8,
},
}
}
Expand Down
13 changes: 10 additions & 3 deletions internal/core/ingestdataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ func IngestDataset(

datasetId, err := scicat.CreateDataset(http_client, SCICAT_API_URL, metaDataMap, user)
if err != nil {
return "", err
return datasetId, err
}
err = scicat.CreateOrigDatablocks(http_client, SCICAT_API_URL, fullFileArray, datasetId, user)
if err != nil {
return "", err
return datasetId, err
}

switch ingestionTask.TransferMethod {
Expand All @@ -202,10 +202,17 @@ func IngestDataset(
fileList = append(fileList, f.Path)
}
err = s3upload.UploadS3(task_context, datasetId, datasetFolder, fileList, ingestionTask.DatasetFolder.Id, config.Transfer.S3, notifier)
if err != nil {
return datasetId, err
}

case task.TransferGlobus:
err = GlobusTransfer(config.Transfer.Globus, ingestionTask, task_context, ingestionTask.DatasetFolder.Id, datasetFolder, fullFileArray, notifier)
if err != nil {
return datasetId, err
}
_:
return "", fmt.Errorf("unknown transfer method: %s", ingestionTask.TransferMethod)
return datasetId, fmt.Errorf("unknown transfer method: %d", ingestionTask.TransferMethod)
}

if err != nil {
Expand Down
10 changes: 4 additions & 6 deletions test/testdata/valid_config_s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ Scicat:
Transfer:
Method: S3
S3:
Endpoint: s3:9000
Bucket: landingzone
Checksum: true
Location: "eu-west-1"
User: "minio_user"
Password: "minio_pass"
Endpoint: https://endpoint/api/v1
ChunkSize: 64
ConcurrentFiles: 4
PoolSize: 8
Misc:
ConcurrencyLimit: 2
Port: 8888
Expand Down

0 comments on commit ae043ed

Please sign in to comment.