Skip to content

Commit

Permalink
Merge pull request #221 from pixlise/feature/quant-fit
Browse files Browse the repository at this point in the history
Fixing scan data integration test now that we raised the group count …
  • Loading branch information
pnemere authored May 8, 2024
2 parents f097a4f + 6a84119 commit 736b9d3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
18 changes: 10 additions & 8 deletions core/wstestlib/full-ownership-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"math"
"strings"
"time"

protos "github.com/pixlise/core/v4/generated-protos"
)
Expand All @@ -24,6 +23,7 @@ func RunFullAccessTest(apiHost string, userId string, groupDepth int, noAccessCa
for viewOrEdit := 0; viewOrEdit < viewEditCount; viewOrEdit++ {
// Call back for no access test - in case we want to try the "cleared" scenario - without access permissions set up
if noAccessCallback != nil {
//ClearJWTCache()
noAccessCallback(apiHost)
}

Expand Down Expand Up @@ -85,6 +85,7 @@ func RunFullAccessTest(apiHost string, userId string, groupDepth int, noAccessCa

if viewOrMember == 0 {
group.Viewers = groupList
ownerViewOrEdit = 0 // If anything in the chain involves being a viewer, we can't expect the overall "edit" permission to be allowed
} else {
group.Members = groupList
}
Expand All @@ -100,14 +101,15 @@ func RunFullAccessTest(apiHost string, userId string, groupDepth int, noAccessCa
}

// Call back for the actual access test
//ClearJWTCache()
accessCheckCallback(apiHost, what, ownership[0], ownership[1], groups, ownerViewOrEdit == 1)

// Occasionally pause to not trip auth0 login frequency
if loginCount > 9 {
fmt.Println("Wait to not rate limit Auth0...")
time.Sleep(time.Duration(13) * time.Second)
}

/*
// Occasionally pause to not trip auth0 login frequency
if loginCount > 9 {
fmt.Println("Wait to not rate limit Auth0...")
time.Sleep(time.Duration(13) * time.Second)
}
*/
loginCount += 2

fmt.Printf("Login count: %v...\n", loginCount)
Expand Down
5 changes: 1 addition & 4 deletions internal/cmd-line-tools/api-integration-test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ func runEnvTests(apiHost string) {
func runLocalTests(apiHost string, isCI bool) {
testImageGet_PreWS(apiHost) // Must be run before any web sockets log in

// testScanData(apiHost, 0 /*3 for proper testing*/)
// testQuants(apiHost)
// testDataModules(apiHost)
// Test log query (for data import)
// Run integration test against review env?

Expand Down Expand Up @@ -453,7 +450,7 @@ func runLocalTests(apiHost string, isCI bool) {
}
testUserGroups(apiHost)
testLogMsgs(apiHost)
testScanData(apiHost, 2 /*3 for proper testing*/)
testScanData(apiHost, 3) // 3 takes about 5 minutes, 2 is quicker, 1 or less isn't testing enough user->group permission hops
testDetectorConfig(apiHost)

testTags(apiHost)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func testScanData(apiHost string, groupDepth int) {
wstestlib.RunFullAccessTest(apiHost, userId, groupDepth, noAccessTest, accessTest)
}

const scanWaitTime = 60 * 1000 * 10
const scanWaitTime = 60 * 1000 // why was this set to 10min initially? * 10

var scan_Naltsos = &protos.ScanItem{
Id: "048300551",
Expand Down

0 comments on commit 736b9d3

Please sign in to comment.