Skip to content

Commit

Permalink
merge dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Nemere committed Nov 11, 2024
2 parents 37b0014 + 496f49d commit 4b9663a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
6 changes: 4 additions & 2 deletions api/dataimport/for-trigger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,9 @@ func Test_ImportForTrigger_Manual_SBU_NoAutoShare_FailForPipeline(t *testing.T)
}
}
*/
// Import a breadboard dataset from manual uploaded zip file

// DISABLED 5/Nov/2024, rewrite importer for EM to work differently so these tests are no longer relevant. Will have to write new tests for new functionality
/*
func Example_importForTrigger_Manual_EM() {
remoteFS, log, configBucket, datasetBucket, manualBucket, db := initTest("Manual_EM", "ManualEM_OK", specialUserIds.PIXLISESystemUserId, "PIXLFMGroupId")
Expand Down Expand Up @@ -587,7 +589,7 @@ func Example_importForTrigger_Manual_EM_WithBeamV2() {
// Logged "No auto-share destination found, so only importing user will be able to access this dataset.": false
// Logged "Saving as beam geometry tool version: 2": true
// <nil>|{"id":"048300551","title":"048300551","dataTypes":[{"dataType":"SD_IMAGE","count":4},{"dataType":"SD_XRF","count":242}],"instrument":"PIXL_EM","instrumentConfig":"PIXL-EM-E2E","meta":{"DriveId":"1712","RTT":"048300551","SCLK":"678031418","Site":"","SiteId":"4","Sol":"0125","Target":"","TargetId":"?"},"contentCounts":{"BulkSpectra":2,"DwellSpectra":0,"MaxSpectra":2,"NormalSpectra":242,"PseudoIntensities":121},"creatorUserId":"PIXLISEImport"}
}
}*/

/* NOT TESTED YET, because it's not done yet!
Expand Down
2 changes: 2 additions & 0 deletions api/dataimport/sdfToRSI/scanSDF_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package sdfToRSI
import "fmt"

func Example_scanSDF() {
ensureSDFRawExists()

refs, err := scanSDF("./test-data/BadPath.txt")
fmt.Printf("%v|%v\n", len(refs), err != nil)

Expand Down
12 changes: 12 additions & 0 deletions api/dataimport/sdfToRSI/sdfToRSI_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ import (
)

func Example_ConvertSDFtoRSI() {
ensureSDFRawExists()

fmt.Printf("Mkdir output: %v\n", os.MkdirAll("./output", 0644))
files, rtts, err := ConvertSDFtoRSIs("./test-data/sdf_raw.txt", "./output/")
fmt.Printf("%v, %v: %v\n", files, rtts, err)

// Output:
// Mkdir output: <nil>
// [RSI-208536069.csv RSI-208601602.csv], [208536069 208601602]: <nil>
}

func ensureSDFRawExists() {
// If it's not here, unzip it
_, err := os.Stat("./test-data/sdf_raw.txt")
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/mongoDBConnection/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func makeMongoCommandMonitor(log logger.ILogger) *event.CommandMonitor {
log.Debugf("Mongo success:\n%v", evt.CommandFinishedEvent)
},
Failed: func(_ context.Context, evt *event.CommandFailedEvent) {
log.Errorf("Mongo FAIL:\n%v", evt.Failure)
log.Errorf("Mongo err:\n%v", evt.Failure)
},
}
}

0 comments on commit 4b9663a

Please sign in to comment.