From afea030058711c31c4b9a9c0b32096ef1515c683 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Thu, 5 Mar 2026 13:47:35 -0800 Subject: [PATCH 1/2] chore(integrationtesting): remove t.Parallel test calls --- .../services/integrationtesting/consistency_datastore_test.go | 1 - internal/services/integrationtesting/consistency_test.go | 3 --- internal/services/integrationtesting/ops_test.go | 2 -- .../integrationtesting/query_plan_consistency_test.go | 4 ---- 4 files changed, 10 deletions(-) diff --git a/internal/services/integrationtesting/consistency_datastore_test.go b/internal/services/integrationtesting/consistency_datastore_test.go index 2153b2e1b..498809cd7 100644 --- a/internal/services/integrationtesting/consistency_datastore_test.go +++ b/internal/services/integrationtesting/consistency_datastore_test.go @@ -40,7 +40,6 @@ func TestConsistencyPerDatastore(t *testing.T) { t.Run(engineID, func(t *testing.T) { // FIXME errors arise if spanner is run in parallel if engineID != "spanner" { - t.Parallel() } for _, filePath := range consistencyTestFiles { rde := testdatastore.RunDatastoreEngine(t, engineID) diff --git a/internal/services/integrationtesting/consistency_test.go b/internal/services/integrationtesting/consistency_test.go index a28c765c4..993466a88 100644 --- a/internal/services/integrationtesting/consistency_test.go +++ b/internal/services/integrationtesting/consistency_test.go @@ -45,7 +45,6 @@ const testTimedelta = 1 * time.Second // both real-world schemas, as well as the full set of hand-constructed corner // cases so that the system can be fully exercised. func TestConsistency(t *testing.T) { - t.Parallel() // List all the defined consistency test files. consistencyTestFiles, err := consistencytestutil.ListTestConfigs() @@ -53,12 +52,10 @@ func TestConsistency(t *testing.T) { for _, filePath := range consistencyTestFiles { t.Run(path.Base(filePath), func(t *testing.T) { - t.Parallel() for _, dispatcherKind := range []string{"local", "caching"} { t.Run(dispatcherKind, func(t *testing.T) { for _, chunkSize := range []uint16{5, 10} { t.Run(fmt.Sprintf("chunk-size-%d", chunkSize), func(t *testing.T) { - t.Parallel() runConsistencyTestSuiteForFile(t, filePath, dispatcherKind == "caching", chunkSize) }) } diff --git a/internal/services/integrationtesting/ops_test.go b/internal/services/integrationtesting/ops_test.go index 9158cb1f0..14b36af0a 100644 --- a/internal/services/integrationtesting/ops_test.go +++ b/internal/services/integrationtesting/ops_test.go @@ -120,7 +120,6 @@ func (dr deleteCaveatedRelationship) Execute(tester opsTester) error { } func TestSchemaAndRelationshipsOperations(t *testing.T) { - t.Parallel() tcs := []schemaTestCase{ // Test: write a basic, valid schema. @@ -752,7 +751,6 @@ func TestSchemaAndRelationshipsOperations(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { - t.Parallel() for _, testerName := range []string{"v1"} { t.Run(testerName, func(t *testing.T) { conn, cleanup, _, _ := testserver.NewTestServer(require.New(t), 0, memdb.DisableGC, false, tf.EmptyDatastore) diff --git a/internal/services/integrationtesting/query_plan_consistency_test.go b/internal/services/integrationtesting/query_plan_consistency_test.go index c73a23427..e4dbd4cef 100644 --- a/internal/services/integrationtesting/query_plan_consistency_test.go +++ b/internal/services/integrationtesting/query_plan_consistency_test.go @@ -29,7 +29,6 @@ import ( ) func TestQueryPlanConsistency(t *testing.T) { // nolint:tparallel - t.Parallel() consistencyTestFiles, err := consistencytestutil.ListTestConfigs() require.NoError(t, err) for _, filePath := range consistencyTestFiles { @@ -195,7 +194,6 @@ func runQueryPlanLookupResources(t *testing.T, handle *queryPlanConsistencyHandl // that are accessible to the subject. testQueryPlanForEachResourceType(t, handle.populated, "validate_lookup_resources", func(t *testing.T, resourceRelation tuple.RelationReference) { - t.Parallel() for _, subject := range accessibilitySet.AllSubjectsNoWildcards() { t.Run(tuple.StringONR(subject), func(t *testing.T) { accessibleResources := accessibilitySet.LookupAccessibleResources(resourceRelation, subject) @@ -245,7 +243,6 @@ func runQueryPlanLookupSubjects(t *testing.T, handle *queryPlanConsistencyHandle // that have access to the resource. testQueryPlanForEachResourceType(t, handle.populated, "validate_lookup_subjects", func(t *testing.T, resourceRelation tuple.RelationReference) { - t.Parallel() for _, resource := range accessibilitySet.AllResourcesNoWildcards() { // Only test resources that match the current resource type if resource.ObjectType != resourceRelation.ObjectType || resource.Relation != resourceRelation.Relation { @@ -323,7 +320,6 @@ func testQueryPlanForEachResourceType( // environment flags are set. This test should be removed when those flags are removed and // the corresponding tests run unconditionally. func TestAccessibilitySetMethods(t *testing.T) { - t.Parallel() require := require.New(t) ds, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, testTimedelta, memdb.DisableGC) From e637f92f8533595b77c4df178eb8422d49092636 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Thu, 5 Mar 2026 14:10:42 -0800 Subject: [PATCH 2/2] chore(*): remove all t.Parallel test calls --- CONTRIBUTING.md | 8 ++ .../memory_protection_integration_test.go | 2 - internal/datastore/common/changes_test.go | 2 - .../common/transaction_metadata_test.go | 6 - internal/datastore/crdb/crdb_test.go | 6 - internal/datastore/crdb/pool/pool_test.go | 9 -- internal/datastore/memdb/memdb_test.go | 4 - internal/datastore/postgres/pgbouncer_test.go | 2 - .../postgres/postgres_shared_test.go | 3 - internal/datastore/postgres/postgres_test.go | 6 - .../proxy/relationshipintegrity_test.go | 2 - .../proxy/schemacaching/estimatedsize_test.go | 2 - internal/datastore/spanner/spanner_test.go | 2 - internal/dispatch/graph/check_test.go | 18 --- internal/dispatch/graph/dispatch_test.go | 6 - internal/dispatch/graph/expand_test.go | 10 -- internal/dispatch/graph/graph_test.go | 4 - .../dispatch/graph/lookupresources2_test.go | 22 ---- .../dispatch/graph/lookupresources3_test.go | 14 --- .../dispatch/graph/lookupsubjects_test.go | 11 -- internal/dispatch/graph/package_test.go | 1 - internal/dispatch/remote/cluster_test.go | 3 - .../dispatch/remote/primarysleeper_test.go | 11 -- internal/fdw/common/errors_test.go | 16 --- internal/fdw/explain/explain_test.go | 12 -- internal/fdw/stats/stats_test.go | 24 ---- internal/fdw/tables/consistency_test.go | 8 -- internal/fdw/tables/delete_test.go | 8 -- internal/fdw/tables/insert_test.go | 8 -- internal/fdw/tables/matcher_test.go | 16 --- internal/fdw/tables/relationships_test.go | 8 -- internal/fdw/tables/select_test.go | 3 - internal/fdw/tables/statement_test.go | 12 -- internal/fdw/tables/util_test.go | 12 -- internal/relationships/validation_test.go | 3 - .../consistency_datastore_test.go | 3 - .../integrationtesting/consistency_test.go | 1 - .../services/integrationtesting/ops_test.go | 1 - internal/services/shared/errors_test.go | 4 - internal/services/v1/experimental_test.go | 3 - .../sharederrors/error_help_links_test.go | 4 - .../taskrunner/preloadedtaskrunner_test.go | 11 -- internal/testutil/subjects_test.go | 4 - pkg/cache/cache_test.go | 5 - pkg/cmd/datastore_test.go | 8 -- .../compiler/compiler_test.go | 7 -- .../compiler/development_test.go | 8 -- .../compiler/importer_test.go | 10 -- pkg/composableschemadsl/parser/parser_test.go | 3 - pkg/datastore/pagination/iterator_test.go | 3 - pkg/datastore/test/datastore.go | 1 - pkg/genutil/slicez/chunking_test.go | 12 -- .../consistency/consistency_test.go | 2 - pkg/query/advisor_combine_test.go | 24 ---- pkg/query/advisor_count_test.go | 16 --- pkg/query/advisor_static_test.go | 40 +------ pkg/query/alias_test.go | 45 ------- pkg/query/arrow_test.go | 48 -------- pkg/query/build_tree_test.go | 44 ------- pkg/query/canonicalize_test.go | 45 ------- pkg/query/caveat_test.go | 25 ---- pkg/query/context_test.go | 21 ---- pkg/query/datastore_test.go | 51 -------- pkg/query/exclusion_test.go | 56 --------- pkg/query/filter_test.go | 15 --- pkg/query/fixed_test.go | 18 --- pkg/query/intersection_arrow_test.go | 42 ------- pkg/query/intersection_test.go | 60 ---------- pkg/query/optimize_caveat_test.go | 36 ------ pkg/query/optimize_test.go | 6 - pkg/query/outline_fuzz_test.go | 3 - pkg/query/outline_test.go | 110 ------------------ pkg/query/path_test.go | 94 --------------- pkg/query/quick_e2e_test.go | 6 - pkg/query/recursive_coverage_test.go | 11 -- pkg/query/recursive_sentinel_test.go | 5 - pkg/query/recursive_strategies_test.go | 8 -- pkg/query/recursive_test.go | 5 - pkg/query/self_test.go | 19 --- pkg/query/simplify_caveat_test.go | 13 --- pkg/query/union_test.go | 78 ------------- pkg/query/wildcard_multirelation_test.go | 4 - pkg/query/wildcard_subjects_test.go | 9 -- pkg/schema/arrows_test.go | 9 -- pkg/schema/full_reachability_test.go | 3 - pkg/schema/type_check_test.go | 8 -- pkg/schema/v2/convert_test.go | 82 ------------- pkg/schema/v2/operations_test.go | 2 - pkg/schema/v2/schema_conversion_test.go | 9 -- pkg/schema/v2/schema_test.go | 33 ------ pkg/schema/v2/tocorev1_test.go | 11 -- pkg/schema/v2/todefinitions_test.go | 27 ----- .../v2/todefinitions_typesystem_test.go | 12 -- pkg/schemadsl/compiler/compiler_test.go | 9 -- pkg/schemadsl/compiler/development_test.go | 4 - pkg/schemadsl/compiler/importer_test.go | 12 -- pkg/schemadsl/parser/parser_test.go | 3 - 97 files changed, 9 insertions(+), 1546 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2d23344a1..da7fc8dd1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -102,6 +102,14 @@ mage test:integration Run `mage` or `mage -l` for a full list of test suites. +#### Using t.Parallel + +`t.Parallel` is often recommended as a way of speeding up test execution. Our experience in +this repo is that because of the number of test packages and the fact that `go test` +already parallelizes over test packages, `t.Parallel` mostly increases peak memory usage +without meaningfully speeding up test execution. If you're going to use `t.Parallel`, +ensure that it actually speeds up the test in question. + ### Linting SpiceDB uses several linters to maintain code and docs quality. diff --git a/cmd/spicedb/memoryprotection/memory_protection_integration_test.go b/cmd/spicedb/memoryprotection/memory_protection_integration_test.go index 296a8f893..d79ff6a05 100644 --- a/cmd/spicedb/memoryprotection/memory_protection_integration_test.go +++ b/cmd/spicedb/memoryprotection/memory_protection_integration_test.go @@ -29,8 +29,6 @@ func init() { } func TestServeWithMemoryProtectionMiddleware(t *testing.T) { - t.Parallel() - pool, err := dockertest.NewPool("") require.NoError(t, err) diff --git a/internal/datastore/common/changes_test.go b/internal/datastore/common/changes_test.go index 184fd9db2..268e81bb3 100644 --- a/internal/datastore/common/changes_test.go +++ b/internal/datastore/common/changes_test.go @@ -971,8 +971,6 @@ func canonicalize(in []datastore.RevisionChanges) []datastore.RevisionChanges { } func TestThreadSafe(t *testing.T) { - t.Parallel() - ch := NewChanges(revisions.TransactionIDKeyFunc, datastore.WatchRelationships|datastore.WatchSchema, math.MaxInt64) var wg errgroup.Group diff --git a/internal/datastore/common/transaction_metadata_test.go b/internal/datastore/common/transaction_metadata_test.go index 2a5a1b789..7912c7064 100644 --- a/internal/datastore/common/transaction_metadata_test.go +++ b/internal/datastore/common/transaction_metadata_test.go @@ -7,8 +7,6 @@ import ( ) func TestMustStruct(t *testing.T) { - t.Parallel() - cc := TransactionMetadata{"key": "value"} ss := cc.MustStruct() @@ -16,8 +14,6 @@ func TestMustStruct(t *testing.T) { } func TestScan(t *testing.T) { - t.Parallel() - tests := []struct { name string initial TransactionMetadata @@ -50,8 +46,6 @@ func TestScan(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() - cc := tt.initial err := cc.Scan(tt.val) diff --git a/internal/datastore/crdb/crdb_test.go b/internal/datastore/crdb/crdb_test.go index f1e3d0c28..6fa54e69e 100644 --- a/internal/datastore/crdb/crdb_test.go +++ b/internal/datastore/crdb/crdb_test.go @@ -69,7 +69,6 @@ func crdbTestVersion() string { } func TestCRDBDatastoreWithoutIntegrity(t *testing.T) { - t.Parallel() b := testdatastore.RunCRDBForTesting(t, "", crdbTestVersion()) test.All(t, crdbFactory.NewTester(test.DatastoreTesterFunc(func(_ testing.TB, revisionQuantization, gcInterval, gcWindow time.Duration, watchBufferLength uint16) (datastore.Datastore, error) { ctx := context.Background() @@ -130,7 +129,6 @@ func createDatastoreTest(b testdatastore.RunningEngineForTest, tf datastoreTestF } func TestCRDBDatastoreWithFollowerReads(t *testing.T) { - t.Parallel() followerReadDelay := time.Duration(4.8 * float64(time.Second)) gcWindow := 100 * time.Second @@ -142,7 +140,6 @@ func TestCRDBDatastoreWithFollowerReads(t *testing.T) { } for _, quantization := range quantizationDurations { t.Run(fmt.Sprintf("Quantization%s", quantization), func(t *testing.T) { - t.Parallel() ctx := context.Background() ds := engine.NewDatastore(t, func(engine, uri string) datastore.Datastore { @@ -196,7 +193,6 @@ var defaultKeyForTesting = proxy.KeyConfig{ } func TestCRDBDatastoreWithIntegrity(t *testing.T) { //nolint:tparallel - t.Parallel() b := testdatastore.RunCRDBForTesting(t, "", crdbTestVersion()) test.All(t, crdbFactory.NewTester(test.DatastoreTesterFunc(func(_ testing.TB, revisionQuantization, gcInterval, gcWindow time.Duration, watchBufferLength uint16) (datastore.Datastore, error) { @@ -256,7 +252,6 @@ func TestCRDBDatastoreWithIntegrity(t *testing.T) { //nolint:tparallel } func TestWatchFeatureDetection(t *testing.T) { - t.Parallel() pool, err := dockertest.NewPool("") require.NoError(t, err) cases := []struct { @@ -301,7 +296,6 @@ func TestWatchFeatureDetection(t *testing.T) { for _, tt := range cases { tt := tt t.Run(tt.name, func(t *testing.T) { - t.Parallel() ctx, cancel := context.WithCancel(context.Background()) t.Cleanup(cancel) adminConn, connStrings := newCRDBWithUser(t, pool) diff --git a/internal/datastore/crdb/pool/pool_test.go b/internal/datastore/crdb/pool/pool_test.go index b7d5ef640..66dfeccdd 100644 --- a/internal/datastore/crdb/pool/pool_test.go +++ b/internal/datastore/crdb/pool/pool_test.go @@ -81,7 +81,6 @@ func createTestRetryPool(testPool *TestPool) *RetryPool { } func TestContextCancelledDuringBlockingAcquire(t *testing.T) { - t.Parallel() synctest.Test(t, func(t *testing.T) { testPool := NewTestPool() testPool.acquireFunc = func(ctx context.Context) (*pgxpool.Conn, error) { @@ -112,7 +111,6 @@ func TestContextCancelledDuringBlockingAcquire(t *testing.T) { } func TestAcquireTimeoutReturnsErrAcquire(t *testing.T) { - t.Parallel() synctest.Test(t, func(t *testing.T) { testPool := NewTestPool() testPool.acquireFunc = func(ctx context.Context) (*pgxpool.Conn, error) { @@ -143,7 +141,6 @@ func TestAcquireTimeoutReturnsErrAcquire(t *testing.T) { } func TestAcquireSucceedsButTopLevelContextCancelled(t *testing.T) { - t.Parallel() testPool := NewTestPool() retryPool := createTestRetryPool(testPool) @@ -160,7 +157,6 @@ func TestAcquireSucceedsButTopLevelContextCancelled(t *testing.T) { } func TestAcquireErrorWithConnectionReturned(t *testing.T) { - t.Parallel() synctest.Test(t, func(t *testing.T) { testPool := NewTestPool() testPool.acquireFunc = func(ctx context.Context) (*pgxpool.Conn, error) { @@ -185,7 +181,6 @@ func TestAcquireErrorWithConnectionReturned(t *testing.T) { } func TestAcquireSucceedsWithinTimeout(t *testing.T) { - t.Parallel() synctest.Test(t, func(t *testing.T) { testPool := NewTestPool() testPool.acquireFunc = func(ctx context.Context) (*pgxpool.Conn, error) { @@ -216,7 +211,6 @@ func TestAcquireSucceedsWithinTimeout(t *testing.T) { } func TestNoAcquireTimeoutUsesOriginalContext(t *testing.T) { - t.Parallel() var acquireContext context.Context testPool := NewTestPool() @@ -237,7 +231,6 @@ func TestNoAcquireTimeoutUsesOriginalContext(t *testing.T) { } func TestAcquireTimeoutCreatesSeparateContext(t *testing.T) { - t.Parallel() synctest.Test(t, func(t *testing.T) { var acquireContext context.Context @@ -268,7 +261,6 @@ func TestAcquireTimeoutCreatesSeparateContext(t *testing.T) { } func TestAcquireTimeoutContextCausePreserved(t *testing.T) { - t.Parallel() synctest.Test(t, func(t *testing.T) { testPool := NewTestPool() testPool.acquireFunc = func(ctx context.Context) (*pgxpool.Conn, error) { @@ -295,7 +287,6 @@ func TestAcquireTimeoutContextCausePreserved(t *testing.T) { } func TestSuccessfulFunctionExecution(t *testing.T) { - t.Parallel() testPool := NewTestPool() testPool.acquireFunc = func(ctx context.Context) (*pgxpool.Conn, error) { return &pgxpool.Conn{}, nil diff --git a/internal/datastore/memdb/memdb_test.go b/internal/datastore/memdb/memdb_test.go index 4be1992ab..4fb0d5b75 100644 --- a/internal/datastore/memdb/memdb_test.go +++ b/internal/datastore/memdb/memdb_test.go @@ -28,12 +28,10 @@ func (memDBTest) New(_ testing.TB, revisionQuantization, _, gcWindow time.Durati } func TestMemdbDatastore(t *testing.T) { - t.Parallel() test.All(t, memdbFactory.NewTester(memDBTest{}), true) } func TestConcurrentWritePanic(t *testing.T) { - t.Parallel() require := require.New(t) ds, err := NewMemdbDatastore(0, 1*time.Hour, 1*time.Hour) @@ -85,7 +83,6 @@ func TestConcurrentWritePanic(t *testing.T) { } func TestConcurrentWriteRelsError(t *testing.T) { - t.Parallel() require := require.New(t) ds, err := NewMemdbDatastore(0, 1*time.Hour, 1*time.Hour) @@ -116,7 +113,6 @@ func TestConcurrentWriteRelsError(t *testing.T) { } func TestAnythingAfterCloseDoesNotPanic(t *testing.T) { - t.Parallel() require := require.New(t) ds, err := NewMemdbDatastore(0, 1*time.Hour, 1*time.Hour) diff --git a/internal/datastore/postgres/pgbouncer_test.go b/internal/datastore/postgres/pgbouncer_test.go index 484f96c3f..4e8cc8350 100644 --- a/internal/datastore/postgres/pgbouncer_test.go +++ b/internal/datastore/postgres/pgbouncer_test.go @@ -21,11 +21,9 @@ func pgbouncerTestVersion() string { var pgbouncerConfig = postgresTestConfig{"head", "", pgbouncerTestVersion(), true} func TestPostgresWithPgBouncerDatastore(t *testing.T) { - t.Parallel() testPostgresDatastore(t, pgbouncerConfig) } func TestPostgresDatastoreWithPgBouncerWithoutCommitTimestamps(t *testing.T) { - t.Parallel() testPostgresDatastoreWithoutCommitTimestamps(t, pgbouncerConfig) } diff --git a/internal/datastore/postgres/postgres_shared_test.go b/internal/datastore/postgres/postgres_shared_test.go index 552d33e52..1da76f6f6 100644 --- a/internal/datastore/postgres/postgres_shared_test.go +++ b/internal/datastore/postgres/postgres_shared_test.go @@ -110,7 +110,6 @@ func testPostgresDatastore(t *testing.T, config postgresTestConfig) { }) t.Run(fmt.Sprintf("%spostgres-%s-%s-%s", pgbouncerStr, config.pgVersion, config.targetMigration, config.migrationPhase), func(t *testing.T) { - t.Parallel() b := testdatastore.RunPostgresForTesting(t, "", config.targetMigration, config.pgVersion, config.pgbouncer) ctx := context.Background() @@ -306,8 +305,6 @@ func testPostgresDatastoreWithoutCommitTimestamps(t *testing.T, config postgresT pgVersion := config.pgVersion enablePgbouncer := config.pgbouncer t.Run(fmt.Sprintf("postgres-%s", pgVersion), func(t *testing.T) { - t.Parallel() - ctx := context.Background() b := testdatastore.RunPostgresForTestingWithCommitTimestamps(t, "", "head", false, pgVersion, enablePgbouncer) diff --git a/internal/datastore/postgres/postgres_test.go b/internal/datastore/postgres/postgres_test.go index 78c23b161..3145dad4f 100644 --- a/internal/datastore/postgres/postgres_test.go +++ b/internal/datastore/postgres/postgres_test.go @@ -29,26 +29,20 @@ func postgresTestVersion() string { var postgresConfig = postgresTestConfig{"head", "", postgresTestVersion(), false} func TestPostgresDatastore(t *testing.T) { - t.Parallel() testPostgresDatastore(t, postgresConfig) } func TestPostgresDatastoreWithoutCommitTimestamps(t *testing.T) { - t.Parallel() testPostgresDatastoreWithoutCommitTimestamps(t, postgresConfig) } func TestPostgresDatastoreGC(t *testing.T) { - t.Parallel() - config := postgresConfig pgbouncerStr := "" if config.pgbouncer { pgbouncerStr = "pgbouncer-" } t.Run(fmt.Sprintf("%spostgres-gc-%s-%s-%s", pgbouncerStr, config.pgVersion, config.targetMigration, config.migrationPhase), func(t *testing.T) { - t.Parallel() - b := testdatastore.RunPostgresForTesting(t, "", config.targetMigration, config.pgVersion, config.pgbouncer) t.Run("GarbageCollection", createDatastoreTest( diff --git a/internal/datastore/proxy/relationshipintegrity_test.go b/internal/datastore/proxy/relationshipintegrity_test.go index 5b8a683ab..4c8f09abd 100644 --- a/internal/datastore/proxy/relationshipintegrity_test.go +++ b/internal/datastore/proxy/relationshipintegrity_test.go @@ -245,8 +245,6 @@ func TestBasicIntegrityFailureDueToWriteWithExpiredKey(t *testing.T) { } func TestWatchIntegrityFailureDueToInvalidHashSignature(t *testing.T) { - t.Parallel() - ds, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 5*time.Second, 1*time.Hour) require.NoError(t, err) diff --git a/internal/datastore/proxy/schemacaching/estimatedsize_test.go b/internal/datastore/proxy/schemacaching/estimatedsize_test.go index 1075ad204..5976c1e69 100644 --- a/internal/datastore/proxy/schemacaching/estimatedsize_test.go +++ b/internal/datastore/proxy/schemacaching/estimatedsize_test.go @@ -89,8 +89,6 @@ func TestEstimatedDefinitionSizes(t *testing.T) { for _, caveatDef := range fullyResolved.CaveatDefinitions { t.Run("caveat "+caveatDef.Name, func(t *testing.T) { - t.Parallel() - serialized, _ := caveatDef.MarshalVT() sizevt := caveatDef.SizeVT() estimated := estimatedCaveatDefinitionSize(sizevt) diff --git a/internal/datastore/spanner/spanner_test.go b/internal/datastore/spanner/spanner_test.go index f3cdae1e8..aef88c67b 100644 --- a/internal/datastore/spanner/spanner_test.go +++ b/internal/datastore/spanner/spanner_test.go @@ -23,8 +23,6 @@ import ( var spannerFactory = test.NewTesterFactory(status.New(codes.Aborted, "retryable").Err()) func TestSpannerDatastore(t *testing.T) { - // t.Parallel() //nolint:tparallel, the test sets environment variables (the emulator) - ctx := context.Background() b := testdatastore.RunSpannerForTesting(t, "", "head") diff --git a/internal/dispatch/graph/check_test.go b/internal/dispatch/graph/check_test.go index 5c07eb1e1..4734d3dde 100644 --- a/internal/dispatch/graph/check_test.go +++ b/internal/dispatch/graph/check_test.go @@ -33,8 +33,6 @@ var ( ) func TestSimpleCheck(t *testing.T) { - t.Parallel() - type expected struct { relation string isMember bool @@ -122,7 +120,6 @@ func TestSimpleCheck(t *testing.T) { userset := userset expected := expected t.Run(name, func(t *testing.T) { - t.Parallel() require := require.New(t) ctx, dispatch, revision := newLocalDispatcher(t) @@ -154,7 +151,6 @@ func TestSimpleCheck(t *testing.T) { } func TestMaxDepth(t *testing.T) { - t.Parallel() require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) @@ -191,7 +187,6 @@ func TestMaxDepth(t *testing.T) { } func TestCheckMetadata(t *testing.T) { - t.Parallel() type expected struct { relation string isMember bool @@ -265,8 +260,6 @@ func TestCheckMetadata(t *testing.T) { userset := userset expected := expected t.Run(name, func(t *testing.T) { - t.Parallel() - require := require.New(t) ctx, dispatch, revision := newLocalDispatcher(t) @@ -299,7 +292,6 @@ func TestCheckMetadata(t *testing.T) { } func TestCheckPermissionOverSchema(t *testing.T) { - t.Parallel() testCases := []struct { name string schema string @@ -1417,8 +1409,6 @@ func TestCheckPermissionOverSchema(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - require := require.New(t) dispatcher, err := NewLocalOnlyDispatcher(MustNewDefaultDispatcherParametersForTesting()) @@ -1478,7 +1468,6 @@ func addFrame(trace *v1.CheckDebugTrace, foundFrames *mapz.Set[string]) { } func TestCheckDebugging(t *testing.T) { - t.Parallel() type expectedFrame struct { resourceType tuple.RelationReference resourceIDs []string @@ -1556,8 +1545,6 @@ func TestCheckDebugging(t *testing.T) { tc := tc t.Run(name, func(t *testing.T) { - t.Parallel() - require := require.New(t) ctx, dispatch, revision := newLocalDispatcher(t) @@ -1593,7 +1580,6 @@ func TestCheckDebugging(t *testing.T) { } func TestCheckWithHints(t *testing.T) { - t.Parallel() testCases := []struct { name string schema string @@ -1925,8 +1911,6 @@ func TestCheckWithHints(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - require := require.New(t) dispatcher, err := NewLocalOnlyDispatcher(MustNewDefaultDispatcherParametersForTesting()) @@ -1968,7 +1952,6 @@ func TestCheckWithHints(t *testing.T) { } func TestCheckHintsPartialApplication(t *testing.T) { - t.Parallel() require := require.New(t) dispatcher, err := NewLocalOnlyDispatcher(MustNewDefaultDispatcherParametersForTesting()) @@ -2018,7 +2001,6 @@ func TestCheckHintsPartialApplication(t *testing.T) { } func TestCheckHintsPartialApplicationOverArrow(t *testing.T) { - t.Parallel() require := require.New(t) dispatcher, err := NewLocalOnlyDispatcher(MustNewDefaultDispatcherParametersForTesting()) diff --git a/internal/dispatch/graph/dispatch_test.go b/internal/dispatch/graph/dispatch_test.go index 26394f2ee..cf1c4240f 100644 --- a/internal/dispatch/graph/dispatch_test.go +++ b/internal/dispatch/graph/dispatch_test.go @@ -16,7 +16,6 @@ import ( const veryLargeLimit = 1000000000 func TestDispatchChunking(t *testing.T) { - t.Parallel() schema := ` definition user { relation its_a_me: user @@ -37,7 +36,6 @@ func TestDispatchChunking(t *testing.T) { ctx, dispatcher, revision := newLocalDispatcherWithSchemaAndRels(t, schema, append(enabled, resources...)) t.Run("check", func(t *testing.T) { - t.Parallel() for _, tpl := range resources[:1] { checkResult, err := dispatcher.DispatchCheck(ctx, &v1.DispatchCheckRequest{ ResourceRelation: RR(tpl.Resource.ObjectType, "view").ToCoreRR(), @@ -58,8 +56,6 @@ func TestDispatchChunking(t *testing.T) { }) t.Run("lookup-resources2", func(t *testing.T) { - t.Parallel() - for _, tpl := range resources[:1] { stream := dispatch.NewCollectingDispatchStream[*v1.DispatchLookupResources2Response](ctx) err := dispatcher.DispatchLookupResources2(&v1.DispatchLookupResources2Request{ @@ -82,8 +78,6 @@ func TestDispatchChunking(t *testing.T) { }) t.Run("lookup-subjects", func(t *testing.T) { - t.Parallel() - for _, tpl := range resources[:1] { stream := dispatch.NewCollectingDispatchStream[*v1.DispatchLookupSubjectsResponse](ctx) diff --git a/internal/dispatch/graph/expand_test.go b/internal/dispatch/graph/expand_test.go index 254bc7a19..c90a96a97 100644 --- a/internal/dispatch/graph/expand_test.go +++ b/internal/dispatch/graph/expand_test.go @@ -138,8 +138,6 @@ var ( ) func TestExpand(t *testing.T) { - t.Parallel() - testCases := []struct { start tuple.ObjectAndRelation expansionMode v1.DispatchExpandRequest_ExpansionMode @@ -165,8 +163,6 @@ func TestExpand(t *testing.T) { for _, tc := range testCases { t.Run(fmt.Sprintf("%s-%s", tuple.StringONR(tc.start), tc.expansionMode), func(t *testing.T) { - t.Parallel() - require := require.New(t) ctx, dispatch, revision := newLocalDispatcher(t) @@ -277,8 +273,6 @@ func onrExpr(onr *core.ObjectAndRelation) ast.Expr { } func TestMaxDepthExpand(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) @@ -312,8 +306,6 @@ func TestMaxDepthExpand(t *testing.T) { } func TestExpandOverSchema(t *testing.T) { - t.Parallel() - testCases := []struct { name string schema string @@ -903,8 +895,6 @@ func TestExpandOverSchema(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - require := require.New(t) ctx, dispatch, revision := newLocalDispatcherWithSchemaAndRels(t, tc.schema, tc.relationships) diff --git a/internal/dispatch/graph/graph_test.go b/internal/dispatch/graph/graph_test.go index 73dec0090..579d31f47 100644 --- a/internal/dispatch/graph/graph_test.go +++ b/internal/dispatch/graph/graph_test.go @@ -13,14 +13,11 @@ import ( ) func TestUnwrapStatusError(t *testing.T) { - t.Parallel() - err := rewriteError(t.Context(), graph.NewCheckFailureErr(status.Error(codes.Canceled, "canceled"))) grpcutil.RequireStatus(t, codes.Canceled, err) } func TestConcurrencyLimitsWithOverallDefaultLimit(t *testing.T) { - t.Parallel() cl := ConcurrencyLimits{} require.Equal(t, uint16(0), cl.Check) require.Equal(t, uint16(0), cl.LookupResources) @@ -41,7 +38,6 @@ func TestConcurrencyLimitsWithOverallDefaultLimit(t *testing.T) { } func TestSharedConcurrencyLimits(t *testing.T) { - t.Parallel() cl := SharedConcurrencyLimits(42) require.Equal(t, uint16(42), cl.Check) require.Equal(t, uint16(42), cl.LookupResources) diff --git a/internal/dispatch/graph/lookupresources2_test.go b/internal/dispatch/graph/lookupresources2_test.go index 63346d028..7e5d6628a 100644 --- a/internal/dispatch/graph/lookupresources2_test.go +++ b/internal/dispatch/graph/lookupresources2_test.go @@ -25,8 +25,6 @@ import ( ) func TestSimpleLookupResources2(t *testing.T) { - t.Parallel() - testCases := []struct { start tuple.RelationReference target tuple.ObjectAndRelation @@ -100,8 +98,6 @@ func TestSimpleLookupResources2(t *testing.T) { tc := tc t.Run(name, func(t *testing.T) { - t.Parallel() - require := require.New(t) ctx, dispatcher, revision := newLocalDispatcher(t) defer dispatcher.Close() @@ -158,8 +154,6 @@ func TestSimpleLookupResources2(t *testing.T) { } func TestSimpleLookupResourcesWithCursor2(t *testing.T) { - t.Parallel() - for _, tc := range []struct { subject string expectedFirst []string @@ -182,8 +176,6 @@ func TestSimpleLookupResourcesWithCursor2(t *testing.T) { }, } { t.Run(tc.subject, func(t *testing.T) { - t.Parallel() - require := require.New(t) ctx, dispatcher, revision := newLocalDispatcher(t) defer dispatcher.Close() @@ -242,8 +234,6 @@ func TestSimpleLookupResourcesWithCursor2(t *testing.T) { } func TestLookupResourcesCursorStability2(t *testing.T) { - t.Parallel() - require := require.New(t) ctx, dispatcher, revision := newLocalDispatcher(t) defer dispatcher.Close() @@ -310,7 +300,6 @@ func processResults2(stream *dispatch.CollectingDispatchStream[*v1.DispatchLooku } func TestMaxDepthLookup2(t *testing.T) { - t.Parallel() require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) @@ -341,7 +330,6 @@ func TestMaxDepthLookup2(t *testing.T) { } func TestLookupResources2OverSchemaWithCursors(t *testing.T) { - t.Parallel() testCases := []struct { name string schema string @@ -748,10 +736,8 @@ func TestLookupResources2OverSchemaWithCursors(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() for _, pageSize := range []int{0, 104, 1023} { t.Run(fmt.Sprintf("ps-%d_", pageSize), func(t *testing.T) { - t.Parallel() require := require.New(t) dispatcher, err := NewLocalOnlyDispatcher(MustNewDefaultDispatcherParametersForTesting()) @@ -832,8 +818,6 @@ func TestLookupResources2OverSchemaWithCursors(t *testing.T) { } func TestLookupResources2ImmediateTimeout(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) @@ -868,8 +852,6 @@ func TestLookupResources2ImmediateTimeout(t *testing.T) { } func TestLookupResources2WithError(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) @@ -904,8 +886,6 @@ func TestLookupResources2WithError(t *testing.T) { } func TestLookupResources2EnsureCheckHints(t *testing.T) { - t.Parallel() - tcs := []struct { name string schema string @@ -1346,8 +1326,6 @@ func TestLookupResources2EnsureCheckHints(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) diff --git a/internal/dispatch/graph/lookupresources3_test.go b/internal/dispatch/graph/lookupresources3_test.go index 8b21c006c..d89f68101 100644 --- a/internal/dispatch/graph/lookupresources3_test.go +++ b/internal/dispatch/graph/lookupresources3_test.go @@ -151,8 +151,6 @@ func TestSimpleLookupResources3(t *testing.T) { } func TestSimpleLookupResourcesWithCursor3(t *testing.T) { - t.Parallel() - for _, tc := range []struct { subject string expectedFirst []string @@ -175,8 +173,6 @@ func TestSimpleLookupResourcesWithCursor3(t *testing.T) { }, } { t.Run(tc.subject, func(t *testing.T) { - t.Parallel() - require := require.New(t) ctx, dispatcher, revision := newLocalDispatcher(t) defer dispatcher.Close() @@ -251,7 +247,6 @@ func processResults3(stream *dispatch.CloningCollectingDispatchStream[*v1.Dispat } func TestMaxDepthLookup3(t *testing.T) { - t.Parallel() require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) @@ -282,7 +277,6 @@ func TestMaxDepthLookup3(t *testing.T) { } func TestLookupResources3OverSchemaWithCursors(t *testing.T) { - t.Parallel() testCases := []struct { name string schema string @@ -689,10 +683,8 @@ func TestLookupResources3OverSchemaWithCursors(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() for _, pageSize := range []int{0, 104, 1023} { t.Run(fmt.Sprintf("ps-%d_", pageSize), func(t *testing.T) { - t.Parallel() require := require.New(t) dispatcher, err := NewLocalOnlyDispatcher(MustNewDefaultDispatcherParametersForTesting()) @@ -781,8 +773,6 @@ func TestLookupResources3OverSchemaWithCursors(t *testing.T) { } func TestLookupResources3WithError(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) @@ -815,8 +805,6 @@ func TestLookupResources3WithError(t *testing.T) { } func TestLookupResources3EnsureCheckHints(t *testing.T) { - t.Parallel() - tcs := []struct { name string schema string @@ -1257,8 +1245,6 @@ func TestLookupResources3EnsureCheckHints(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) diff --git a/internal/dispatch/graph/lookupsubjects_test.go b/internal/dispatch/graph/lookupsubjects_test.go index ff31ab901..6ba246884 100644 --- a/internal/dispatch/graph/lookupsubjects_test.go +++ b/internal/dispatch/graph/lookupsubjects_test.go @@ -29,8 +29,6 @@ var ( ) func TestSimpleLookupSubjects(t *testing.T) { - t.Parallel() - testCases := []struct { resourceType string resourceID string @@ -131,8 +129,6 @@ func TestSimpleLookupSubjects(t *testing.T) { for _, tc := range testCases { t.Run(fmt.Sprintf("simple-lookup-subjects:%s:%s:%s:%s:%s", tc.resourceType, tc.resourceID, tc.permission, tc.subjectType, tc.subjectRelation), func(t *testing.T) { - t.Parallel() - require := require.New(t) ctx, dis, revision := newLocalDispatcher(t) @@ -192,7 +188,6 @@ func TestSimpleLookupSubjects(t *testing.T) { } func TestLookupSubjectsMaxDepth(t *testing.T) { - t.Parallel() require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) @@ -227,7 +222,6 @@ func TestLookupSubjectsMaxDepth(t *testing.T) { } func TestLookupSubjectsDispatchCount(t *testing.T) { - t.Parallel() testCases := []struct { resourceType string resourceID string @@ -256,8 +250,6 @@ func TestLookupSubjectsDispatchCount(t *testing.T) { for _, tc := range testCases { t.Run(fmt.Sprintf("dispatch-count-lookup-subjects:%s:%s:%s:%s:%s", tc.resourceType, tc.resourceID, tc.permission, tc.subjectType, tc.subjectRelation), func(t *testing.T) { - t.Parallel() - require := require.New(t) ctx, dis, revision := newLocalDispatcher(t) @@ -282,7 +274,6 @@ func TestLookupSubjectsDispatchCount(t *testing.T) { } func TestLookupSubjectsOverSchema(t *testing.T) { - t.Parallel() testCases := []struct { name string schema string @@ -998,8 +989,6 @@ func TestLookupSubjectsOverSchema(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - require := require.New(t) dispatcher, err := NewLocalOnlyDispatcher(MustNewDefaultDispatcherParametersForTesting()) diff --git a/internal/dispatch/graph/package_test.go b/internal/dispatch/graph/package_test.go index 50d508e11..cd30f1a18 100644 --- a/internal/dispatch/graph/package_test.go +++ b/internal/dispatch/graph/package_test.go @@ -8,7 +8,6 @@ import ( "github.com/authzed/spicedb/pkg/testutil" ) -// done so we can do t.Parallel() and still use goleak func TestMain(m *testing.M) { goleak.VerifyTestMain(m, append(testutil.GoLeakIgnores(), goleak.IgnoreCurrent())...) } diff --git a/internal/dispatch/remote/cluster_test.go b/internal/dispatch/remote/cluster_test.go index fe4757e0f..15b4edd85 100644 --- a/internal/dispatch/remote/cluster_test.go +++ b/internal/dispatch/remote/cluster_test.go @@ -240,8 +240,6 @@ func TestDispatchTimeout(t *testing.T) { } func TestCheckSecondaryDispatch(t *testing.T) { - t.Parallel() - for _, tc := range []struct { name string expr string @@ -326,7 +324,6 @@ func TestCheckSecondaryDispatch(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - t.Parallel() conn := connectionForDispatching(t, &fakeDispatchSvc{dispatchCount: 1, sleepTime: tc.primarySleepTime}) secondaryConn := connectionForDispatching(t, &fakeDispatchSvc{dispatchCount: 2, sleepTime: 0 * time.Millisecond}) diff --git a/internal/dispatch/remote/primarysleeper_test.go b/internal/dispatch/remote/primarysleeper_test.go index 6de1225b1..de40447a8 100644 --- a/internal/dispatch/remote/primarysleeper_test.go +++ b/internal/dispatch/remote/primarysleeper_test.go @@ -11,7 +11,6 @@ import ( ) func TestPrimarySleeper_SleepWithZeroWaitTime(t *testing.T) { - t.Parallel() sleeper := &primarySleeper{ reqKey: "test", waitTime: 0, @@ -31,7 +30,6 @@ func TestPrimarySleeper_SleepWithZeroWaitTime(t *testing.T) { } func TestPrimarySleeper_SleepWithPositiveWaitTime(t *testing.T) { - t.Parallel() waitTime := 10 * time.Millisecond sleeper := &primarySleeper{ reqKey: "test", @@ -52,7 +50,6 @@ func TestPrimarySleeper_SleepWithPositiveWaitTime(t *testing.T) { } func TestPrimarySleeper_SleepWithContextCancellation(t *testing.T) { - t.Parallel() waitTime := 100 * time.Millisecond cancelTime := 5 * time.Millisecond sleeper := &primarySleeper{ @@ -80,7 +77,6 @@ func TestPrimarySleeper_SleepWithContextCancellation(t *testing.T) { } func TestPrimarySleeper_SleepWithContextTimeout(t *testing.T) { - t.Parallel() waitTime := 100 * time.Millisecond cancelTime := 10 * time.Millisecond sleeper := &primarySleeper{ @@ -103,7 +99,6 @@ func TestPrimarySleeper_SleepWithContextTimeout(t *testing.T) { } func TestPrimarySleeper_CancelSleep(t *testing.T) { - t.Parallel() waitTime := 100 * time.Millisecond cancelTime := 5 * time.Millisecond sleeper := &primarySleeper{ @@ -131,7 +126,6 @@ func TestPrimarySleeper_CancelSleep(t *testing.T) { } func TestPrimarySleeper_CancelSleepBeforeSleep(t *testing.T) { - t.Parallel() waitTime := 10 * time.Millisecond sleeper := &primarySleeper{ reqKey: "test", @@ -153,7 +147,6 @@ func TestPrimarySleeper_CancelSleepBeforeSleep(t *testing.T) { } func TestPrimarySleeper_MultipleCancelSleep(t *testing.T) { - t.Parallel() waitTime := 50 * time.Millisecond cancelTime := 5 * time.Millisecond sleeper := &primarySleeper{ @@ -183,7 +176,6 @@ func TestPrimarySleeper_MultipleCancelSleep(t *testing.T) { } func TestPrimarySleeper_ConcurrentCancelSleep(t *testing.T) { - t.Parallel() waitTime := 50 * time.Millisecond cancelTime := 5 * time.Millisecond sleeper := &primarySleeper{ @@ -219,7 +211,6 @@ func TestPrimarySleeper_ConcurrentCancelSleep(t *testing.T) { } func TestPrimarySleeper_SleepTwice(t *testing.T) { - t.Parallel() waitTime := 10 * time.Millisecond sleeper := &primarySleeper{ reqKey: "test", @@ -246,7 +237,6 @@ func TestPrimarySleeper_SleepTwice(t *testing.T) { } func TestPrimarySleeper_SleepConcurrently(t *testing.T) { - t.Parallel() waitTime := 20 * time.Millisecond sleeper := &primarySleeper{ reqKey: "test", @@ -281,7 +271,6 @@ func TestPrimarySleeper_SleepConcurrently(t *testing.T) { } func TestPrimarySleeper_EdgeCaseZeroDurationContext(t *testing.T) { - t.Parallel() waitTime := 10 * time.Millisecond sleeper := &primarySleeper{ reqKey: "test", diff --git a/internal/fdw/common/errors_test.go b/internal/fdw/common/errors_test.go index dcd04a06b..c497fe2fd 100644 --- a/internal/fdw/common/errors_test.go +++ b/internal/fdw/common/errors_test.go @@ -12,8 +12,6 @@ import ( ) func TestNewUnsupportedError(t *testing.T) { - t.Parallel() - testCases := []struct { name string baseErr error @@ -36,8 +34,6 @@ func TestNewUnsupportedError(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - err := NewUnsupportedError(tc.baseErr) require.Error(t, err) require.ErrorContains(t, err, tc.expectedPrefix) @@ -51,8 +47,6 @@ func TestNewUnsupportedError(t *testing.T) { } func TestNewSemanticsError(t *testing.T) { - t.Parallel() - testCases := []struct { name string baseErr error @@ -75,8 +69,6 @@ func TestNewSemanticsError(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - err := NewSemanticsError(tc.baseErr) require.Error(t, err) require.ErrorContains(t, err, tc.expectedPrefix) @@ -90,8 +82,6 @@ func TestNewSemanticsError(t *testing.T) { } func TestNewQueryError(t *testing.T) { - t.Parallel() - testCases := []struct { name string baseErr error @@ -114,8 +104,6 @@ func TestNewQueryError(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - err := NewQueryError(tc.baseErr) require.Error(t, err) require.ErrorContains(t, err, tc.expectedPrefix) @@ -129,8 +117,6 @@ func TestNewQueryError(t *testing.T) { } func TestConvertError(t *testing.T) { - t.Parallel() - testCases := []struct { name string inputErr error @@ -165,8 +151,6 @@ func TestConvertError(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - err := ConvertError(tc.inputErr) require.Error(t, err) diff --git a/internal/fdw/explain/explain_test.go b/internal/fdw/explain/explain_test.go index 33f5f6047..4b3a9661b 100644 --- a/internal/fdw/explain/explain_test.go +++ b/internal/fdw/explain/explain_test.go @@ -7,8 +7,6 @@ import ( ) func TestExplainString(t *testing.T) { - t.Parallel() - testCases := []struct { name string explain Explain @@ -66,8 +64,6 @@ func TestExplainString(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - result := tc.explain.String() require.Equal(t, tc.expected, result) }) @@ -75,8 +71,6 @@ func TestExplainString(t *testing.T) { } func TestDefault(t *testing.T) { - t.Parallel() - testCases := []struct { name string operation string @@ -101,8 +95,6 @@ func TestDefault(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - result := Default(tc.operation, tc.tableName) require.Equal(t, tc.operation, result.Operation) require.Equal(t, tc.tableName, result.TableName) @@ -123,8 +115,6 @@ func TestDefault(t *testing.T) { } func TestUnsupported(t *testing.T) { - t.Parallel() - // Verify Unsupported is a string with very high costs require.Contains(t, Unsupported, "Unsupported") require.Contains(t, Unsupported, "irrelevant") @@ -137,8 +127,6 @@ func TestUnsupported(t *testing.T) { } func TestExplainComparison(t *testing.T) { - t.Parallel() - // Test that Default produces lower cost than Unsupported constants defaultExplain := Default("Foreign Scan", "test") require.Less(t, defaultExplain.StartupCost, float32(expensive)) diff --git a/internal/fdw/stats/stats_test.go b/internal/fdw/stats/stats_test.go index 775cef266..fc43f1137 100644 --- a/internal/fdw/stats/stats_test.go +++ b/internal/fdw/stats/stats_test.go @@ -12,8 +12,6 @@ import ( ) func TestNewPackage(t *testing.T) { - t.Parallel() - testCases := []struct { name string table string @@ -38,8 +36,6 @@ func TestNewPackage(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - pkg := NewPackage(tc.table, tc.operation) require.NotNil(t, pkg) require.Equal(t, tc.table, pkg.table) @@ -52,8 +48,6 @@ func TestNewPackage(t *testing.T) { } func TestAddWidthSample(t *testing.T) { - t.Parallel() - testCases := []struct { name string samples []uint @@ -74,8 +68,6 @@ func TestAddWidthSample(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - pkg := NewPackage("test_table", "Test Scan") for _, sample := range tc.samples { pkg.AddWidthSample(sample) @@ -90,8 +82,6 @@ func TestAddWidthSample(t *testing.T) { } func TestAddSample(t *testing.T) { - t.Parallel() - testCases := []struct { name string samples []struct { @@ -134,8 +124,6 @@ func TestAddSample(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - pkg := NewPackage("test_table", "Test Scan") for _, sample := range tc.samples { pkg.AddSample(sample.cost, sample.rows) @@ -150,8 +138,6 @@ func TestAddSample(t *testing.T) { } func TestExplainWithNoSamples(t *testing.T) { - t.Parallel() - testCases := []struct { name string table string @@ -171,8 +157,6 @@ func TestExplainWithNoSamples(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - pkg := NewPackage(tc.table, tc.operation) result := pkg.Explain() @@ -184,8 +168,6 @@ func TestExplainWithNoSamples(t *testing.T) { } func TestExplainWithSamples(t *testing.T) { - t.Parallel() - testCases := []struct { name string table string @@ -269,8 +251,6 @@ func TestExplainWithSamples(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - pkg := NewPackage(tc.table, tc.operation) for _, sample := range tc.samples { @@ -311,8 +291,6 @@ func TestExplainWithSamples(t *testing.T) { } func TestConcurrentAccess(t *testing.T) { - t.Parallel() - pkg := NewPackage("test_table", "Test Scan") // Simulate concurrent access from multiple goroutines @@ -351,8 +329,6 @@ func TestConcurrentAccess(t *testing.T) { } func TestExplainFormat(t *testing.T) { - t.Parallel() - pkg := NewPackage("relationships", "Foreign Scan") pkg.AddSample(123.45, 5000) pkg.AddWidthSample(75) diff --git a/internal/fdw/tables/consistency_test.go b/internal/fdw/tables/consistency_test.go index 1f39988db..42c6643cc 100644 --- a/internal/fdw/tables/consistency_test.go +++ b/internal/fdw/tables/consistency_test.go @@ -8,8 +8,6 @@ import ( ) func TestConsistencyFromFields(t *testing.T) { - t.Parallel() - testCases := []struct { name string fields fieldMap[string] @@ -106,8 +104,6 @@ func TestConsistencyFromFields(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - consistency, err := consistencyFromFields(tc.fields, tc.parameters) if tc.expectedError != "" { @@ -147,8 +143,6 @@ func TestConsistencyFromFields(t *testing.T) { } func TestConsistencyConstants(t *testing.T) { - t.Parallel() - // Verify constants are defined correctly require.Equal(t, "minimize_latency", consistencyMinimizeLatency) require.Equal(t, "fully_consistent", consistencyFullyConsistent) @@ -156,8 +150,6 @@ func TestConsistencyConstants(t *testing.T) { } func TestConsistencyField(t *testing.T) { - t.Parallel() - // Verify consistencyField is properly configured require.Equal(t, "consistency", consistencyField.Name) require.NotZero(t, consistencyField.Oid) diff --git a/internal/fdw/tables/delete_test.go b/internal/fdw/tables/delete_test.go index d90d05b90..020d79686 100644 --- a/internal/fdw/tables/delete_test.go +++ b/internal/fdw/tables/delete_test.go @@ -9,8 +9,6 @@ import ( ) func TestParseDeleteStatement(t *testing.T) { - t.Parallel() - testCases := []struct { name string query string @@ -93,8 +91,6 @@ func TestParseDeleteStatement(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - parsed, err := pgquery.Parse(tc.query) require.NoError(t, err) @@ -121,8 +117,6 @@ func TestParseDeleteStatement(t *testing.T) { } func TestDeleteStatementReturningColumns(t *testing.T) { - t.Parallel() - testCases := []struct { name string query string @@ -147,8 +141,6 @@ func TestDeleteStatementReturningColumns(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - parsed, err := pgquery.Parse(tc.query) require.NoError(t, err) diff --git a/internal/fdw/tables/insert_test.go b/internal/fdw/tables/insert_test.go index 19201312d..b8999a515 100644 --- a/internal/fdw/tables/insert_test.go +++ b/internal/fdw/tables/insert_test.go @@ -9,8 +9,6 @@ import ( ) func TestParseInsertStatement(t *testing.T) { - t.Parallel() - testCases := []struct { name string query string @@ -101,8 +99,6 @@ func TestParseInsertStatement(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - parsed, err := pgquery.Parse(tc.query) require.NoError(t, err) @@ -123,8 +119,6 @@ func TestParseInsertStatement(t *testing.T) { } func TestInsertStatementReturningColumns(t *testing.T) { - t.Parallel() - testCases := []struct { name string query string @@ -144,8 +138,6 @@ func TestInsertStatementReturningColumns(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - parsed, err := pgquery.Parse(tc.query) require.NoError(t, err) diff --git a/internal/fdw/tables/matcher_test.go b/internal/fdw/tables/matcher_test.go index 8fd055b7a..969e7bccf 100644 --- a/internal/fdw/tables/matcher_test.go +++ b/internal/fdw/tables/matcher_test.go @@ -8,8 +8,6 @@ import ( ) func TestPatternMatcher(t *testing.T) { - t.Parallel() - testCases := []struct { name string query string @@ -64,8 +62,6 @@ func TestPatternMatcher(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - parsed, err := pgquery.Parse(tc.query) require.NoError(t, err) @@ -88,8 +84,6 @@ func TestPatternMatcher(t *testing.T) { } func TestEqualityPattern(t *testing.T) { - t.Parallel() - testCases := []struct { name string query string @@ -132,8 +126,6 @@ func TestEqualityPattern(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - parsed, err := pgquery.Parse(tc.query) require.NoError(t, err) @@ -159,8 +151,6 @@ func TestEqualityPattern(t *testing.T) { } func TestSubQueryPlaceholderPattern(t *testing.T) { - t.Parallel() - testCases := []struct { name string query string @@ -185,8 +175,6 @@ func TestSubQueryPlaceholderPattern(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - parsed, err := pgquery.Parse(tc.query) require.NoError(t, err) @@ -212,8 +200,6 @@ func TestSubQueryPlaceholderPattern(t *testing.T) { } func TestColumnRefPattern(t *testing.T) { - t.Parallel() - testCases := []struct { name string query string @@ -238,8 +224,6 @@ func TestColumnRefPattern(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - parsed, err := pgquery.Parse(tc.query) require.NoError(t, err) diff --git a/internal/fdw/tables/relationships_test.go b/internal/fdw/tables/relationships_test.go index 6e6626d8b..1bbbf6bf6 100644 --- a/internal/fdw/tables/relationships_test.go +++ b/internal/fdw/tables/relationships_test.go @@ -10,8 +10,6 @@ import ( ) func TestFilterFromFields(t *testing.T) { - t.Parallel() - testCases := []struct { name string fields fieldMap[relationshipsField] @@ -196,8 +194,6 @@ func TestFilterFromFields(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - filter, err := filterFromFields(tc.fields, tc.parameters) if tc.expectedError != "" { @@ -234,8 +230,6 @@ func TestFilterFromFields(t *testing.T) { } func TestBuildRelationshipsSelectHandler(t *testing.T) { - t.Parallel() - testCases := []struct { name string fields fieldMap[string] @@ -272,8 +266,6 @@ func TestBuildRelationshipsSelectHandler(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - handler, err := buildRelationshipsSelectHandler(tc.fields) if tc.expectedError != "" { diff --git a/internal/fdw/tables/select_test.go b/internal/fdw/tables/select_test.go index 4c1a915d2..6fec3502b 100644 --- a/internal/fdw/tables/select_test.go +++ b/internal/fdw/tables/select_test.go @@ -8,7 +8,6 @@ import ( ) func TestParseSelectStatement(t *testing.T) { - t.Parallel() tcs := []struct { name string query string @@ -173,8 +172,6 @@ func TestParseSelectStatement(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - parsed, err := pgquery.Parse(tc.query) require.NoError(t, err) diff --git a/internal/fdw/tables/statement_test.go b/internal/fdw/tables/statement_test.go index df870f7d3..dad3af12f 100644 --- a/internal/fdw/tables/statement_test.go +++ b/internal/fdw/tables/statement_test.go @@ -7,8 +7,6 @@ import ( ) func TestSelectStatementAccessors(t *testing.T) { - t.Parallel() - testCases := []struct { name string stmt *SelectStatement @@ -34,8 +32,6 @@ func TestSelectStatementAccessors(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - require.Equal(t, tc.expectedName, tc.stmt.TableName()) require.Equal(t, tc.stmt.isUnsupported, tc.stmt.IsUnsupported()) }) @@ -43,8 +39,6 @@ func TestSelectStatementAccessors(t *testing.T) { } func TestFieldMapHasFields(t *testing.T) { - t.Parallel() - testCases := []struct { name string fields fieldMap[string] @@ -86,8 +80,6 @@ func TestFieldMapHasFields(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - result := tc.fields.hasFields(tc.check...) require.Equal(t, tc.expected, result) }) @@ -95,8 +87,6 @@ func TestFieldMapHasFields(t *testing.T) { } func TestTableDefinitionMethods(t *testing.T) { - t.Parallel() - testCases := []struct { name string tableDef tableDefinition @@ -117,8 +107,6 @@ func TestTableDefinitionMethods(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - // Test columnNames names := tc.tableDef.columnNames() require.NotEmpty(t, names) diff --git a/internal/fdw/tables/util_test.go b/internal/fdw/tables/util_test.go index 084829f50..ce5b21dff 100644 --- a/internal/fdw/tables/util_test.go +++ b/internal/fdw/tables/util_test.go @@ -9,8 +9,6 @@ import ( ) func TestStringValue(t *testing.T) { - t.Parallel() - testCases := []struct { name string valueOrRef valueOrRef @@ -49,8 +47,6 @@ func TestStringValue(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - result, err := stringValue(tc.valueOrRef, tc.parameters) if tc.expectedError != "" { @@ -66,8 +62,6 @@ func TestStringValue(t *testing.T) { } func TestOptionalStringValue(t *testing.T) { - t.Parallel() - testCases := []struct { name string valueOrRef valueOrRef @@ -111,8 +105,6 @@ func TestOptionalStringValue(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - result, err := optionalStringValue(tc.valueOrRef, tc.parameters) if tc.expectedError != "" { @@ -128,8 +120,6 @@ func TestOptionalStringValue(t *testing.T) { } func TestReturningColumnsFromQuery(t *testing.T) { - t.Parallel() - testCases := []struct { name string query string @@ -160,8 +150,6 @@ func TestReturningColumnsFromQuery(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - parsed, err := pgquery.Parse(tc.query) require.NoError(t, err) require.NotEmpty(t, parsed.Stmts) diff --git a/internal/relationships/validation_test.go b/internal/relationships/validation_test.go index b8521ffb3..0645eca40 100644 --- a/internal/relationships/validation_test.go +++ b/internal/relationships/validation_test.go @@ -36,8 +36,6 @@ definition resource { }` func TestValidateRelationshipOperations(t *testing.T) { - t.Parallel() - tcs := []struct { name string schema string @@ -328,7 +326,6 @@ func TestValidateRelationshipOperations(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { - t.Parallel() req := require.New(t) ds, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) diff --git a/internal/services/integrationtesting/consistency_datastore_test.go b/internal/services/integrationtesting/consistency_datastore_test.go index 498809cd7..d2ac2fdc6 100644 --- a/internal/services/integrationtesting/consistency_datastore_test.go +++ b/internal/services/integrationtesting/consistency_datastore_test.go @@ -38,9 +38,6 @@ func TestConsistencyPerDatastore(t *testing.T) { for _, engineID := range datastore.Engines { t.Run(engineID, func(t *testing.T) { - // FIXME errors arise if spanner is run in parallel - if engineID != "spanner" { - } for _, filePath := range consistencyTestFiles { rde := testdatastore.RunDatastoreEngine(t, engineID) baseds := rde.NewDatastore(t, config.DatastoreConfigInitFunc(t, diff --git a/internal/services/integrationtesting/consistency_test.go b/internal/services/integrationtesting/consistency_test.go index 993466a88..5544a8f61 100644 --- a/internal/services/integrationtesting/consistency_test.go +++ b/internal/services/integrationtesting/consistency_test.go @@ -45,7 +45,6 @@ const testTimedelta = 1 * time.Second // both real-world schemas, as well as the full set of hand-constructed corner // cases so that the system can be fully exercised. func TestConsistency(t *testing.T) { - // List all the defined consistency test files. consistencyTestFiles, err := consistencytestutil.ListTestConfigs() require.NoError(t, err) diff --git a/internal/services/integrationtesting/ops_test.go b/internal/services/integrationtesting/ops_test.go index 14b36af0a..5d9aeeca4 100644 --- a/internal/services/integrationtesting/ops_test.go +++ b/internal/services/integrationtesting/ops_test.go @@ -120,7 +120,6 @@ func (dr deleteCaveatedRelationship) Execute(tester opsTester) error { } func TestSchemaAndRelationshipsOperations(t *testing.T) { - tcs := []schemaTestCase{ // Test: write a basic, valid schema. { diff --git a/internal/services/shared/errors_test.go b/internal/services/shared/errors_test.go index 94347726e..30af8b13b 100644 --- a/internal/services/shared/errors_test.go +++ b/internal/services/shared/errors_test.go @@ -24,8 +24,6 @@ import ( ) func TestRewriteError(t *testing.T) { - t.Parallel() - ctxCancelWithCause, cancel := context.WithCancelCause(t.Context()) cancel(fmt.Errorf("look at me i canceled this")) @@ -232,8 +230,6 @@ func TestRewriteError(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() - ctx := t.Context() if tt.inputCtx != nil { ctx = tt.inputCtx diff --git a/internal/services/v1/experimental_test.go b/internal/services/v1/experimental_test.go index 72c00ca08..0fc7133f4 100644 --- a/internal/services/v1/experimental_test.go +++ b/internal/services/v1/experimental_test.go @@ -263,8 +263,6 @@ func TestBulkExportRelationships(t *testing.T) { } func TestBulkExportRelationshipsWithFilter(t *testing.T) { - t.Parallel() - testCases := []struct { name string filter *v1.RelationshipFilter @@ -312,7 +310,6 @@ func TestBulkExportRelationshipsWithFilter(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() require := require.New(t) conn, cleanup, _, _ := testserver.NewTestServer(require, 0, memdb.DisableGC, true, tf.StandardDatastoreWithSchema) diff --git a/internal/sharederrors/error_help_links_test.go b/internal/sharederrors/error_help_links_test.go index 300cbfe43..5e842175a 100644 --- a/internal/sharederrors/error_help_links_test.go +++ b/internal/sharederrors/error_help_links_test.go @@ -9,15 +9,11 @@ import ( ) func TestHelpLinks(t *testing.T) { - t.Parallel() - c := http.Client{} t.Cleanup(c.CloseIdleConnections) for _, helpURL := range allErrorHelpUrls { t.Run(helpURL, func(t *testing.T) { - t.Parallel() - require.Eventually(t, func() bool { get, err := c.Get(helpURL) if err != nil { diff --git a/internal/taskrunner/preloadedtaskrunner_test.go b/internal/taskrunner/preloadedtaskrunner_test.go index d3e5e5e8a..f8da949d2 100644 --- a/internal/taskrunner/preloadedtaskrunner_test.go +++ b/internal/taskrunner/preloadedtaskrunner_test.go @@ -13,14 +13,11 @@ import ( "github.com/authzed/spicedb/pkg/testutil" ) -// done so we can do t.Parallel() and still use goleak func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } func TestPreloadedTaskRunnerCompletesAllTasks(t *testing.T) { - t.Parallel() - tr := NewPreloadedTaskRunner(t.Context(), 2, 5) wg := sync.WaitGroup{} @@ -42,8 +39,6 @@ func TestPreloadedTaskRunnerCompletesAllTasks(t *testing.T) { } func TestPreloadedTaskRunnerCancelsEarlyDueToError(t *testing.T) { - t.Parallel() - ctx := t.Context() ctx, cancel := context.WithCancel(ctx) defer cancel() @@ -79,8 +74,6 @@ func TestPreloadedTaskRunnerCancelsEarlyDueToError(t *testing.T) { } func TestPreloadedTaskRunnerCancelsEarlyDueToCancel(t *testing.T) { - t.Parallel() - ctx := t.Context() ctx, cancel := context.WithCancel(ctx) defer cancel() @@ -117,8 +110,6 @@ func TestPreloadedTaskRunnerCancelsEarlyDueToCancel(t *testing.T) { } func TestPreloadedTaskRunnerReturnsError(t *testing.T) { - t.Parallel() - ctx := t.Context() ctx, cancel := context.WithCancel(ctx) defer cancel() @@ -155,8 +146,6 @@ func TestPreloadedTaskRunnerReturnsError(t *testing.T) { } func TestPreloadedTaskRunnerEmpty(t *testing.T) { - t.Parallel() - ctx := t.Context() ctx, cancel := context.WithCancel(ctx) defer cancel() diff --git a/internal/testutil/subjects_test.go b/internal/testutil/subjects_test.go index 22e570f33..3de8cb53d 100644 --- a/internal/testutil/subjects_test.go +++ b/internal/testutil/subjects_test.go @@ -22,8 +22,6 @@ var ( ) func TestCompareSubjects(t *testing.T) { - t.Parallel() - tcs := []struct { first *v1.FoundSubject second *v1.FoundSubject @@ -150,8 +148,6 @@ func TestCompareSubjects(t *testing.T) { for _, tc := range tcs { t.Run(fmt.Sprintf("%s vs %s", FormatSubject(tc.first), FormatSubject(tc.second)), func(t *testing.T) { - t.Parallel() - err := CheckEquivalentSubjects(tc.first, tc.second) if tc.expectedEquivalent { require.NoError(t, err) diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go index b031b025a..8f831c96d 100644 --- a/pkg/cache/cache_test.go +++ b/pkg/cache/cache_test.go @@ -10,8 +10,6 @@ import ( ) func TestCacheWithMetrics(t *testing.T) { - t.Parallel() - config := &Config{ NumCounters: 10000, MaxCost: 1000, @@ -19,14 +17,12 @@ func TestCacheWithMetrics(t *testing.T) { } t.Run("otter", func(t *testing.T) { - t.Parallel() testCacheImplementation(t, func() (Cache[StringKey, string], error) { return NewOtterCacheWithMetrics[StringKey, string]("test-otter", config) }) }) t.Run("ristretto", func(t *testing.T) { - t.Parallel() testCacheImplementation(t, func() (Cache[StringKey, string], error) { // Use the metrics version for proper metrics tracking return NewRistrettoCacheWithMetrics[StringKey, string]("test-ristretto", config) @@ -34,7 +30,6 @@ func TestCacheWithMetrics(t *testing.T) { }) t.Run("theine", func(t *testing.T) { - t.Parallel() testCacheImplementation(t, func() (Cache[StringKey, string], error) { return NewTheineCacheWithMetrics[StringKey, string]("test-theine", config) }) diff --git a/pkg/cmd/datastore_test.go b/pkg/cmd/datastore_test.go index 5dff2b400..93831676e 100644 --- a/pkg/cmd/datastore_test.go +++ b/pkg/cmd/datastore_test.go @@ -10,8 +10,6 @@ import ( ) func TestExecuteGC(t *testing.T) { - t.Parallel() - tests := []struct { name string cfgBuilder func(t *testing.T) *datastore.Config @@ -34,8 +32,6 @@ func TestExecuteGC(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() - cfg := tt.cfgBuilder(t) err := executeGC(t.Context(), cfg) require.ErrorContains(t, err, tt.expectedError) @@ -44,8 +40,6 @@ func TestExecuteGC(t *testing.T) { } func TestExecuteRepair(t *testing.T) { - t.Parallel() - tests := []struct { name string cfgBuilder func(t *testing.T) *datastore.Config @@ -81,8 +75,6 @@ func TestExecuteRepair(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() - cfg := tt.cfgBuilder(t) err := executeRepair(cfg, []string{}) if tt.expectedError == "" { diff --git a/pkg/composableschemadsl/compiler/compiler_test.go b/pkg/composableschemadsl/compiler/compiler_test.go index e6f3819aa..f6a6c4751 100644 --- a/pkg/composableschemadsl/compiler/compiler_test.go +++ b/pkg/composableschemadsl/compiler/compiler_test.go @@ -21,8 +21,6 @@ var ( ) func TestCompile(t *testing.T) { - t.Parallel() - type compileTest struct { name string objectPrefix ObjectPrefixOption @@ -1415,7 +1413,6 @@ func TestCompile(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - t.Parallel() require := require.New(t) compiled, err := Compile(InputSchema{ input.Source(test.name), test.input, @@ -1494,8 +1491,6 @@ func filterSourcePositions(m protoreflect.Message) { } func TestSkipValidation(t *testing.T) { - t.Parallel() - _, err := Compile(InputSchema{"test", `definition a/def {}`}, AllowUnprefixedObjectType()) require.Error(t, err) @@ -1504,8 +1499,6 @@ func TestSkipValidation(t *testing.T) { } func TestSuperLargeCaveatCompile(t *testing.T) { - t.Parallel() - b, err := os.ReadFile("../parser/tests/superlarge.zed") if err != nil { panic(err) diff --git a/pkg/composableschemadsl/compiler/development_test.go b/pkg/composableschemadsl/compiler/development_test.go index e2643e906..322a7443c 100644 --- a/pkg/composableschemadsl/compiler/development_test.go +++ b/pkg/composableschemadsl/compiler/development_test.go @@ -10,8 +10,6 @@ import ( ) func TestPositionToAstNode(t *testing.T) { - t.Parallel() - tcs := []struct { name string schema string @@ -218,8 +216,6 @@ func TestPositionToAstNode(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - compiled, err := Compile(InputSchema{ Source: input.Source("test"), SchemaString: tc.schema, @@ -256,8 +252,6 @@ func TestPositionToAstNode(t *testing.T) { } func TestNodeChainString(t *testing.T) { - t.Parallel() - tcs := []struct { name string schema string @@ -389,8 +383,6 @@ func TestNodeChainString(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - compiled, err := Compile(InputSchema{ Source: input.Source("test"), SchemaString: tc.schema, diff --git a/pkg/composableschemadsl/compiler/importer_test.go b/pkg/composableschemadsl/compiler/importer_test.go index 5a2a20502..cd7943a6f 100644 --- a/pkg/composableschemadsl/compiler/importer_test.go +++ b/pkg/composableschemadsl/compiler/importer_test.go @@ -55,8 +55,6 @@ func (it *importerTest) writeExpected(schema string) { } func TestImporter(t *testing.T) { - t.Parallel() - workingDir, err := os.Getwd() require.NoError(t, err) @@ -74,8 +72,6 @@ func TestImporter(t *testing.T) { for _, test := range importerTests { t.Run(test.name, func(t *testing.T) { - t.Parallel() - sourceFolder := path.Join(workingDir, test.relativePath()) inputSchema := test.input() @@ -100,8 +96,6 @@ func TestImporter(t *testing.T) { } }) t.Run("fs/"+test.name, func(t *testing.T) { - t.Parallel() - fsys, err := fs.Sub(testFS, filepath.Join("importer-test", test.folder)) require.NoError(t, err) @@ -130,8 +124,6 @@ func TestImporter(t *testing.T) { } func TestImportCycleCausesError(t *testing.T) { - t.Parallel() - workingDir, err := os.Getwd() require.NoError(t, err) test := importerTest{"", "circular-import"} @@ -150,8 +142,6 @@ func TestImportCycleCausesError(t *testing.T) { } func TestEscapeAttemptCausesError(t *testing.T) { - t.Parallel() - workingDir, err := os.Getwd() require.NoError(t, err) test := importerTest{"", "escape-attempt"} diff --git a/pkg/composableschemadsl/parser/parser_test.go b/pkg/composableschemadsl/parser/parser_test.go index c64385018..3178e6b69 100644 --- a/pkg/composableschemadsl/parser/parser_test.go +++ b/pkg/composableschemadsl/parser/parser_test.go @@ -89,8 +89,6 @@ func (tn *testNode) MustDecorateWithInt(property string, value int) AstNode { } func TestParser(t *testing.T) { - t.Parallel() - parserTests := []parserTest{ {"empty file test", "empty"}, {"basic definition test", "basic"}, @@ -150,7 +148,6 @@ func TestParser(t *testing.T) { for _, test := range parserTests { t.Run(test.name, func(t *testing.T) { - t.Parallel() root := Parse(createAstNode, input.Source(test.name), test.input()) parseTree := getParseTree((root).(*testNode), 0) assert := assert.New(t) diff --git a/pkg/datastore/pagination/iterator_test.go b/pkg/datastore/pagination/iterator_test.go index 919a87b5f..8470fef9c 100644 --- a/pkg/datastore/pagination/iterator_test.go +++ b/pkg/datastore/pagination/iterator_test.go @@ -19,8 +19,6 @@ import ( ) func TestPaginatedIterator(t *testing.T) { - t.Parallel() - testCases := []struct { order options.SortOrder pageSize int @@ -39,7 +37,6 @@ func TestPaginatedIterator(t *testing.T) { for _, tc := range testCases { t.Run(fmt.Sprintf("%d/%d-%d", tc.pageSize, tc.totalRelationships, tc.order), func(t *testing.T) { - t.Parallel() require := require.New(t) rels := make([]tuple.Relationship, 0, tc.totalRelationships) diff --git a/pkg/datastore/test/datastore.go b/pkg/datastore/test/datastore.go index 105a2f475..041671ce9 100644 --- a/pkg/datastore/test/datastore.go +++ b/pkg/datastore/test/datastore.go @@ -107,7 +107,6 @@ func WithCategories(cats ...string) Categories { func parallel(tester DatastoreTester, tt func(t *testing.T, tester DatastoreTester)) func(t *testing.T) { return func(t *testing.T) { - t.Parallel() tt(t, tester) } } diff --git a/pkg/genutil/slicez/chunking_test.go b/pkg/genutil/slicez/chunking_test.go index 9e2fbf008..c235db307 100644 --- a/pkg/genutil/slicez/chunking_test.go +++ b/pkg/genutil/slicez/chunking_test.go @@ -10,13 +10,9 @@ import ( ) func TestForEachChunk(t *testing.T) { - t.Parallel() - for _, dataSize := range []int{0, 1, 5, 10, 50, 100, 250} { for _, chunkSize := range []uint16{1, 2, 3, 5, 10, 50} { t.Run(fmt.Sprintf("test-%d-%d", dataSize, chunkSize), func(t *testing.T) { - t.Parallel() - data := make([]int, dataSize) for i := range dataSize { data[i] = i @@ -35,8 +31,6 @@ func TestForEachChunk(t *testing.T) { } func TestForEachChunkUntil(t *testing.T) { - t.Parallel() - data := []int{1, 2, 3, 4, 5} errAny := errors.New("any error") @@ -75,8 +69,6 @@ func TestForEachChunkZeroChunkSize(t *testing.T) { } func TestForEachChunkOverflowPanic(t *testing.T) { - t.Parallel() - datasize := math.MaxUint16 chunksize := uint16(50) data := make([]int, 0, datasize) @@ -95,13 +87,9 @@ func TestForEachChunkOverflowPanic(t *testing.T) { } func TestForEachChunkOverflowIncorrect(t *testing.T) { - t.Parallel() - chunksize := uint16(50) for _, datasize := range []int{math.MaxUint16 + int(chunksize), 10_000_000} { t.Run(fmt.Sprintf("test-%d-%d", datasize, chunksize), func(t *testing.T) { - t.Parallel() - data := make([]int, 0, datasize) for i := range datasize { data = append(data, i) diff --git a/pkg/middleware/consistency/consistency_test.go b/pkg/middleware/consistency/consistency_test.go index 312884882..05af964a5 100644 --- a/pkg/middleware/consistency/consistency_test.go +++ b/pkg/middleware/consistency/consistency_test.go @@ -260,7 +260,6 @@ func TestRevisionFromContextMissingConsistency(t *testing.T) { } func TestRewriteDatastoreError(t *testing.T) { - t.Parallel() type tc struct { name string err error @@ -296,7 +295,6 @@ func TestRewriteDatastoreError(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { - t.Parallel() err := rewriteDatastoreError(tc.err) require.Error(t, err) grpcutil.RequireStatus(t, tc.code, err) diff --git a/pkg/query/advisor_combine_test.go b/pkg/query/advisor_combine_test.go index b4f2ea179..6ff657c36 100644 --- a/pkg/query/advisor_combine_test.go +++ b/pkg/query/advisor_combine_test.go @@ -8,11 +8,7 @@ import ( ) func TestCombinePlanAdvisors_GetHints(t *testing.T) { - t.Parallel() - t.Run("returns first non-nil hints", func(t *testing.T) { - t.Parallel() - advisor1 := &mockAdvisor{ hints: []Hint{func(Iterator) error { return nil }}, } @@ -28,8 +24,6 @@ func TestCombinePlanAdvisors_GetHints(t *testing.T) { }) t.Run("falls back to second advisor if first returns empty", func(t *testing.T) { - t.Parallel() - advisor1 := &mockAdvisor{ hints: []Hint{}, } @@ -45,8 +39,6 @@ func TestCombinePlanAdvisors_GetHints(t *testing.T) { }) t.Run("returns nil if all advisors return empty", func(t *testing.T) { - t.Parallel() - advisor1 := &mockAdvisor{ hints: []Hint{}, } @@ -62,8 +54,6 @@ func TestCombinePlanAdvisors_GetHints(t *testing.T) { }) t.Run("returns error from first advisor that errors", func(t *testing.T) { - t.Parallel() - testErr := errors.New("test error") advisor1 := &mockAdvisor{ err: testErr, @@ -80,8 +70,6 @@ func TestCombinePlanAdvisors_GetHints(t *testing.T) { }) t.Run("runs through all advisors until non-empty", func(t *testing.T) { - t.Parallel() - advisor1 := &mockAdvisor{ hints: []Hint{}, } @@ -101,11 +89,7 @@ func TestCombinePlanAdvisors_GetHints(t *testing.T) { } func TestCombinePlanAdvisors_GetMutations(t *testing.T) { - t.Parallel() - t.Run("returns first non-nil mutations", func(t *testing.T) { - t.Parallel() - advisor1 := &mockAdvisor{ mutations: []OutlineMutation{func(o Outline) Outline { return o }}, } @@ -121,8 +105,6 @@ func TestCombinePlanAdvisors_GetMutations(t *testing.T) { }) t.Run("falls back to second advisor if first returns empty", func(t *testing.T) { - t.Parallel() - advisor1 := &mockAdvisor{ mutations: []OutlineMutation{}, } @@ -138,8 +120,6 @@ func TestCombinePlanAdvisors_GetMutations(t *testing.T) { }) t.Run("returns nil if all advisors return empty", func(t *testing.T) { - t.Parallel() - advisor1 := &mockAdvisor{ mutations: []OutlineMutation{}, } @@ -155,8 +135,6 @@ func TestCombinePlanAdvisors_GetMutations(t *testing.T) { }) t.Run("returns error from first advisor that errors", func(t *testing.T) { - t.Parallel() - testErr := errors.New("test error") advisor1 := &mockAdvisor{ err: testErr, @@ -173,8 +151,6 @@ func TestCombinePlanAdvisors_GetMutations(t *testing.T) { }) t.Run("runs through all advisors until non-empty", func(t *testing.T) { - t.Parallel() - advisor1 := &mockAdvisor{ mutations: []OutlineMutation{}, } diff --git a/pkg/query/advisor_count_test.go b/pkg/query/advisor_count_test.go index ac6c23def..1706482c0 100644 --- a/pkg/query/advisor_count_test.go +++ b/pkg/query/advisor_count_test.go @@ -28,8 +28,6 @@ func applyDirectionHint(t *testing.T, hints []Hint) arrowDirection { } func TestCountAdvisor_GetHints_NonArrow(t *testing.T) { - t.Parallel() - advisor := NewCountAdvisor(nil) outline := Outline{Type: UnionIteratorType} @@ -39,8 +37,6 @@ func TestCountAdvisor_GetHints_NonArrow(t *testing.T) { } func TestCountAdvisor_GetHints_NoData(t *testing.T) { - t.Parallel() - // With no stats at all, both sides default to defaultArrowFanout. // rightFanout == leftFanout, so the condition rightFanout < leftFanout is false // and we expect leftToRight (keep default). @@ -58,8 +54,6 @@ func TestCountAdvisor_GetHints_NoData(t *testing.T) { } func TestCountAdvisor_GetHints_LeftHighFanout(t *testing.T) { - t.Parallel() - // Left fanout = 10/1 = 10, right fanout = 2/1 = 2. // rightFanout (2) < leftFanout (10) → reverse. advisor := NewCountAdvisor(map[CanonicalKey]CountStats{ @@ -79,8 +73,6 @@ func TestCountAdvisor_GetHints_LeftHighFanout(t *testing.T) { } func TestCountAdvisor_GetHints_RightHighFanout(t *testing.T) { - t.Parallel() - // Left fanout = 2/1 = 2, right fanout = 10/1 = 10. // rightFanout (10) > leftFanout (2) → keep leftToRight. advisor := NewCountAdvisor(map[CanonicalKey]CountStats{ @@ -100,8 +92,6 @@ func TestCountAdvisor_GetHints_RightHighFanout(t *testing.T) { } func TestCountAdvisor_GetHints_EqualFanout(t *testing.T) { - t.Parallel() - // Both fanouts equal (5/1 = 5 each) → not strictly less → leftToRight. advisor := NewCountAdvisor(map[CanonicalKey]CountStats{ "left": {IterSubjectsCalls: 1, IterSubjectsResults: 5}, @@ -120,8 +110,6 @@ func TestCountAdvisor_GetHints_EqualFanout(t *testing.T) { } func TestCountAdvisor_GetHints_OnlyLeftData(t *testing.T) { - t.Parallel() - // Left fanout = 10/1 = 10; right has no data → defaults to defaultArrowFanout (3). // rightFanout (3) < leftFanout (10) → reverse. advisor := NewCountAdvisor(map[CanonicalKey]CountStats{ @@ -140,8 +128,6 @@ func TestCountAdvisor_GetHints_OnlyLeftData(t *testing.T) { } func TestCountAdvisor_GetHints_OnlyRightData(t *testing.T) { - t.Parallel() - // Right fanout = 10/1 = 10; left has no data → defaults to defaultArrowFanout (3). // rightFanout (10) > leftFanout (3) → leftToRight. advisor := NewCountAdvisor(map[CanonicalKey]CountStats{ @@ -160,8 +146,6 @@ func TestCountAdvisor_GetHints_OnlyRightData(t *testing.T) { } func TestCountAdvisor_GetMutations_AlwaysNil(t *testing.T) { - t.Parallel() - advisor := NewCountAdvisor(nil) for _, typ := range []IteratorType{ diff --git a/pkg/query/advisor_static_test.go b/pkg/query/advisor_static_test.go index 93cdba614..8a6ef9d84 100644 --- a/pkg/query/advisor_static_test.go +++ b/pkg/query/advisor_static_test.go @@ -10,13 +10,9 @@ import ( ) func TestStaticAdvisor_GetHints_ArrowDirection(t *testing.T) { - t.Parallel() - advisor := DefaultStaticAdvisor() t.Run("prefers right-to-left when right is cheaper", func(t *testing.T) { - t.Parallel() - // Create an arrow outline where right has low cardinality (1 path) // and left has higher cardinality (3 paths) // This should prefer right-to-left execution @@ -62,8 +58,6 @@ func TestStaticAdvisor_GetHints_ArrowDirection(t *testing.T) { }) t.Run("prefers left-to-right when left is cheaper", func(t *testing.T) { - t.Parallel() - // Create an arrow outline where left has low cardinality (1 path) // and right has higher cardinality (3 paths) // This should prefer left-to-right execution @@ -108,8 +102,6 @@ func TestStaticAdvisor_GetHints_ArrowDirection(t *testing.T) { }) t.Run("non-arrow outline returns no hints", func(t *testing.T) { - t.Parallel() - unionOutline := Outline{ Type: UnionIteratorType, SubOutlines: []Outline{ @@ -129,13 +121,9 @@ func TestStaticAdvisor_GetHints_ArrowDirection(t *testing.T) { } func TestStaticAdvisor_CostOutline(t *testing.T) { - t.Parallel() - advisor := DefaultStaticAdvisor() t.Run("fixed iterator", func(t *testing.T) { - t.Parallel() - outline := Outline{ Type: FixedIteratorType, Args: &IteratorArgs{ @@ -155,8 +143,6 @@ func TestStaticAdvisor_CostOutline(t *testing.T) { }) t.Run("datastore iterator", func(t *testing.T) { - t.Parallel() - baseRel := schema.NewTestBaseRelation("document", "viewer", "user", tuple.Ellipsis) outline := Outline{ Type: DatastoreIteratorType, @@ -174,8 +160,6 @@ func TestStaticAdvisor_CostOutline(t *testing.T) { }) t.Run("union iterator", func(t *testing.T) { - t.Parallel() - outline := Outline{ Type: UnionIteratorType, SubOutlines: []Outline{ @@ -206,8 +190,6 @@ func TestStaticAdvisor_CostOutline(t *testing.T) { }) t.Run("arrow iterator", func(t *testing.T) { - t.Parallel() - outline := Outline{ Type: ArrowIteratorType, SubOutlines: []Outline{ @@ -242,13 +224,9 @@ func TestStaticAdvisor_CostOutline(t *testing.T) { } func TestStaticAdvisor_GetMutations(t *testing.T) { - t.Parallel() - advisor := DefaultStaticAdvisor() t.Run("union reorders by descending selectivity", func(t *testing.T) { - t.Parallel() - // Create union with different selectivities // Intersection has lower selectivity (0.9 * 0.9 = 0.81) lowSelectivity := Outline{ @@ -285,8 +263,6 @@ func TestStaticAdvisor_GetMutations(t *testing.T) { }) t.Run("intersection reorders by ascending selectivity", func(t *testing.T) { - t.Parallel() - // Create intersection with different selectivities // Single fixed has higher selectivity (0.9) highSelectivity := Outline{ @@ -323,8 +299,6 @@ func TestStaticAdvisor_GetMutations(t *testing.T) { }) t.Run("returns nil when order is already optimal", func(t *testing.T) { - t.Parallel() - // Union already in optimal order (high selectivity first) child1 := Outline{Type: FixedIteratorType, Args: &IteratorArgs{FixedPaths: []Path{MustPathFromString("document:doc1#viewer@user:alice")}}} child2 := Outline{Type: FixedIteratorType, Args: &IteratorArgs{FixedPaths: []Path{MustPathFromString("document:doc2#viewer@user:bob")}}} @@ -340,8 +314,6 @@ func TestStaticAdvisor_GetMutations(t *testing.T) { }) t.Run("returns nil for single child", func(t *testing.T) { - t.Parallel() - unionOutline := Outline{ Type: UnionIteratorType, SubOutlines: []Outline{ @@ -355,8 +327,6 @@ func TestStaticAdvisor_GetMutations(t *testing.T) { }) t.Run("returns nil for non-union/intersection", func(t *testing.T) { - t.Parallel() - arrowOutline := Outline{ Type: ArrowIteratorType, SubOutlines: []Outline{ @@ -371,8 +341,6 @@ func TestStaticAdvisor_GetMutations(t *testing.T) { }) t.Run("handles three children", func(t *testing.T) { - t.Parallel() - // Create three children with different selectivities // Use nested intersections to get different selectivities low := Outline{ @@ -420,15 +388,13 @@ func TestStaticAdvisor_GetMutations(t *testing.T) { }) t.Run("arrow rebalancing - left nested arrow cheaper to rotate", func(t *testing.T) { - t.Parallel() - // Create (A->B)->C where A has high cardinality and B,C have low cardinality // Original cost: A.IterSubjects + (A.Card * B.CheckCost), then result.IterSubjects + (result.Card * C.CheckCost) // Alternative A->(B->C) might be cheaper // A has 10 paths (high cardinality) aPaths := make([]Path, 10) - for i := 0; i < 10; i++ { + for i := range 10 { aPaths[i] = MustPathFromString("document:doc" + string(rune('0'+i)) + "#viewer@user:alice") } a := Outline{ @@ -471,8 +437,6 @@ func TestStaticAdvisor_GetMutations(t *testing.T) { }) t.Run("arrow rebalancing - right nested arrow", func(t *testing.T) { - t.Parallel() - // Create A->(B->C) and check if it should be rotated a := Outline{ Type: FixedIteratorType, @@ -507,8 +471,6 @@ func TestStaticAdvisor_GetMutations(t *testing.T) { }) t.Run("arrow rebalancing - no nested arrows", func(t *testing.T) { - t.Parallel() - a := Outline{Type: FixedIteratorType, Args: &IteratorArgs{FixedPaths: []Path{MustPathFromString("document:doc1#viewer@user:alice")}}} b := Outline{Type: FixedIteratorType, Args: &IteratorArgs{FixedPaths: []Path{MustPathFromString("folder:f1#viewer@user:bob")}}} diff --git a/pkg/query/alias_test.go b/pkg/query/alias_test.go index 5d07253fc..c4a60f890 100644 --- a/pkg/query/alias_test.go +++ b/pkg/query/alias_test.go @@ -7,13 +7,10 @@ import ( ) func TestAliasIterator(t *testing.T) { - t.Parallel() - // Create test context ctx := NewLocalContext(t.Context()) t.Run("Check_BasicRelationRewriting", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a sub-iterator with document relations @@ -44,7 +41,6 @@ func TestAliasIterator(t *testing.T) { }) t.Run("Check_SelfEdgeDetection", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create an empty sub-iterator since we only want to test self-edge detection @@ -76,7 +72,6 @@ func TestAliasIterator(t *testing.T) { }) t.Run("Check_NoSelfEdge", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a sub-iterator @@ -100,7 +95,6 @@ func TestAliasIterator(t *testing.T) { }) t.Run("Check_MultipleResources", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewDocumentAccessFixedIterator() @@ -127,7 +121,6 @@ func TestAliasIterator(t *testing.T) { }) t.Run("IterSubjects_RelationRewriting", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewDocumentAccessFixedIterator() @@ -148,7 +141,6 @@ func TestAliasIterator(t *testing.T) { }) t.Run("IterResources_RelationRewriting", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewDocumentAccessFixedIterator() @@ -167,7 +159,6 @@ func TestAliasIterator(t *testing.T) { }) t.Run("IterResources_SelfEdgeDetection", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create an empty sub-iterator since we only want to test self-edge detection @@ -199,7 +190,6 @@ func TestAliasIterator(t *testing.T) { }) t.Run("Check_EmptySubIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewEmptyFixedIterator() @@ -214,7 +204,6 @@ func TestAliasIterator(t *testing.T) { }) t.Run("Check_SelfEdgeWithEmptySubIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create empty sub-iterator @@ -235,7 +224,6 @@ func TestAliasIterator(t *testing.T) { }) t.Run("Check_SelfEdgeExactMatch", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewEmptyFixedIterator() @@ -264,8 +252,6 @@ func TestAliasIterator(t *testing.T) { } func TestAliasIteratorClone(t *testing.T) { - t.Parallel() - require := require.New(t) subIt := NewDocumentAccessFixedIterator() @@ -286,10 +272,7 @@ func TestAliasIteratorClone(t *testing.T) { } func TestAliasIteratorExplain(t *testing.T) { - t.Parallel() - t.Run("ExplainWithSubIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewDocumentAccessFixedIterator() @@ -305,7 +288,6 @@ func TestAliasIteratorExplain(t *testing.T) { }) t.Run("ExplainWithEmptySubIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewEmptyFixedIterator() @@ -318,13 +300,10 @@ func TestAliasIteratorExplain(t *testing.T) { } func TestAliasIteratorErrorHandling(t *testing.T) { - t.Parallel() - // Create test context ctx := NewLocalContext(t.Context()) t.Run("Check_SubIteratorError", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a faulty sub-iterator @@ -336,7 +315,6 @@ func TestAliasIteratorErrorHandling(t *testing.T) { }) t.Run("Check_SubIteratorCollectionError", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a faulty sub-iterator that fails during collection @@ -352,7 +330,6 @@ func TestAliasIteratorErrorHandling(t *testing.T) { }) t.Run("IterSubjects_SubIteratorError", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a faulty sub-iterator that fails on IterSubjectsImpl @@ -365,7 +342,6 @@ func TestAliasIteratorErrorHandling(t *testing.T) { }) t.Run("IterSubjects_SubIteratorCollectionError", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a faulty sub-iterator that fails during collection @@ -382,7 +358,6 @@ func TestAliasIteratorErrorHandling(t *testing.T) { }) t.Run("IterResources_SubIteratorError", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a faulty sub-iterator that fails on IterResourcesImpl @@ -395,7 +370,6 @@ func TestAliasIteratorErrorHandling(t *testing.T) { }) t.Run("IterResources_SubIteratorCollectionError", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a faulty sub-iterator that fails during collection @@ -412,7 +386,6 @@ func TestAliasIteratorErrorHandling(t *testing.T) { }) t.Run("Check_SelfEdgeWithSubIteratorError", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a faulty sub-iterator that errors on CheckImpl @@ -428,7 +401,6 @@ func TestAliasIteratorErrorHandling(t *testing.T) { }) t.Run("Check_SelfEdgeWithSubIteratorCollectionError", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a faulty sub-iterator that fails during collection @@ -448,13 +420,10 @@ func TestAliasIteratorErrorHandling(t *testing.T) { } func TestAliasIteratorAdvancedScenarios(t *testing.T) { - t.Parallel() - // Create test context ctx := NewLocalContext(t.Context()) t.Run("Check_MultipleResourcesSelfEdgeWithSubResults", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create sub-iterator with real data @@ -494,7 +463,6 @@ func TestAliasIteratorAdvancedScenarios(t *testing.T) { }) t.Run("Check_MultipleResourcesMultipleSelfEdges", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create empty sub-iterator to isolate self-edge logic @@ -522,7 +490,6 @@ func TestAliasIteratorAdvancedScenarios(t *testing.T) { }) t.Run("IterSubjects_EmptySubIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewEmptyFixedIterator() @@ -537,7 +504,6 @@ func TestAliasIteratorAdvancedScenarios(t *testing.T) { }) t.Run("IterResources_EmptySubIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewEmptyFixedIterator() @@ -552,7 +518,6 @@ func TestAliasIteratorAdvancedScenarios(t *testing.T) { }) t.Run("Check_LargeResultSet", func(t *testing.T) { - t.Parallel() require := require.New(t) // Use iterator with many results @@ -576,7 +541,6 @@ func TestAliasIteratorAdvancedScenarios(t *testing.T) { }) t.Run("Clone_Independence", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewDocumentAccessFixedIterator() @@ -612,7 +576,6 @@ func TestAliasIteratorAdvancedScenarios(t *testing.T) { }) t.Run("Check_EarlyReturnBasicRewriting", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewDocumentAccessFixedIterator() @@ -635,7 +598,6 @@ func TestAliasIteratorAdvancedScenarios(t *testing.T) { }) t.Run("Check_EarlyReturnSelfEdgeWithSubResults", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewDocumentAccessFixedIterator() @@ -660,7 +622,6 @@ func TestAliasIteratorAdvancedScenarios(t *testing.T) { }) t.Run("IterSubjects_EarlyReturn", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewDocumentAccessFixedIterator() @@ -683,7 +644,6 @@ func TestAliasIteratorAdvancedScenarios(t *testing.T) { }) t.Run("IterResources_EarlyReturn", func(t *testing.T) { - t.Parallel() require := require.New(t) subIt := NewDocumentAccessFixedIterator() @@ -706,7 +666,6 @@ func TestAliasIteratorAdvancedScenarios(t *testing.T) { }) t.Run("Check_SelfEdgeWithSubIteratorPathRewriting", func(t *testing.T) { - t.Parallel() require := require.New(t) // Use sub-iterator that will return paths that need rewriting @@ -747,10 +706,7 @@ func TestAliasIteratorAdvancedScenarios(t *testing.T) { } func TestAlias_Types(t *testing.T) { - t.Parallel() - t.Run("ResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create an alias iterator @@ -765,7 +721,6 @@ func TestAlias_Types(t *testing.T) { }) t.Run("SubjectTypes", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create an alias iterator diff --git a/pkg/query/arrow_test.go b/pkg/query/arrow_test.go index 4f5563f17..d99f4de57 100644 --- a/pkg/query/arrow_test.go +++ b/pkg/query/arrow_test.go @@ -11,19 +11,15 @@ import ( // testArrowBothDirections runs the same test with both arrow directions func testArrowBothDirections(t *testing.T, name string, testFn func(t *testing.T, direction arrowDirection)) { t.Run(name+"_LTR", func(t *testing.T) { - t.Parallel() testFn(t, leftToRight) }) t.Run(name+"_RTL", func(t *testing.T) { - t.Parallel() testFn(t, rightToLeft) }) } func TestArrowIterator(t *testing.T) { - t.Parallel() - // Create test iterators using fixed helpers // Left side: document parent relationships to folders leftRels := NewFolderHierarchyFixedIterator() @@ -34,7 +30,6 @@ func TestArrowIterator(t *testing.T) { arrow := NewArrowIterator(leftRels, rightRels) t.Run("Check", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create context with LocalExecutor @@ -57,7 +52,6 @@ func TestArrowIterator(t *testing.T) { }) t.Run("Check_EmptyResources", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create context with LocalExecutor @@ -72,7 +66,6 @@ func TestArrowIterator(t *testing.T) { }) t.Run("Check_NonexistentResource", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create context with LocalExecutor @@ -88,7 +81,6 @@ func TestArrowIterator(t *testing.T) { }) t.Run("Check_NoMatchingSubject", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create context with LocalExecutor @@ -104,7 +96,6 @@ func TestArrowIterator(t *testing.T) { }) t.Run("IterSubjects", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create context with LocalExecutor @@ -134,7 +125,6 @@ func TestArrowIterator(t *testing.T) { }) t.Run("IterResources", func(t *testing.T) { - t.Parallel() require := require.New(t) logger := NewTraceLogger() @@ -164,8 +154,6 @@ func TestArrowIterator(t *testing.T) { } func TestArrowIteratorClone(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test iterators using fixed helpers @@ -206,8 +194,6 @@ func TestArrowIteratorClone(t *testing.T) { } func TestArrowIteratorExplain(t *testing.T) { - t.Parallel() - require := require.New(t) leftRels := NewFolderHierarchyFixedIterator() rightRels := NewDocumentAccessFixedIterator() @@ -223,8 +209,6 @@ func TestArrowIteratorExplain(t *testing.T) { } func TestArrowIteratorMultipleResources(t *testing.T) { - t.Parallel() - require := require.New(t) leftRels := NewFolderHierarchyFixedIterator() // Documents -> Folders @@ -257,16 +241,12 @@ func TestArrowIteratorMultipleResources(t *testing.T) { } func TestArrowIteratorCaveatCombination(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context ctx := NewLocalContext(t.Context()) t.Run("CombineTwoCaveats_AND_Logic", func(t *testing.T) { - t.Parallel() - // Left side path with caveat leftPath := MustPathFromString("document:doc1#parent@folder:folder1") leftPath.Caveat = &core.CaveatExpression{ @@ -307,8 +287,6 @@ func TestArrowIteratorCaveatCombination(t *testing.T) { }) t.Run("LeftCaveat_Right_NoCaveat", func(t *testing.T) { - t.Parallel() - // Left side path with caveat leftPath := MustPathFromString("document:doc1#parent@folder:folder1") leftPath.Caveat = &core.CaveatExpression{ @@ -339,8 +317,6 @@ func TestArrowIteratorCaveatCombination(t *testing.T) { }) t.Run("Left_NoCaveat_Right_Caveat", func(t *testing.T) { - t.Parallel() - // Left side path with no caveat leftPath := MustPathFromString("document:doc1#parent@folder:folder1") @@ -371,8 +347,6 @@ func TestArrowIteratorCaveatCombination(t *testing.T) { }) t.Run("Neither_Side_Has_Caveat", func(t *testing.T) { - t.Parallel() - // Left side path with no caveat leftPath := MustPathFromString("document:doc1#parent@folder:folder1") @@ -395,8 +369,6 @@ func TestArrowIteratorCaveatCombination(t *testing.T) { }) t.Run("Multiple_Relations_Mixed_Caveats", func(t *testing.T) { - t.Parallel() - // Left side has multiple paths, some with caveats leftPath1 := MustPathFromString("document:doc1#parent@folder:folder1") leftPath1.Caveat = &core.CaveatExpression{ @@ -450,8 +422,6 @@ func TestArrowIteratorCaveatCombination(t *testing.T) { }) t.Run("No_Matching_Arrow_Relations", func(t *testing.T) { - t.Parallel() - // Left side points to folder1, but right side only has folder2 leftPath := MustPathFromString("document:doc1#parent@folder:folder1") leftPath.Caveat = &core.CaveatExpression{ @@ -487,8 +457,6 @@ func TestArrowIteratorCaveatCombination(t *testing.T) { } func TestArrowIterSubjects(t *testing.T) { - t.Parallel() - require := require.New(t) ctx := &Context{ @@ -497,8 +465,6 @@ func TestArrowIterSubjects(t *testing.T) { } t.Run("SimpleArrow", func(t *testing.T) { - t.Parallel() - // Left: doc1 -> folder1 // Right: folder1 -> alice leftPath := MustPathFromString("document:doc1#parent@folder:folder1") @@ -521,8 +487,6 @@ func TestArrowIterSubjects(t *testing.T) { }) t.Run("MultipleSubjects", func(t *testing.T) { - t.Parallel() - // Left: doc1 -> folder1 // Right: folder1 -> alice, folder1 -> bob leftPath := MustPathFromString("document:doc1#parent@folder:folder1") @@ -551,8 +515,6 @@ func TestArrowIterSubjects(t *testing.T) { }) t.Run("NoLeftPaths", func(t *testing.T) { - t.Parallel() - // Empty left side leftIter := NewFixedIterator() rightPath := MustPathFromString("folder:folder1#viewer@user:alice") @@ -570,8 +532,6 @@ func TestArrowIterSubjects(t *testing.T) { }) t.Run("NoRightPaths", func(t *testing.T) { - t.Parallel() - // Left exists but right is empty leftPath := MustPathFromString("document:doc1#parent@folder:folder1") leftIter := NewFixedIterator(leftPath) @@ -589,8 +549,6 @@ func TestArrowIterSubjects(t *testing.T) { }) t.Run("CaveatCombination", func(t *testing.T) { - t.Parallel() - // Left with caveat leftPath := MustPathFromString("document:doc1#parent@folder:folder1") leftPath.Caveat = &core.CaveatExpression{ @@ -630,8 +588,6 @@ func TestArrowIterSubjects(t *testing.T) { } func TestArrowIteratorBidirectional(t *testing.T) { - t.Parallel() - testArrowBothDirections(t, "BasicCheck", func(t *testing.T, direction arrowDirection) { require := require.New(t) @@ -696,10 +652,7 @@ func TestArrowIteratorBidirectional(t *testing.T) { } func TestArrow_Types(t *testing.T) { - t.Parallel() - t.Run("ResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create left and right iterators @@ -718,7 +671,6 @@ func TestArrow_Types(t *testing.T) { }) t.Run("SubjectTypes", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create left and right iterators diff --git a/pkg/query/build_tree_test.go b/pkg/query/build_tree_test.go index 7c357b8cf..0af696741 100644 --- a/pkg/query/build_tree_test.go +++ b/pkg/query/build_tree_test.go @@ -15,8 +15,6 @@ import ( ) func TestBuildTree(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -42,8 +40,6 @@ func TestBuildTree(t *testing.T) { } func TestBuildTreeMultipleRelations(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -73,8 +69,6 @@ func TestBuildTreeMultipleRelations(t *testing.T) { } func TestBuildTreeInvalidDefinition(t *testing.T) { - t.Parallel() - require := require.New(t) objectDefs := []*corev1.NamespaceDefinition{testfixtures.UserNS.CloneVT(), testfixtures.FolderNS.CloneVT(), testfixtures.DocumentNS.CloneVT()} dsSchema, err := schema.BuildSchemaFromDefinitions(objectDefs, nil) @@ -92,8 +86,6 @@ func TestBuildTreeInvalidDefinition(t *testing.T) { } func TestBuildTreeSubRelations(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -124,8 +116,6 @@ func TestBuildTreeSubRelations(t *testing.T) { } func TestBuildTreeRecursion(t *testing.T) { - t.Parallel() - require := require.New(t) // Create a proper recursive group hierarchy schema: @@ -166,8 +156,6 @@ func TestBuildTreeRecursion(t *testing.T) { } func TestBuildTreeArrowOperation(t *testing.T) { - t.Parallel() - require := require.New(t) // Test that we can detect when arrow operations would be created @@ -190,8 +178,6 @@ func TestBuildTreeArrowOperation(t *testing.T) { } func TestBuildTreeIntersectionOperation(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -223,8 +209,6 @@ func TestBuildTreeIntersectionOperation(t *testing.T) { } func TestBuildTreeExclusionOperation(t *testing.T) { - t.Parallel() - require := require.New(t) // Create a simple schema to test exclusion handling @@ -266,8 +250,6 @@ func TestBuildTreeExclusionOperation(t *testing.T) { } func TestBuildTreeExclusionEdgeCases(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -280,7 +262,6 @@ func TestBuildTreeExclusionEdgeCases(t *testing.T) { userDef := testfixtures.UserNS.CloneVT() t.Run("Exclusion with Relation Reference", func(t *testing.T) { - t.Parallel() // Create schema with exclusion using relation references docDef := namespace.Namespace("document", namespace.MustRelation("owner", nil, namespace.AllowedRelation("user", "...")), @@ -313,7 +294,6 @@ func TestBuildTreeExclusionEdgeCases(t *testing.T) { }) t.Run("Exclusion with Union Operations", func(t *testing.T) { - t.Parallel() // Create schema with exclusion containing union operations docDef := namespace.Namespace("document", namespace.MustRelation("owner", nil, namespace.AllowedRelation("user", "...")), @@ -355,7 +335,6 @@ func TestBuildTreeExclusionEdgeCases(t *testing.T) { }) t.Run("Exclusion with Intersection Operations", func(t *testing.T) { - t.Parallel() // Create schema with exclusion containing intersection operations docDef := namespace.Namespace("document", namespace.MustRelation("owner", nil, namespace.AllowedRelation("user", "...")), @@ -396,7 +375,6 @@ func TestBuildTreeExclusionEdgeCases(t *testing.T) { }) t.Run("Nested Exclusion Operations", func(t *testing.T) { - t.Parallel() // Create schema with nested exclusions docDef := namespace.Namespace("document", namespace.MustRelation("all_users", nil, namespace.AllowedRelation("user", "...")), @@ -440,7 +418,6 @@ func TestBuildTreeExclusionEdgeCases(t *testing.T) { }) t.Run("Exclusion with Error in Left Operation", func(t *testing.T) { - t.Parallel() // Create schema with exclusion where left operation references non-existent relation docDef := namespace.Namespace("document", namespace.MustRelation("viewer", nil, namespace.AllowedRelation("user", "...")), @@ -463,7 +440,6 @@ func TestBuildTreeExclusionEdgeCases(t *testing.T) { }) t.Run("Exclusion with Error in Right Operation", func(t *testing.T) { - t.Parallel() // Create schema with exclusion where right operation references non-existent relation docDef := namespace.Namespace("document", namespace.MustRelation("viewer", nil, namespace.AllowedRelation("user", "...")), @@ -487,8 +463,6 @@ func TestBuildTreeExclusionEdgeCases(t *testing.T) { } func TestBuildTreeArrowMissingLeftRelation(t *testing.T) { - t.Parallel() - require := require.New(t) // Create a schema with an arrow that references a non-existent left relation @@ -513,8 +487,6 @@ func TestBuildTreeArrowMissingLeftRelation(t *testing.T) { } func TestBuildTreeSingleRelationOptimization(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -546,8 +518,6 @@ func TestBuildTreeSingleRelationOptimization(t *testing.T) { } func TestBuildTreeSubrelationHandling(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -560,7 +530,6 @@ func TestBuildTreeSubrelationHandling(t *testing.T) { userDef := testfixtures.UserNS.CloneVT() t.Run("Base Relation with Ellipsis Subrelation", func(t *testing.T) { - t.Parallel() // Test that base relations with ellipsis (group:...) work correctly with arrows groupDef := namespace.Namespace("group", namespace.MustRelation("member", nil, namespace.AllowedRelation("user", "...")), @@ -597,7 +566,6 @@ func TestBuildTreeSubrelationHandling(t *testing.T) { }) t.Run("Base Relation with Specific Subrelation", func(t *testing.T) { - t.Parallel() // Create schema with specific subrelation that should create union with arrow groupDef := namespace.Namespace("group", namespace.MustRelation("member", nil, namespace.AllowedRelation("user", "...")), @@ -632,7 +600,6 @@ func TestBuildTreeSubrelationHandling(t *testing.T) { }) t.Run("Base Relation Without Subrelations Disabled", func(t *testing.T) { - t.Parallel() // Test base relation iterator with withSubRelations = false // This hits the buildBaseDatastoreIterator path where subrelations are disabled docDef := namespace.Namespace("document", @@ -659,7 +626,6 @@ func TestBuildTreeSubrelationHandling(t *testing.T) { }) t.Run("Base Relation with Missing Subrelation Definition", func(t *testing.T) { - t.Parallel() // Create schema where base relation references a subrelation that doesn't exist in target groupDef := namespace.Namespace("group", namespace.MustRelation("member", nil, namespace.AllowedRelation("user", "...")), @@ -686,7 +652,6 @@ func TestBuildTreeSubrelationHandling(t *testing.T) { }) t.Run("Multiple Base Relations with Different Subrelation Handling", func(t *testing.T) { - t.Parallel() // Test relation with multiple base relations, some with subrelations, some without groupDef := namespace.Namespace("group", namespace.MustRelation("member", nil, namespace.AllowedRelation("user", "...")), @@ -726,8 +691,6 @@ func TestBuildTreeSubrelationHandling(t *testing.T) { } func TestBuildTreeWildcardIterator(t *testing.T) { - t.Parallel() - require := require.New(t) // Create a simple schema with a wildcard relation using core types directly @@ -769,7 +732,6 @@ func TestBuildTreeWildcardIterator(t *testing.T) { require.Equal("user", baseRel.Type()) t.Run("Schema with wildcard creates WildcardIterator", func(t *testing.T) { - t.Parallel() it, err := BuildIteratorFromSchema(dsSchema, "document", "viewer") require.NoError(err) require.NotNil(it) @@ -787,7 +749,6 @@ func TestBuildTreeWildcardIterator(t *testing.T) { }) t.Run("Mixed wildcard and regular relations", func(t *testing.T) { - t.Parallel() // Create a schema with both wildcard and regular relations mixedDocDef := namespace.Namespace( "document", @@ -820,8 +781,6 @@ func TestBuildTreeWildcardIterator(t *testing.T) { } func TestBuildTreeMutualRecursionSentinelFiltering(t *testing.T) { - t.Parallel() - require := require.New(t) // Create a schema with mutual recursion between document and otherdocument @@ -857,7 +816,6 @@ func TestBuildTreeMutualRecursionSentinelFiltering(t *testing.T) { require.NoError(err) t.Run("document viewer builds successfully with mutual recursion", func(t *testing.T) { - t.Parallel() // Build iterator for document#viewer - should detect recursion and wrap properly it, err := BuildIteratorFromSchema(dsSchema, "document", "viewer") require.NoError(err) @@ -870,7 +828,6 @@ func TestBuildTreeMutualRecursionSentinelFiltering(t *testing.T) { }) t.Run("otherdocument viewer builds successfully with mutual recursion", func(t *testing.T) { - t.Parallel() // Build iterator for otherdocument#viewer - should also handle mutual recursion it, err := BuildIteratorFromSchema(dsSchema, "otherdocument", "viewer") require.NoError(err) @@ -883,7 +840,6 @@ func TestBuildTreeMutualRecursionSentinelFiltering(t *testing.T) { }) t.Run("sentinels are filtered by definition/relation", func(t *testing.T) { - t.Parallel() // This test verifies that when building document#viewer, which encounters // otherdocument#viewer, which then encounters document#viewer again (recursion), // the sentinels are properly filtered so each RecursiveIterator only handles diff --git a/pkg/query/canonicalize_test.go b/pkg/query/canonicalize_test.go index 4d70b762d..f56c49bce 100644 --- a/pkg/query/canonicalize_test.go +++ b/pkg/query/canonicalize_test.go @@ -11,8 +11,6 @@ import ( ) func TestIsNull(t *testing.T) { - t.Parallel() - tests := []struct { name string outline Outline @@ -61,7 +59,6 @@ func TestIsNull(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() result := isNullOutline(tt.outline) require.Equal(t, tt.expected, result) }) @@ -69,8 +66,6 @@ func TestIsNull(t *testing.T) { } func TestReplaceEmptyComposites(t *testing.T) { - t.Parallel() - tests := []struct { name string outline Outline @@ -116,7 +111,6 @@ func TestReplaceEmptyComposites(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() result := replaceEmptyComposites(tt.outline) require.True(t, result.Equals(tt.expected), "expected %+v, got %+v", tt.expected, result) }) @@ -124,8 +118,6 @@ func TestReplaceEmptyComposites(t *testing.T) { } func TestCollapseSingleChild(t *testing.T) { - t.Parallel() - childOutline := Outline{Type: DatastoreIteratorType} tests := []struct { @@ -175,7 +167,6 @@ func TestCollapseSingleChild(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() result := collapseSingleChild(tt.outline) require.True(t, result.Equals(tt.expected)) }) @@ -183,8 +174,6 @@ func TestCollapseSingleChild(t *testing.T) { } func TestPropagateNull(t *testing.T) { - t.Parallel() - nullOutline := Outline{Type: NullIteratorType} dataOutline := Outline{Type: DatastoreIteratorType} @@ -286,7 +275,6 @@ func TestPropagateNull(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() result := propagateNull(tt.outline) require.True(t, result.Equals(tt.expected)) }) @@ -294,8 +282,6 @@ func TestPropagateNull(t *testing.T) { } func TestFlattenComposites(t *testing.T) { - t.Parallel() - a := Outline{Type: DatastoreIteratorType, Args: &IteratorArgs{RelationName: "a"}} b := Outline{Type: DatastoreIteratorType, Args: &IteratorArgs{RelationName: "b"}} c := Outline{Type: DatastoreIteratorType, Args: &IteratorArgs{RelationName: "c"}} @@ -403,7 +389,6 @@ func TestFlattenComposites(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() result := flattenComposites(tt.outline) require.True(t, result.Equals(tt.expected)) }) @@ -411,8 +396,6 @@ func TestFlattenComposites(t *testing.T) { } func TestSortCompositeChildren(t *testing.T) { - t.Parallel() - // Create outlines with different relation names for predictable sorting a := Outline{Type: DatastoreIteratorType, Args: &IteratorArgs{RelationName: "a"}} b := Outline{Type: DatastoreIteratorType, Args: &IteratorArgs{RelationName: "b"}} @@ -465,7 +448,6 @@ func TestSortCompositeChildren(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() result := sortCompositeChildren(tt.outline) require.True(t, result.Equals(tt.expected)) }) @@ -473,8 +455,6 @@ func TestSortCompositeChildren(t *testing.T) { } func TestExtractCaveats(t *testing.T) { - t.Parallel() - caveat1 := &core.ContextualizedCaveat{CaveatName: "caveat1"} caveat2 := &core.ContextualizedCaveat{CaveatName: "caveat2"} dataOutline := Outline{Type: DatastoreIteratorType} @@ -544,7 +524,6 @@ func TestExtractCaveats(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() tree, caveats, err := extractCaveats(tt.outline) require.NoError(t, err) require.True(t, tree.Equals(tt.expectedTree)) @@ -557,8 +536,6 @@ func TestExtractCaveats(t *testing.T) { } func TestNestCaveats(t *testing.T) { - t.Parallel() - caveat1 := &core.ContextualizedCaveat{CaveatName: "caveat1"} caveat2 := &core.ContextualizedCaveat{CaveatName: "caveat2"} dataOutline := Outline{Type: DatastoreIteratorType} @@ -605,7 +582,6 @@ func TestNestCaveats(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() result := nestCaveats(tt.outline, tt.caveats) require.True(t, result.Equals(tt.expected)) }) @@ -613,8 +589,6 @@ func TestNestCaveats(t *testing.T) { } func TestCanonicalizeOutline(t *testing.T) { - t.Parallel() - caveat1 := &core.ContextualizedCaveat{CaveatName: "caveat1"} caveat2 := &core.ContextualizedCaveat{CaveatName: "caveat2"} @@ -746,7 +720,6 @@ func TestCanonicalizeOutline(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() result, err := CanonicalizeOutline(tt.outline) require.NoError(t, err) require.True(t, result.Root.Equals(tt.expected), "expected %+v, got %+v", tt.expected, result.Root) @@ -755,8 +728,6 @@ func TestCanonicalizeOutline(t *testing.T) { } func TestCanonicalizeIdempotency(t *testing.T) { - t.Parallel() - caveat := &core.ContextualizedCaveat{CaveatName: "test"} rel := schema.NewTestBaseRelation("doc", "rel", "user", tuple.Ellipsis) @@ -819,8 +790,6 @@ func TestCanonicalizeIdempotency(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() - // First canonicalization canonical1, err := CanonicalizeOutline(tt.outline) require.NoError(t, err) @@ -838,8 +807,6 @@ func TestCanonicalizeIdempotency(t *testing.T) { } func TestCanonicalizeEquivalence(t *testing.T) { - t.Parallel() - rel := schema.NewTestBaseRelation("doc", "rel", "user", tuple.Ellipsis) a := Outline{Type: DatastoreIteratorType, Args: &IteratorArgs{Relation: rel}} b := Outline{Type: DatastoreIteratorType, Args: &IteratorArgs{RelationName: "other"}} @@ -930,8 +897,6 @@ func TestCanonicalizeEquivalence(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() - canonical1, err := CanonicalizeOutline(tt.outline1) require.NoError(t, err) @@ -952,8 +917,6 @@ func TestCanonicalizeEquivalence(t *testing.T) { } func TestCanonicalizeOutline_PopulatesCanonicalKey(t *testing.T) { - t.Parallel() - rel := schema.NewTestBaseRelation("doc", "rel", "user", tuple.Ellipsis) tests := []struct { @@ -1004,7 +967,6 @@ func TestCanonicalizeOutline_PopulatesCanonicalKey(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() require := require.New(t) canonical, err := CanonicalizeOutline(tt.outline) @@ -1018,7 +980,6 @@ func TestCanonicalizeOutline_PopulatesCanonicalKey(t *testing.T) { } func TestCanonicalKey_MatchesSerialization(t *testing.T) { - t.Parallel() require := require.New(t) rel := schema.NewTestBaseRelation("doc", "rel", "user", tuple.Ellipsis) @@ -1043,7 +1004,6 @@ func TestCanonicalKey_MatchesSerialization(t *testing.T) { } func TestCanonicalKey_AllNodesPopulated(t *testing.T) { - t.Parallel() require := require.New(t) rel := schema.NewTestBaseRelation("doc", "rel", "user", tuple.Ellipsis) @@ -1082,7 +1042,6 @@ func TestCanonicalKey_AllNodesPopulated(t *testing.T) { } func TestCanonicalKey_Uniqueness(t *testing.T) { - t.Parallel() require := require.New(t) rel1 := schema.NewTestBaseRelation("doc", "rel1", "user", tuple.Ellipsis) @@ -1123,7 +1082,6 @@ func TestCanonicalKey_Uniqueness(t *testing.T) { } func TestCanonicalKey_Equivalence(t *testing.T) { - t.Parallel() require := require.New(t) rel := schema.NewTestBaseRelation("doc", "rel", "user", tuple.Ellipsis) @@ -1153,7 +1111,6 @@ func TestCanonicalKey_Equivalence(t *testing.T) { } func TestCanonicalKey_Idempotency(t *testing.T) { - t.Parallel() require := require.New(t) rel := schema.NewTestBaseRelation("doc", "rel", "user", tuple.Ellipsis) @@ -1190,7 +1147,6 @@ func TestCanonicalKey_Idempotency(t *testing.T) { } func TestCanonicalKey_MethodsWork(t *testing.T) { - t.Parallel() require := require.New(t) rel := schema.NewTestBaseRelation("doc", "rel", "user", tuple.Ellipsis) @@ -1217,7 +1173,6 @@ func TestCanonicalKey_MethodsWork(t *testing.T) { } func TestCanonicalKey_WithCaveats(t *testing.T) { - t.Parallel() require := require.New(t) caveat := &core.ContextualizedCaveat{CaveatName: "age_check"} diff --git a/pkg/query/caveat_test.go b/pkg/query/caveat_test.go index 222b19f84..e941249c3 100644 --- a/pkg/query/caveat_test.go +++ b/pkg/query/caveat_test.go @@ -295,7 +295,6 @@ func createTestCaveat(name string, context map[string]any) *core.ContextualizedC // Additional comprehensive tests for caveat.go func TestCaveatIterator_ContainsExpectedCaveat(t *testing.T) { - t.Parallel() require := require.New(t) // Create a CaveatIterator to test the containsExpectedCaveat method @@ -304,14 +303,12 @@ func TestCaveatIterator_ContainsExpectedCaveat(t *testing.T) { // Test simple caveat expressions t.Run("Simple caveat match", func(t *testing.T) { - t.Parallel() expr := createTestCaveatExpression("expected_caveat", nil) contains := caveatIter.containsExpectedCaveat(expr) require.True(contains) }) t.Run("Simple caveat no match", func(t *testing.T) { - t.Parallel() expr := createTestCaveatExpression("different_caveat", nil) contains := caveatIter.containsExpectedCaveat(expr) require.False(contains) @@ -319,7 +316,6 @@ func TestCaveatIterator_ContainsExpectedCaveat(t *testing.T) { // Test complex caveat expressions t.Run("AND expression contains expected caveat", func(t *testing.T) { - t.Parallel() child1 := createTestCaveatExpression("expected_caveat", nil) child2 := createTestCaveatExpression("other_caveat", nil) andExpr := createComplexCaveatExpression(core.CaveatOperation_AND, []*core.CaveatExpression{child1, child2}) @@ -329,7 +325,6 @@ func TestCaveatIterator_ContainsExpectedCaveat(t *testing.T) { }) t.Run("OR expression contains expected caveat", func(t *testing.T) { - t.Parallel() child1 := createTestCaveatExpression("wrong_caveat", nil) child2 := createTestCaveatExpression("expected_caveat", nil) orExpr := createComplexCaveatExpression(core.CaveatOperation_OR, []*core.CaveatExpression{child1, child2}) @@ -339,7 +334,6 @@ func TestCaveatIterator_ContainsExpectedCaveat(t *testing.T) { }) t.Run("Complex expression without expected caveat", func(t *testing.T) { - t.Parallel() child1 := createTestCaveatExpression("wrong_caveat1", nil) child2 := createTestCaveatExpression("wrong_caveat2", nil) andExpr := createComplexCaveatExpression(core.CaveatOperation_AND, []*core.CaveatExpression{child1, child2}) @@ -349,7 +343,6 @@ func TestCaveatIterator_ContainsExpectedCaveat(t *testing.T) { }) t.Run("No expected caveat - should always return true", func(t *testing.T) { - t.Parallel() noCaveatIter := NewCaveatIterator(NewFixedIterator(), nil) expr := createTestCaveatExpression("any_caveat", nil) contains := noCaveatIter.containsExpectedCaveat(expr) @@ -358,7 +351,6 @@ func TestCaveatIterator_ContainsExpectedCaveat(t *testing.T) { } func TestCaveatIterator_SimplifyCaveat_ErrorHandling(t *testing.T) { - t.Parallel() require := require.New(t) testCaveat := createTestCaveat("test_caveat", nil) @@ -366,7 +358,6 @@ func TestCaveatIterator_SimplifyCaveat_ErrorHandling(t *testing.T) { // Test with no caveat on iterator - should pass through t.Run("No caveat on iterator", func(t *testing.T) { - t.Parallel() noCaveatIter := NewCaveatIterator(NewFixedIterator(), nil) path := MustPathFromString("document:doc1#view@user:alice") path.Caveat = createTestCaveatExpression("any_caveat", nil) @@ -379,7 +370,6 @@ func TestCaveatIterator_SimplifyCaveat_ErrorHandling(t *testing.T) { }) t.Run("No caveat on path", func(t *testing.T) { - t.Parallel() path := MustPathFromString("document:doc1#view@user:alice") // path.Caveat is nil @@ -390,7 +380,6 @@ func TestCaveatIterator_SimplifyCaveat_ErrorHandling(t *testing.T) { }) t.Run("No caveat runner", func(t *testing.T) { - t.Parallel() path := MustPathFromString("document:doc1#view@user:alice") path.Caveat = createTestCaveatExpression("test_caveat", nil) @@ -404,7 +393,6 @@ func TestCaveatIterator_SimplifyCaveat_ErrorHandling(t *testing.T) { } func TestCaveatIterator_IterSubjectsImpl(t *testing.T) { - t.Parallel() require := require.New(t) // Create test paths @@ -415,7 +403,6 @@ func TestCaveatIterator_IterSubjectsImpl(t *testing.T) { subIterator := NewFixedIterator(path1, path2, path3) t.Run("with no caveat filter", func(t *testing.T) { - t.Parallel() // No caveat filter - should pass through all paths caveatIter := NewCaveatIterator(subIterator, nil) @@ -434,7 +421,6 @@ func TestCaveatIterator_IterSubjectsImpl(t *testing.T) { }) t.Run("with caveat filter", func(t *testing.T) { - t.Parallel() // With caveat filter - test that the method can be called testCaveat := createTestCaveat("test_caveat", nil) caveatIter := NewCaveatIterator(subIterator, testCaveat) @@ -453,7 +439,6 @@ func TestCaveatIterator_IterSubjectsImpl(t *testing.T) { } func TestCaveatIterator_IterResourcesImpl(t *testing.T) { - t.Parallel() require := require.New(t) // Create test paths @@ -463,7 +448,6 @@ func TestCaveatIterator_IterResourcesImpl(t *testing.T) { subIterator := NewFixedIterator(path1, path2) t.Run("with no caveat filter", func(t *testing.T) { - t.Parallel() // No caveat filter - should pass through all paths caveatIter := NewCaveatIterator(subIterator, nil) @@ -482,7 +466,6 @@ func TestCaveatIterator_IterResourcesImpl(t *testing.T) { }) t.Run("with caveat filter", func(t *testing.T) { - t.Parallel() // With caveat filter - test that the method can be called testCaveat := createTestCaveat("test_caveat", nil) caveatIter := NewCaveatIterator(subIterator, testCaveat) @@ -501,18 +484,15 @@ func TestCaveatIterator_IterResourcesImpl(t *testing.T) { } func TestCaveatIterator_BuildExplainInfo(t *testing.T) { - t.Parallel() require := require.New(t) t.Run("No caveat", func(t *testing.T) { - t.Parallel() caveatIter := NewCaveatIterator(NewFixedIterator(), nil) info := caveatIter.buildExplainInfo() require.Equal("Caveat(none)", info) }) t.Run("Simple caveat without context", func(t *testing.T) { - t.Parallel() testCaveat := createTestCaveat("test_caveat", nil) caveatIter := NewCaveatIterator(NewFixedIterator(), testCaveat) info := caveatIter.buildExplainInfo() @@ -520,7 +500,6 @@ func TestCaveatIterator_BuildExplainInfo(t *testing.T) { }) t.Run("Caveat with context", func(t *testing.T) { - t.Parallel() testCaveat := createTestCaveat("test_caveat", map[string]any{ "limit": 10, "user": "alice", @@ -538,10 +517,7 @@ func TestCaveatIterator_BuildExplainInfo(t *testing.T) { } func TestCaveatIterator_Types(t *testing.T) { - t.Parallel() - t.Run("ResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a caveat iterator with a subiterator @@ -557,7 +533,6 @@ func TestCaveatIterator_Types(t *testing.T) { }) t.Run("SubjectTypes", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a caveat iterator with a subiterator diff --git a/pkg/query/context_test.go b/pkg/query/context_test.go index 6f7945097..c4a4a6f4a 100644 --- a/pkg/query/context_test.go +++ b/pkg/query/context_test.go @@ -9,10 +9,7 @@ import ( ) func TestTraceLogger(t *testing.T) { - t.Parallel() - t.Run("NewTraceLogger", func(t *testing.T) { - t.Parallel() require := require.New(t) logger := NewTraceLogger() require.NotNil(logger) @@ -22,7 +19,6 @@ func TestTraceLogger(t *testing.T) { }) t.Run("EnterIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) logger := NewTraceLogger() resources := []Object{NewObject("document", "doc1")} @@ -43,7 +39,6 @@ func TestTraceLogger(t *testing.T) { }) t.Run("ExitIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) logger := NewTraceLogger() testPath := MustPathFromString("document:doc1#view@user:alice") @@ -64,7 +59,6 @@ func TestTraceLogger(t *testing.T) { }) t.Run("LogStep", func(t *testing.T) { - t.Parallel() require := require.New(t) logger := NewTraceLogger() testPath := MustPathFromString("document:doc1#view@user:alice") @@ -81,7 +75,6 @@ func TestTraceLogger(t *testing.T) { }) t.Run("LogStep_IteratorNotInStack", func(t *testing.T) { - t.Parallel() require := require.New(t) logger := NewTraceLogger() logger.depth = 3 @@ -97,7 +90,6 @@ func TestTraceLogger(t *testing.T) { }) t.Run("DumpTrace", func(t *testing.T) { - t.Parallel() require := require.New(t) logger := NewTraceLogger() logger.traces = []string{"line1", "line2", "line3"} @@ -108,10 +100,7 @@ func TestTraceLogger(t *testing.T) { } func TestContext(t *testing.T) { - t.Parallel() - t.Run("TraceStep", func(t *testing.T) { - t.Parallel() require := require.New(t) logger := NewTraceLogger() ctx := NewLocalContext(context.Background(), @@ -128,7 +117,6 @@ func TestContext(t *testing.T) { }) t.Run("TraceStep_NoLogger", func(t *testing.T) { - t.Parallel() require := require.New(t) ctx := NewLocalContext(context.Background()) // No TraceLogger set @@ -143,7 +131,6 @@ func TestContext(t *testing.T) { }) t.Run("TraceEnter", func(t *testing.T) { - t.Parallel() require := require.New(t) logger := NewTraceLogger() ctx := NewLocalContext(context.Background(), @@ -161,7 +148,6 @@ func TestContext(t *testing.T) { }) t.Run("TraceExit", func(t *testing.T) { - t.Parallel() require := require.New(t) logger := NewTraceLogger() ctx := NewLocalContext(context.Background(), @@ -181,7 +167,6 @@ func TestContext(t *testing.T) { }) t.Run("shouldTrace", func(t *testing.T) { - t.Parallel() require := require.New(t) // With logger ctx := NewLocalContext(context.Background(), @@ -194,7 +179,6 @@ func TestContext(t *testing.T) { }) t.Run("Check_NoExecutor", func(t *testing.T) { - t.Parallel() require := require.New(t) ctx := NewLocalContext(context.Background()) // No Executor set - but NewLocalContext always sets LocalExecutor @@ -210,7 +194,6 @@ func TestContext(t *testing.T) { }) t.Run("IterSubjects_NoExecutor", func(t *testing.T) { - t.Parallel() require := require.New(t) ctx := NewLocalContext(context.Background()) // No Executor set - but NewLocalContext always sets LocalExecutor @@ -226,7 +209,6 @@ func TestContext(t *testing.T) { }) t.Run("IterResources_NoExecutor", func(t *testing.T) { - t.Parallel() require := require.New(t) ctx := NewLocalContext(context.Background()) // No Executor set - but NewLocalContext always sets LocalExecutor @@ -242,7 +224,6 @@ func TestContext(t *testing.T) { }) t.Run("wrapPathSeqForTracing_NoTracing", func(t *testing.T) { - t.Parallel() require := require.New(t) ctx := NewLocalContext(context.Background()) // No TraceLogger @@ -267,7 +248,6 @@ func TestContext(t *testing.T) { }) t.Run("wrapPathSeqForTracing_WithTracing", func(t *testing.T) { - t.Parallel() require := require.New(t) logger := NewTraceLogger() ctx := NewLocalContext(context.Background(), @@ -301,7 +281,6 @@ func TestContext(t *testing.T) { }) t.Run("wrapPathSeqForTracing_WithError", func(t *testing.T) { - t.Parallel() require := require.New(t) logger := NewTraceLogger() ctx := NewLocalContext(context.Background(), diff --git a/pkg/query/datastore_test.go b/pkg/query/datastore_test.go index b086501b7..fb535d668 100644 --- a/pkg/query/datastore_test.go +++ b/pkg/query/datastore_test.go @@ -18,16 +18,12 @@ var ( ) func TestDatastoreIterator(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context ctx := NewLocalContext(t.Context()) t.Run("SubjectTypeMismatchReturnsEmpty", func(t *testing.T) { - t.Parallel() - // Create a base relation that expects "user" type subjects (no subrelation for pure type checking) baseRel := createTestBaseRelation("document", "viewer", "user", "") relationIter := NewDatastoreIterator(baseRel) @@ -54,8 +50,6 @@ func TestDatastoreIterator(t *testing.T) { }) t.Run("Clone", func(t *testing.T) { - t.Parallel() - baseRel := createTestBaseRelation("document", "editor", "user", tuple.Ellipsis) original := NewDatastoreIterator(baseRel) cloned := original.Clone() @@ -71,11 +65,7 @@ func TestDatastoreIterator(t *testing.T) { }) t.Run("Explain", func(t *testing.T) { - t.Parallel() - t.Run("BasicRelation", func(t *testing.T) { - t.Parallel() - baseRel := createTestBaseRelation("document", "viewer", "user", tuple.Ellipsis) relationIter := NewDatastoreIterator(baseRel) explain := relationIter.Explain() @@ -86,8 +76,6 @@ func TestDatastoreIterator(t *testing.T) { }) t.Run("RelationWithCaveat", func(t *testing.T) { - t.Parallel() - baseRel := createTestBaseRelationWithFeatures("document", "conditional_viewer", "user", tuple.Ellipsis, "test_caveat", false) relationIter := NewDatastoreIterator(baseRel) explain := relationIter.Explain() @@ -97,8 +85,6 @@ func TestDatastoreIterator(t *testing.T) { }) t.Run("RelationWithExpiration", func(t *testing.T) { - t.Parallel() - baseRel := createTestBaseRelationWithFeatures("document", "temp_viewer", "user", tuple.Ellipsis, "", true) relationIter := NewDatastoreIterator(baseRel) explain := relationIter.Explain() @@ -108,8 +94,6 @@ func TestDatastoreIterator(t *testing.T) { }) t.Run("RelationWithSpecificSubrelation", func(t *testing.T) { - t.Parallel() - baseRel := createTestBaseRelation("document", "parent", "folder", "member") relationIter := NewDatastoreIterator(baseRel) explain := relationIter.Explain() @@ -119,8 +103,6 @@ func TestDatastoreIterator(t *testing.T) { }) t.Run("WildcardRelation", func(t *testing.T) { - t.Parallel() - baseRel := createTestWildcardBaseRelation("document", "viewer", "user") relationIter := NewDatastoreIterator(baseRel) explain := relationIter.Explain() @@ -130,8 +112,6 @@ func TestDatastoreIterator(t *testing.T) { }) t.Run("WildcardRelationWithCaveatAndExpiration", func(t *testing.T) { - t.Parallel() - baseRel := createTestWildcardBaseRelationWithFeatures("document", "admin", "user", "test_caveat", true) relationIter := NewDatastoreIterator(baseRel) explain := relationIter.Explain() @@ -143,8 +123,6 @@ func TestDatastoreIterator(t *testing.T) { } func TestDatastoreIteratorSubjectTypeMismatchScenarios(t *testing.T) { - t.Parallel() - require := require.New(t) ctx := NewLocalContext(t.Context()) @@ -184,8 +162,6 @@ func TestDatastoreIteratorSubjectTypeMismatchScenarios(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - // Use empty string instead of Ellipsis to test pure type mismatch without subrelation bridging baseRel := createTestBaseRelation("document", "viewer", tc.expectedSubjectType, "") relationIter := NewDatastoreIterator(baseRel) @@ -204,16 +180,12 @@ func TestDatastoreIteratorSubjectTypeMismatchScenarios(t *testing.T) { } func TestDatastoreIteratorWildcard(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context ctx := NewLocalContext(t.Context()) t.Run("WildcardSubjectTypeMismatchReturnsEmpty", func(t *testing.T) { - t.Parallel() - // Create a wildcard base relation that expects "user" type subjects baseRel := createTestWildcardBaseRelation("document", "viewer", "user") relationIter := NewDatastoreIterator(baseRel) @@ -228,8 +200,6 @@ func TestDatastoreIteratorWildcard(t *testing.T) { }) t.Run("WildcardClone", func(t *testing.T) { - t.Parallel() - baseRel := createTestWildcardBaseRelation("document", "viewer", "user") original := NewDatastoreIterator(baseRel) cloned := original.Clone() @@ -240,11 +210,7 @@ func TestDatastoreIteratorWildcard(t *testing.T) { }) t.Run("WildcardExplain", func(t *testing.T) { - t.Parallel() - t.Run("BasicWildcardRelation", func(t *testing.T) { - t.Parallel() - baseRel := createTestWildcardBaseRelation("document", "viewer", "user") relationIter := NewDatastoreIterator(baseRel) explain := relationIter.Explain() @@ -255,8 +221,6 @@ func TestDatastoreIteratorWildcard(t *testing.T) { }) t.Run("WildcardRelationWithCaveat", func(t *testing.T) { - t.Parallel() - baseRel := createTestWildcardBaseRelationWithFeatures("document", "conditional_viewer", "user", "test_caveat", false) relationIter := NewDatastoreIterator(baseRel) explain := relationIter.Explain() @@ -266,8 +230,6 @@ func TestDatastoreIteratorWildcard(t *testing.T) { }) t.Run("WildcardRelationWithExpiration", func(t *testing.T) { - t.Parallel() - baseRel := createTestWildcardBaseRelationWithFeatures("document", "temp_viewer", "user", "", true) relationIter := NewDatastoreIterator(baseRel) explain := relationIter.Explain() @@ -277,8 +239,6 @@ func TestDatastoreIteratorWildcard(t *testing.T) { }) t.Run("WildcardRelationWithBothFeatures", func(t *testing.T) { - t.Parallel() - baseRel := createTestWildcardBaseRelationWithFeatures("document", "admin", "user", "admin_caveat", true) relationIter := NewDatastoreIterator(baseRel) explain := relationIter.Explain() @@ -290,8 +250,6 @@ func TestDatastoreIteratorWildcard(t *testing.T) { } func TestDatastoreIteratorWildcardSubjectTypeMismatchScenarios(t *testing.T) { - t.Parallel() - require := require.New(t) ctx := NewLocalContext(t.Context()) @@ -326,8 +284,6 @@ func TestDatastoreIteratorWildcardSubjectTypeMismatchScenarios(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - baseRel := createTestWildcardBaseRelation("document", "viewer", tc.expectedSubjectType) relationIter := NewDatastoreIterator(baseRel) @@ -345,10 +301,7 @@ func TestDatastoreIteratorWildcardSubjectTypeMismatchScenarios(t *testing.T) { } func TestDatastoreIterator_Types(t *testing.T) { - t.Parallel() - t.Run("ResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) baseRel := createTestBaseRelation("document", "viewer", "user", "") @@ -362,7 +315,6 @@ func TestDatastoreIterator_Types(t *testing.T) { }) t.Run("SubjectTypes_NoSubrelation", func(t *testing.T) { - t.Parallel() require := require.New(t) baseRel := createTestBaseRelation("document", "viewer", "user", "") @@ -376,7 +328,6 @@ func TestDatastoreIterator_Types(t *testing.T) { }) t.Run("SubjectTypes_WithSubrelation", func(t *testing.T) { - t.Parallel() require := require.New(t) baseRel := createTestBaseRelation("document", "viewer", "group", "member") @@ -390,7 +341,6 @@ func TestDatastoreIterator_Types(t *testing.T) { }) t.Run("SubjectTypes_Wildcard", func(t *testing.T) { - t.Parallel() require := require.New(t) baseRel := createTestWildcardBaseRelation("document", "viewer", "user") @@ -404,7 +354,6 @@ func TestDatastoreIterator_Types(t *testing.T) { }) t.Run("SubjectTypes_Ellipsis", func(t *testing.T) { - t.Parallel() require := require.New(t) baseRel := createTestBaseRelation("document", "viewer", "user", tuple.Ellipsis) diff --git a/pkg/query/exclusion_test.go b/pkg/query/exclusion_test.go index 828545455..de9ff9d99 100644 --- a/pkg/query/exclusion_test.go +++ b/pkg/query/exclusion_test.go @@ -14,8 +14,6 @@ import ( ) func TestExclusionIterator(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -31,7 +29,6 @@ func TestExclusionIterator(t *testing.T) { path3 := MustPathFromString("document:doc3#viewer@user:charlie") t.Run("Basic Exclusion", func(t *testing.T) { - t.Parallel() // Main set: path1, path2, path3 // Excluded set: path2 // Expected result: path1, path3 @@ -50,7 +47,6 @@ func TestExclusionIterator(t *testing.T) { }) t.Run("Empty Main Set", func(t *testing.T) { - t.Parallel() // Main set: empty // Excluded set: path1 // Expected result: empty @@ -68,7 +64,6 @@ func TestExclusionIterator(t *testing.T) { }) t.Run("Empty Excluded Set", func(t *testing.T) { - t.Parallel() // Main set: path1, path2 // Excluded set: empty // Expected result: path1, path2 (nothing to exclude) @@ -87,7 +82,6 @@ func TestExclusionIterator(t *testing.T) { }) t.Run("No Overlap", func(t *testing.T) { - t.Parallel() // Create relations with truly different endpoints mainPath1 := MustPathFromString("document:doc1#viewer@user:alice") mainPath2 := MustPathFromString("document:doc2#viewer@user:bob") @@ -112,7 +106,6 @@ func TestExclusionIterator(t *testing.T) { }) t.Run("Complete Exclusion", func(t *testing.T) { - t.Parallel() // Main set: path1, path2 // Excluded set: path1, path2, path3 // Expected result: empty (all main set relations are excluded) @@ -130,7 +123,6 @@ func TestExclusionIterator(t *testing.T) { }) t.Run("Partial Exclusion", func(t *testing.T) { - t.Parallel() // Create relations with different relations but same endpoints to test exclusion logic pathA := MustPathFromString("document:doc1#viewer@user:alice") pathB := MustPathFromString("document:doc2#viewer@user:alice") @@ -172,8 +164,6 @@ func TestExclusionIterator(t *testing.T) { }) t.Run("IterSubjects", func(t *testing.T) { - t.Parallel() - path1 := MustPathFromString("document:doc1#viewer@user:alice") mainSet := NewFixedIterator(path1) excludedSet := NewFixedIterator() @@ -212,7 +202,6 @@ func TestExclusionIterator(t *testing.T) { }) t.Run("Clone", func(t *testing.T) { - t.Parallel() mainSet := NewFixedIterator(path1, path2) excludedSet := NewFixedIterator(path2) @@ -233,7 +222,6 @@ func TestExclusionIterator(t *testing.T) { }) t.Run("Explain", func(t *testing.T) { - t.Parallel() mainSet := NewFixedIterator(path1) excludedSet := NewFixedIterator(path2) @@ -250,8 +238,6 @@ func TestExclusionIterator(t *testing.T) { } func TestExclusionWithEmptyIterator(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -264,7 +250,6 @@ func TestExclusionWithEmptyIterator(t *testing.T) { path1 := MustPathFromString("document:doc1#viewer@user:alice") t.Run("Empty as Main Set", func(t *testing.T) { - t.Parallel() mainSet := NewEmptyFixedIterator() excludedSet := NewFixedIterator(path1) @@ -279,7 +264,6 @@ func TestExclusionWithEmptyIterator(t *testing.T) { }) t.Run("Empty as Excluded Set", func(t *testing.T) { - t.Parallel() mainSet := NewFixedIterator(path1) excludedSet := NewEmptyFixedIterator() @@ -296,8 +280,6 @@ func TestExclusionWithEmptyIterator(t *testing.T) { } func TestExclusionErrorHandling(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -310,7 +292,6 @@ func TestExclusionErrorHandling(t *testing.T) { path1 := MustPathFromString("document:doc1#viewer@user:alice") t.Run("Main Set Error Propagation", func(t *testing.T) { - t.Parallel() // Create a faulty iterator for the main set mainSet := NewFaultyIterator(true, false, ObjectType{}, []ObjectType{}) excludedSet := NewFixedIterator(path1) @@ -324,7 +305,6 @@ func TestExclusionErrorHandling(t *testing.T) { }) t.Run("Excluded Set Error Propagation", func(t *testing.T) { - t.Parallel() // Create a normal main set and faulty excluded set mainSet := NewFixedIterator(path1) excludedSet := NewFaultyIterator(true, false, ObjectType{}, []ObjectType{}) @@ -338,7 +318,6 @@ func TestExclusionErrorHandling(t *testing.T) { }) t.Run("Main Set Collection Error", func(t *testing.T) { - t.Parallel() // Create an iterator that fails during iteration mainSet := NewFaultyIterator(false, true, ObjectType{}, []ObjectType{}) excludedSet := NewFixedIterator(path1) @@ -362,7 +341,6 @@ func TestExclusionErrorHandling(t *testing.T) { }) t.Run("Excluded Set Collection Error", func(t *testing.T) { - t.Parallel() // Create an iterator that fails during collection mainSet := NewFixedIterator(path1) excludedSet := NewFaultyIterator(false, true, ObjectType{}, []ObjectType{}) @@ -377,8 +355,6 @@ func TestExclusionErrorHandling(t *testing.T) { } func TestExclusionWithComplexIteratorTypes(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -395,7 +371,6 @@ func TestExclusionWithComplexIteratorTypes(t *testing.T) { path4 := MustPathFromString("document:doc4#viewer@user:alice") t.Run("Exclusion with Union as Main Set", func(t *testing.T) { - t.Parallel() // Create union iterator as main set union := NewUnionIterator( NewFixedIterator(path1, path2), @@ -428,7 +403,6 @@ func TestExclusionWithComplexIteratorTypes(t *testing.T) { }) t.Run("Exclusion with Union as Excluded Set", func(t *testing.T) { - t.Parallel() mainSet := NewFixedIterator(path1, path2, path3, path4) // Create union iterator as excluded set @@ -461,7 +435,6 @@ func TestExclusionWithComplexIteratorTypes(t *testing.T) { }) t.Run("Nested Exclusion", func(t *testing.T) { - t.Parallel() // Create a nested exclusion: (path1 + path2 + path3) - path2 - path3 innerMainSet := NewFixedIterator(path1, path2, path3) innerExcludedSet := NewFixedIterator(path2) @@ -483,7 +456,6 @@ func TestExclusionWithComplexIteratorTypes(t *testing.T) { // Additional comprehensive tests for uncovered functions in exclusion.go func TestCombineExclusionCaveats(t *testing.T) { - t.Parallel() require := require.New(t) // Helper function to create paths with caveats @@ -501,7 +473,6 @@ func TestCombineExclusionCaveats(t *testing.T) { // Test cases for different caveat combinations t.Run("main_with_caveat_excluded_without_caveat", func(t *testing.T) { - t.Parallel() mainPath := createPathWithCaveat("document:doc1#view@user:alice", "main_caveat") excludedPath := createPathWithCaveat("document:doc1#view@user:alice", "") @@ -513,7 +484,6 @@ func TestCombineExclusionCaveats(t *testing.T) { }) t.Run("main_without_caveat_excluded_without_caveat", func(t *testing.T) { - t.Parallel() mainPath := createPathWithCaveat("document:doc1#view@user:alice", "") excludedPath := createPathWithCaveat("document:doc1#view@user:alice", "") @@ -525,7 +495,6 @@ func TestCombineExclusionCaveats(t *testing.T) { }) t.Run("main_without_caveat_excluded_with_caveat", func(t *testing.T) { - t.Parallel() mainPath := createPathWithCaveat("document:doc1#view@user:alice", "") excludedPath := createPathWithCaveat("document:doc1#view@user:alice", "excluded_caveat") @@ -542,7 +511,6 @@ func TestCombineExclusionCaveats(t *testing.T) { }) t.Run("both_have_caveats", func(t *testing.T) { - t.Parallel() mainPath := createPathWithCaveat("document:doc1#view@user:alice", "main_caveat") excludedPath := createPathWithCaveat("document:doc1#view@user:alice", "excluded_caveat") @@ -564,7 +532,6 @@ func TestCombineExclusionCaveats(t *testing.T) { } func TestExclusion_CombinedCaveatLogic(t *testing.T) { - t.Parallel() require := require.New(t) // Create test datastore and context @@ -590,7 +557,6 @@ func TestExclusion_CombinedCaveatLogic(t *testing.T) { } t.Run("exclusion_with_caveats", func(t *testing.T) { - t.Parallel() // Main set has paths with various caveats mainPath1 := createPathWithCaveat("document:doc1#view@user:alice", "caveat1") mainPath2 := createPathWithCaveat("document:doc2#view@user:alice", "") // No caveat @@ -644,14 +610,12 @@ func TestExclusion_CombinedCaveatLogic(t *testing.T) { } func TestExclusion_EdgeCases(t *testing.T) { - t.Parallel() require := require.New(t) // Create minimal context for basic testing ctx := NewLocalContext(t.Context()) t.Run("empty_main_set", func(t *testing.T) { - t.Parallel() mainSet := NewFixedIterator() // Empty excludedSet := NewFixedIterator(MustPathFromString("document:doc1#view@user:alice")) @@ -666,7 +630,6 @@ func TestExclusion_EdgeCases(t *testing.T) { }) t.Run("empty_excluded_set", func(t *testing.T) { - t.Parallel() mainPath := MustPathFromString("document:doc1#view@user:alice") mainSet := NewFixedIterator(mainPath) excludedSet := NewFixedIterator() // Empty @@ -683,7 +646,6 @@ func TestExclusion_EdgeCases(t *testing.T) { }) t.Run("no_matching_exclusions", func(t *testing.T) { - t.Parallel() mainPath := MustPathFromString("document:doc1#view@user:alice") mainSet := NewFixedIterator(mainPath) @@ -705,8 +667,6 @@ func TestExclusion_EdgeCases(t *testing.T) { } func TestExclusionIterSubjects(t *testing.T) { - t.Parallel() - require := require.New(t) ctx := &Context{ @@ -715,8 +675,6 @@ func TestExclusionIterSubjects(t *testing.T) { } t.Run("SimpleExclusion", func(t *testing.T) { - t.Parallel() - // Main has alice and bob, exclude bob pathAlice := MustPathFromString("document:doc1#viewer@user:alice") pathBob := MustPathFromString("document:doc1#viewer@user:bob") @@ -737,8 +695,6 @@ func TestExclusionIterSubjects(t *testing.T) { }) t.Run("ExcludeAll", func(t *testing.T) { - t.Parallel() - // Main has alice, exclude alice pathAlice := MustPathFromString("document:doc1#viewer@user:alice") @@ -757,8 +713,6 @@ func TestExclusionIterSubjects(t *testing.T) { }) t.Run("ExcludeNone", func(t *testing.T) { - t.Parallel() - // Main has alice, exclude nothing pathAlice := MustPathFromString("document:doc1#viewer@user:alice") @@ -778,8 +732,6 @@ func TestExclusionIterSubjects(t *testing.T) { }) t.Run("EmptyMainSet", func(t *testing.T) { - t.Parallel() - // Empty main set pathBob := MustPathFromString("document:doc1#viewer@user:bob") @@ -798,8 +750,6 @@ func TestExclusionIterSubjects(t *testing.T) { }) t.Run("MultipleSubjectsPartialExclusion", func(t *testing.T) { - t.Parallel() - // Main has alice, bob, carol; exclude bob pathAlice := MustPathFromString("document:doc1#viewer@user:alice") pathBob := MustPathFromString("document:doc1#viewer@user:bob") @@ -828,8 +778,6 @@ func TestExclusionIterSubjects(t *testing.T) { }) t.Run("CaveatHandling", func(t *testing.T) { - t.Parallel() - // Main has alice with no caveat, exclude has alice with caveat pathMainAlice := MustPathFromString("document:doc1#viewer@user:alice") @@ -860,10 +808,7 @@ func TestExclusionIterSubjects(t *testing.T) { } func TestExclusion_Types(t *testing.T) { - t.Parallel() - t.Run("ResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create main set and excluded set @@ -881,7 +826,6 @@ func TestExclusion_Types(t *testing.T) { }) t.Run("SubjectTypes", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create main set and excluded set with different subject types diff --git a/pkg/query/filter_test.go b/pkg/query/filter_test.go index bc84c9961..dacefe671 100644 --- a/pkg/query/filter_test.go +++ b/pkg/query/filter_test.go @@ -8,8 +8,6 @@ import ( ) func TestFilterResourcesByType(t *testing.T) { - t.Parallel() - // Helper to create a PathSeq from paths createSeq := func(paths []Path) PathSeq { return func(yield func(Path, error) bool) { @@ -22,7 +20,6 @@ func TestFilterResourcesByType(t *testing.T) { } t.Run("EmptyFilter_ReturnsAllPaths", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create test paths with different resource types @@ -43,7 +40,6 @@ func TestFilterResourcesByType(t *testing.T) { }) t.Run("FilterByType_OnlyReturnsMatchingResources", func(t *testing.T) { - t.Parallel() require := require.New(t) paths := []Path{ @@ -68,7 +64,6 @@ func TestFilterResourcesByType(t *testing.T) { }) t.Run("FilterByTypeAndSubrelation_OnlyReturnsMatchingResources", func(t *testing.T) { - t.Parallel() require := require.New(t) paths := []Path{ @@ -94,7 +89,6 @@ func TestFilterResourcesByType(t *testing.T) { }) t.Run("NoMatchingResources_ReturnsEmpty", func(t *testing.T) { - t.Parallel() require := require.New(t) paths := []Path{ @@ -114,7 +108,6 @@ func TestFilterResourcesByType(t *testing.T) { }) t.Run("ErrorPropagation", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a sequence that yields an error @@ -134,8 +127,6 @@ func TestFilterResourcesByType(t *testing.T) { } func TestFilterSubjectsByType(t *testing.T) { - t.Parallel() - // Helper to create a PathSeq from paths createSeq := func(paths []Path) PathSeq { return func(yield func(Path, error) bool) { @@ -148,7 +139,6 @@ func TestFilterSubjectsByType(t *testing.T) { } t.Run("EmptyFilter_ReturnsAllPaths", func(t *testing.T) { - t.Parallel() require := require.New(t) paths := []Path{ @@ -168,7 +158,6 @@ func TestFilterSubjectsByType(t *testing.T) { }) t.Run("FilterByType_OnlyReturnsMatchingSubjects", func(t *testing.T) { - t.Parallel() require := require.New(t) paths := []Path{ @@ -193,7 +182,6 @@ func TestFilterSubjectsByType(t *testing.T) { }) t.Run("FilterByTypeAndSubrelation_OnlyReturnsMatchingSubjects", func(t *testing.T) { - t.Parallel() require := require.New(t) paths := []Path{ @@ -219,7 +207,6 @@ func TestFilterSubjectsByType(t *testing.T) { }) t.Run("NoMatchingSubjects_ReturnsEmpty", func(t *testing.T) { - t.Parallel() require := require.New(t) paths := []Path{ @@ -239,7 +226,6 @@ func TestFilterSubjectsByType(t *testing.T) { }) t.Run("ErrorPropagation", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a sequence that yields an error @@ -259,7 +245,6 @@ func TestFilterSubjectsByType(t *testing.T) { } func TestNoObjectFilter(t *testing.T) { - t.Parallel() require := require.New(t) filter := NoObjectFilter() diff --git a/pkg/query/fixed_test.go b/pkg/query/fixed_test.go index 255a63bd3..1b14f6454 100644 --- a/pkg/query/fixed_test.go +++ b/pkg/query/fixed_test.go @@ -10,7 +10,6 @@ import ( func TestFixedIterator(t *testing.T) { require := require.New(t) - t.Parallel() // Create test context ctx := NewLocalContext(t.Context()) @@ -24,8 +23,6 @@ func TestFixedIterator(t *testing.T) { fixed := NewFixedIterator(path1, path2, path3) t.Run("Check", func(t *testing.T) { - t.Parallel() - // Test Check method seq, err := ctx.Check(fixed, NewObjects("document", "doc1", "doc2"), NewObject("user", "alice").WithEllipses()) require.NoError(err) @@ -40,8 +37,6 @@ func TestFixedIterator(t *testing.T) { }) t.Run("Check_NoMatches", func(t *testing.T) { - t.Parallel() - seq, err := ctx.Check(fixed, NewObjects("document", "doc1"), NewObject("user", "nonexistent").WithEllipses()) require.NoError(err) @@ -51,8 +46,6 @@ func TestFixedIterator(t *testing.T) { }) t.Run("IterSubjects", func(t *testing.T) { - t.Parallel() - seq, err := ctx.IterSubjects(fixed, NewObject("document", "doc1"), NoObjectFilter()) require.NoError(err) @@ -68,8 +61,6 @@ func TestFixedIterator(t *testing.T) { }) t.Run("IterResources", func(t *testing.T) { - t.Parallel() - seq, err := ctx.IterResources(fixed, NewObject("user", "alice").WithEllipses(), NoObjectFilter()) require.NoError(err) @@ -83,8 +74,6 @@ func TestFixedIterator(t *testing.T) { }) t.Run("Clone", func(t *testing.T) { - t.Parallel() - cloned := fixed.Clone() require.NotSame(fixed, cloned) @@ -103,8 +92,6 @@ func TestFixedIterator(t *testing.T) { }) t.Run("Explain", func(t *testing.T) { - t.Parallel() - explain := fixed.Explain() require.Equal("Fixed(3 paths)", explain.Info) require.Empty(explain.SubExplain) @@ -112,10 +99,7 @@ func TestFixedIterator(t *testing.T) { } func TestFixedIterator_Types(t *testing.T) { - t.Parallel() - t.Run("ResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := MustPathFromString("document:doc1#viewer@user:alice") @@ -130,7 +114,6 @@ func TestFixedIterator_Types(t *testing.T) { }) t.Run("SubjectTypes", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := MustPathFromString("document:doc1#viewer@user:alice") @@ -146,7 +129,6 @@ func TestFixedIterator_Types(t *testing.T) { }) t.Run("EmptyIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) fixed := NewFixedIterator() diff --git a/pkg/query/intersection_arrow_test.go b/pkg/query/intersection_arrow_test.go index 411618bb7..ee89835c9 100644 --- a/pkg/query/intersection_arrow_test.go +++ b/pkg/query/intersection_arrow_test.go @@ -13,13 +13,9 @@ import ( ) func TestIntersectionArrowIterator(t *testing.T) { - t.Parallel() - require := require.New(t) t.Run("AllSubjectsSatisfyCondition", func(t *testing.T) { - t.Parallel() - // Left side: document has teams team1 and team2 leftPath1 := MustPathFromString("document:doc1#team@team:team1") leftPath2 := MustPathFromString("document:doc1#team@team:team2") @@ -65,8 +61,6 @@ func TestIntersectionArrowIterator(t *testing.T) { }) t.Run("NotAllSubjectsSatisfyCondition", func(t *testing.T) { - t.Parallel() - // Left side: document has teams team1 and team2 leftPath1 := MustPathFromString("document:doc1#team@team:team1") leftPath2 := MustPathFromString("document:doc1#team@team:team2") @@ -107,8 +101,6 @@ func TestIntersectionArrowIterator(t *testing.T) { }) t.Run("SingleSubjectSatisfiesCondition", func(t *testing.T) { - t.Parallel() - // Left side: document has only team1 leftPath1 := MustPathFromString("document:doc1#team@team:team1") @@ -154,8 +146,6 @@ func TestIntersectionArrowIterator(t *testing.T) { }) t.Run("NoLeftSubjects", func(t *testing.T) { - t.Parallel() - // Left side: document has no teams leftIter := NewFixedIterator() // Empty @@ -191,8 +181,6 @@ func TestIntersectionArrowIterator(t *testing.T) { }) t.Run("ThreeTeamsAllSatisfied", func(t *testing.T) { - t.Parallel() - // Left side: document has teams team1, team2, and team3 leftPath1 := MustPathFromString("document:doc1#team@team:team1") leftPath2 := MustPathFromString("document:doc1#team@team:team2") @@ -241,8 +229,6 @@ func TestIntersectionArrowIterator(t *testing.T) { }) t.Run("EmptyResources", func(t *testing.T) { - t.Parallel() - leftIter := NewFixedIterator() rightIter := NewFixedIterator() intersectionArrow := NewIntersectionArrowIterator(leftIter, rightIter) @@ -272,8 +258,6 @@ func TestIntersectionArrowIterator(t *testing.T) { } func TestIntersectionArrowIteratorCaveatCombination(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context @@ -289,8 +273,6 @@ func TestIntersectionArrowIteratorCaveatCombination(t *testing.T) { WithReader(datalayer.NewDataLayer(ds).SnapshotReader(revision))) t.Run("CombineTwoCaveats_AND_Logic", func(t *testing.T) { - t.Parallel() - // Left side path with caveat leftPath := MustPathFromString("document:doc1#team@team:team1") leftPath.Caveat = &core.CaveatExpression{ @@ -343,8 +325,6 @@ func TestIntersectionArrowIteratorCaveatCombination(t *testing.T) { }) t.Run("LeftCaveat_Right_NoCaveat", func(t *testing.T) { - t.Parallel() - // Left side path with caveat leftPath := MustPathFromString("document:doc1#team@team:team1") leftPath.Caveat = &core.CaveatExpression{ @@ -388,8 +368,6 @@ func TestIntersectionArrowIteratorCaveatCombination(t *testing.T) { }) t.Run("MultiplePaths_CombineCaveats_AND_Logic", func(t *testing.T) { - t.Parallel() - // Left side: document has multiple teams, each with different caveats leftPath1 := MustPathFromString("document:doc1#team@team:team1") leftPath1.Caveat = &core.CaveatExpression{ @@ -482,8 +460,6 @@ func TestIntersectionArrowIteratorCaveatCombination(t *testing.T) { } func TestIntersectionArrowIteratorClone(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test paths @@ -535,8 +511,6 @@ func TestIntersectionArrowIteratorClone(t *testing.T) { } func TestIntersectionArrowIteratorExplain(t *testing.T) { - t.Parallel() - require := require.New(t) leftPath := MustPathFromString("document:doc1#team@team:team1") @@ -556,8 +530,6 @@ func TestIntersectionArrowIteratorExplain(t *testing.T) { } func TestIntersectionArrowIteratorIterSubjects(t *testing.T) { - t.Parallel() - require := require.New(t) leftIter := NewFixedIterator() @@ -577,8 +549,6 @@ func TestIntersectionArrowIteratorIterSubjects(t *testing.T) { } func TestIntersectionArrowIteratorIterResources(t *testing.T) { - t.Parallel() - require := require.New(t) leftIter := NewFixedIterator() @@ -598,15 +568,12 @@ func TestIntersectionArrowIteratorIterResources(t *testing.T) { } func TestIntersectionArrowIterSubjects(t *testing.T) { - t.Parallel() - ctx := &Context{ Context: t.Context(), Executor: LocalExecutor{}, } t.Run("AllLeftSubjectsSatisfyRight", func(t *testing.T) { - t.Parallel() require := require.New(t) // Left: doc1 -> folder1, folder2 @@ -635,7 +602,6 @@ func TestIntersectionArrowIterSubjects(t *testing.T) { }) t.Run("NotAllLeftSubjectsSatisfyRight", func(t *testing.T) { - t.Parallel() require := require.New(t) // Left: doc1 -> folder1, folder2 @@ -660,7 +626,6 @@ func TestIntersectionArrowIterSubjects(t *testing.T) { }) t.Run("EmptyLeftIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) // No left paths @@ -680,7 +645,6 @@ func TestIntersectionArrowIterSubjects(t *testing.T) { }) t.Run("MultipleRightSubjects", func(t *testing.T) { - t.Parallel() require := require.New(t) // Left: doc1 -> folder1 @@ -712,7 +676,6 @@ func TestIntersectionArrowIterSubjects(t *testing.T) { }) t.Run("CaveatCombination", func(t *testing.T) { - t.Parallel() require := require.New(t) // Left with caveat, right with caveat @@ -753,7 +716,6 @@ func TestIntersectionArrowIterSubjects(t *testing.T) { }) t.Run("ThreeLeftSubjectsAllSatisfy", func(t *testing.T) { - t.Parallel() require := require.New(t) // Left: doc1 -> folder1, folder2, folder3 @@ -785,10 +747,7 @@ func TestIntersectionArrowIterSubjects(t *testing.T) { } func TestIntersectionArrow_Types(t *testing.T) { - t.Parallel() - t.Run("ResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create left and right iterators @@ -807,7 +766,6 @@ func TestIntersectionArrow_Types(t *testing.T) { }) t.Run("SubjectTypes", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create left and right iterators diff --git a/pkg/query/intersection_test.go b/pkg/query/intersection_test.go index 87c6a27bb..72a950fbb 100644 --- a/pkg/query/intersection_test.go +++ b/pkg/query/intersection_test.go @@ -11,16 +11,12 @@ import ( ) func TestIntersectionIterator(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context ctx := NewLocalContext(t.Context()) t.Run("Check_Intersection", func(t *testing.T) { - t.Parallel() - // Create an intersection where both iterators have matching data // Both iterators should have alice with access to doc1 documentAccess := NewDocumentAccessFixedIterator() @@ -46,8 +42,6 @@ func TestIntersectionIterator(t *testing.T) { }) t.Run("Check_EmptyIntersection", func(t *testing.T) { - t.Parallel() - // Create an intersection with contradictory requirements // Use iterators that don't have overlapping data documentAccess := NewDocumentAccessFixedIterator() @@ -67,8 +61,6 @@ func TestIntersectionIterator(t *testing.T) { }) t.Run("Check_NoSubIterators", func(t *testing.T) { - t.Parallel() - intersect := NewIntersectionIterator() // Empty intersection should return empty results @@ -84,8 +76,6 @@ func TestIntersectionIterator(t *testing.T) { }) t.Run("Check_SingleSubIterator", func(t *testing.T) { - t.Parallel() - documentAccess := NewDocumentAccessFixedIterator() intersect := NewIntersectionIterator(documentAccess) @@ -98,8 +88,6 @@ func TestIntersectionIterator(t *testing.T) { }) t.Run("Check_EmptyResourceList", func(t *testing.T) { - t.Parallel() - documentAccess := NewDocumentAccessFixedIterator() intersect := NewIntersectionIterator(documentAccess) @@ -116,8 +104,6 @@ func TestIntersectionIterator(t *testing.T) { }) t.Run("Check_NoMatchingSubject", func(t *testing.T) { - t.Parallel() - documentAccess := NewDocumentAccessFixedIterator() multiRole := NewMultiRoleFixedIterator() @@ -134,8 +120,6 @@ func TestIntersectionIterator(t *testing.T) { }) t.Run("IterSubjects", func(t *testing.T) { - t.Parallel() - // Add test iterators documentAccess := NewDocumentAccessFixedIterator() multiRole := NewMultiRoleFixedIterator() @@ -153,8 +137,6 @@ func TestIntersectionIterator(t *testing.T) { }) t.Run("IterResources", func(t *testing.T) { - t.Parallel() - // Add test iterators documentAccess := NewDocumentAccessFixedIterator() multiRole := NewMultiRoleFixedIterator() @@ -173,8 +155,6 @@ func TestIntersectionIterator(t *testing.T) { } func TestIntersectionIteratorClone(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context @@ -225,13 +205,9 @@ func TestIntersectionIteratorClone(t *testing.T) { } func TestIntersectionIteratorExplain(t *testing.T) { - t.Parallel() - require := require.New(t) t.Run("EmptyIntersection", func(t *testing.T) { - t.Parallel() - // NewIntersectionIterator() with no args returns empty FixedIterator (canonical form) intersect := NewIntersectionIterator() _, isFixed := intersect.(*FixedIterator) @@ -243,8 +219,6 @@ func TestIntersectionIteratorExplain(t *testing.T) { }) t.Run("IntersectionWithSubIterators", func(t *testing.T) { - t.Parallel() - documentAccess := NewDocumentAccessFixedIterator() multiRole := NewMultiRoleFixedIterator() @@ -261,8 +235,6 @@ func TestIntersectionIteratorExplain(t *testing.T) { } func TestIntersectionIteratorEarlyTermination(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context @@ -290,16 +262,12 @@ func TestIntersectionIteratorEarlyTermination(t *testing.T) { } func TestIntersectionIteratorCaveatCombination(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context ctx := NewLocalContext(t.Context()) t.Run("CombineTwoCaveats_AND_Logic", func(t *testing.T) { - t.Parallel() - // Both iterators return the same path but with different caveats // Should combine with AND logic pathWithCaveat1 := MustPathFromString("document:doc1#viewer@user:alice") @@ -340,8 +308,6 @@ func TestIntersectionIteratorCaveatCombination(t *testing.T) { }) t.Run("OneCaveat_One_NoCaveat_AND_Logic", func(t *testing.T) { - t.Parallel() - // One path has caveat, one doesn't - caveat should be preserved (AND logic) pathWithCaveat := MustPathFromString("document:doc1#viewer@user:alice") pathWithCaveat.Caveat = &core.CaveatExpression{ @@ -371,8 +337,6 @@ func TestIntersectionIteratorCaveatCombination(t *testing.T) { }) t.Run("Different_Relations_Same_Endpoint", func(t *testing.T) { - t.Parallel() - // Two iterators with different relations on same endpoint - should merge into one path pathViewer := MustPathFromString("document:doc1#viewer@user:alice") pathViewer.Caveat = &core.CaveatExpression{ @@ -418,8 +382,6 @@ func TestIntersectionIteratorCaveatCombination(t *testing.T) { }) t.Run("No_Common_Endpoints", func(t *testing.T) { - t.Parallel() - // Iterators with no common endpoints - should return empty pathDoc1Alice := MustPathFromString("document:doc1#viewer@user:alice") pathDoc1Alice.Caveat = &core.CaveatExpression{ @@ -454,8 +416,6 @@ func TestIntersectionIteratorCaveatCombination(t *testing.T) { }) t.Run("Three_Iterators_Mixed_Caveats", func(t *testing.T) { - t.Parallel() - // Three iterators with the same path but different caveat combinations pathCaveat1 := MustPathFromString("document:doc1#viewer@user:alice") pathCaveat1.Caveat = &core.CaveatExpression{ @@ -499,8 +459,6 @@ func TestIntersectionIteratorCaveatCombination(t *testing.T) { } func TestIntersectionIterSubjects(t *testing.T) { - t.Parallel() - require := require.New(t) ctx := &Context{ @@ -509,8 +467,6 @@ func TestIntersectionIterSubjects(t *testing.T) { } t.Run("SimpleIntersection", func(t *testing.T) { - t.Parallel() - // Both iterators return alice for doc1 path1 := MustPathFromString("document:doc1#viewer@user:alice") path2 := MustPathFromString("document:doc1#editor@user:alice") @@ -531,8 +487,6 @@ func TestIntersectionIterSubjects(t *testing.T) { }) t.Run("NoCommonSubjects", func(t *testing.T) { - t.Parallel() - // Different subjects in each iterator path1 := MustPathFromString("document:doc1#viewer@user:alice") path2 := MustPathFromString("document:doc1#editor@user:bob") @@ -552,8 +506,6 @@ func TestIntersectionIterSubjects(t *testing.T) { }) t.Run("EmptyIterator", func(t *testing.T) { - t.Parallel() - // One iterator is empty path1 := MustPathFromString("document:doc1#viewer@user:alice") iter1 := NewFixedIterator(path1) @@ -571,8 +523,6 @@ func TestIntersectionIterSubjects(t *testing.T) { }) t.Run("ThreeIteratorsWithCommonSubject", func(t *testing.T) { - t.Parallel() - // Alice appears in all three path1 := MustPathFromString("document:doc1#viewer@user:alice") path2 := MustPathFromString("document:doc1#editor@user:alice") @@ -595,8 +545,6 @@ func TestIntersectionIterSubjects(t *testing.T) { }) t.Run("CaveatCombination", func(t *testing.T) { - t.Parallel() - // Both have alice with different caveats path1 := MustPathFromString("document:doc1#viewer@user:alice") path1.Caveat = &core.CaveatExpression{ @@ -635,10 +583,7 @@ func TestIntersectionIterSubjects(t *testing.T) { } func TestIntersection_Types(t *testing.T) { - t.Parallel() - t.Run("ResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create intersection with fixed iterators @@ -656,7 +601,6 @@ func TestIntersection_Types(t *testing.T) { }) t.Run("ResourceType_EmptyIntersection", func(t *testing.T) { - t.Parallel() require := require.New(t) intersect := NewIntersectionIterator() @@ -667,7 +611,6 @@ func TestIntersection_Types(t *testing.T) { }) t.Run("SubjectTypes", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create intersection with different subject types across iterators @@ -686,7 +629,6 @@ func TestIntersection_Types(t *testing.T) { }) t.Run("SubjectTypes_Deduplication", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create intersection where multiple iterators have same subject types @@ -704,7 +646,6 @@ func TestIntersection_Types(t *testing.T) { }) t.Run("SubjectTypes_EmptyIntersection", func(t *testing.T) { - t.Parallel() require := require.New(t) intersect := NewIntersectionIterator() @@ -715,7 +656,6 @@ func TestIntersection_Types(t *testing.T) { }) t.Run("ResourceType_Mismatch", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create intersection with mismatched resource types diff --git a/pkg/query/optimize_caveat_test.go b/pkg/query/optimize_caveat_test.go index f9c374a33..a8cebef65 100644 --- a/pkg/query/optimize_caveat_test.go +++ b/pkg/query/optimize_caveat_test.go @@ -31,11 +31,7 @@ func createTestDatastoreIteratorNoCaveat() *DatastoreIterator { } func TestPushdownCaveatEvaluation(t *testing.T) { - t.Parallel() - t.Run("pushes caveat through union when both sides have caveat", func(t *testing.T) { - t.Parallel() - caveat := createTestCaveatForPushdown("test_caveat") // Create Union[Relation(with caveat), Relation(with caveat)] @@ -64,8 +60,6 @@ func TestPushdownCaveatEvaluation(t *testing.T) { }) t.Run("pushes caveat through union only on side with caveat", func(t *testing.T) { - t.Parallel() - caveat := createTestCaveatForPushdown("test_caveat") // Create Union[Relation(with caveat), Relation(no caveat)] @@ -102,8 +96,6 @@ func TestPushdownCaveatEvaluation(t *testing.T) { }) t.Run("does not push caveat through intersection arrow", func(t *testing.T) { - t.Parallel() - caveat := createTestCaveatForPushdown("test_caveat") // Create an IntersectionArrow with a relation that has the caveat @@ -128,8 +120,6 @@ func TestPushdownCaveatEvaluation(t *testing.T) { }) t.Run("does not push when no subiterators have caveat", func(t *testing.T) { - t.Parallel() - caveat := createTestCaveatForPushdown("test_caveat") // Create Union[Relation(no caveat), Relation(no caveat)] @@ -154,8 +144,6 @@ func TestPushdownCaveatEvaluation(t *testing.T) { }) t.Run("does not push through leaf iterator", func(t *testing.T) { - t.Parallel() - caveat := createTestCaveatForPushdown("test_caveat") // Create Caveat(Relation) - leaf has no subiterators @@ -176,8 +164,6 @@ func TestPushdownCaveatEvaluation(t *testing.T) { }) t.Run("pushes through nested union", func(t *testing.T) { - t.Parallel() - caveat := createTestCaveatForPushdown("test_caveat") // Create Caveat(Union[Union[Rel1, Rel2], Rel3]) @@ -219,8 +205,6 @@ func TestPushdownCaveatEvaluation(t *testing.T) { }) t.Run("works with intersection of relations", func(t *testing.T) { - t.Parallel() - caveat := createTestCaveatForPushdown("test_caveat") // Create Caveat(Intersection[Rel1(with caveat), Rel2(no caveat)]) @@ -249,34 +233,24 @@ func TestPushdownCaveatEvaluation(t *testing.T) { } func TestContainsCaveat(t *testing.T) { - t.Parallel() - caveat := createTestCaveatForPushdown("test_caveat") t.Run("detects caveat in relation iterator", func(t *testing.T) { - t.Parallel() - rel := createTestDatastoreIterator("test_caveat") require.True(t, containsCaveat(rel, caveat)) }) t.Run("does not detect when caveat name differs", func(t *testing.T) { - t.Parallel() - rel := createTestDatastoreIterator("other_caveat") require.False(t, containsCaveat(rel, caveat)) }) t.Run("does not detect when no caveat", func(t *testing.T) { - t.Parallel() - rel := createTestDatastoreIteratorNoCaveat() require.False(t, containsCaveat(rel, caveat)) }) t.Run("detects caveat in nested structure", func(t *testing.T) { - t.Parallel() - rel1 := createTestDatastoreIteratorNoCaveat() rel2 := createTestDatastoreIterator("test_caveat") union := NewUnionIterator(rel1, rel2) @@ -285,8 +259,6 @@ func TestContainsCaveat(t *testing.T) { }) t.Run("does not detect caveat in structure without it", func(t *testing.T) { - t.Parallel() - rel1 := createTestDatastoreIteratorNoCaveat() rel2 := createTestDatastoreIteratorNoCaveat() union := NewUnionIterator(rel1, rel2) @@ -295,15 +267,11 @@ func TestContainsCaveat(t *testing.T) { }) t.Run("handles nil caveat in relationContainsCaveat", func(t *testing.T) { - t.Parallel() - rel := createTestDatastoreIterator("test_caveat") require.False(t, relationContainsCaveat(rel, nil)) }) t.Run("handles relation with nil base in relationContainsCaveat", func(t *testing.T) { - t.Parallel() - caveat := createTestCaveatForPushdown("test_caveat") // Create a DatastoreIterator with nil base rel := &DatastoreIterator{base: nil} @@ -312,11 +280,7 @@ func TestContainsCaveat(t *testing.T) { } func TestPushdownCaveatEvaluationEdgeCases(t *testing.T) { - t.Parallel() - t.Run("does not push through nested CaveatIterator", func(t *testing.T) { - t.Parallel() - caveat := createTestCaveatForPushdown("test_caveat") // Create Caveat(Caveat(Relation)) diff --git a/pkg/query/optimize_test.go b/pkg/query/optimize_test.go index 23d941138..87b3362a5 100644 --- a/pkg/query/optimize_test.go +++ b/pkg/query/optimize_test.go @@ -20,11 +20,7 @@ func newNonEmptyFixedIterator() *FixedIterator { } func TestWrapOptimizer(t *testing.T) { - t.Parallel() - t.Run("matches correct type", func(t *testing.T) { - t.Parallel() - // Create a typed optimizer that only works on Union typedOptimizer := func(u *UnionIterator) (Iterator, bool, error) { if len(u.subIts) == 1 { @@ -47,8 +43,6 @@ func TestWrapOptimizer(t *testing.T) { }) t.Run("does not match wrong type", func(t *testing.T) { - t.Parallel() - // Create a typed optimizer that only works on Union typedOptimizer := func(u *UnionIterator) (Iterator, bool, error) { return u, true, nil // Would return true if called diff --git a/pkg/query/outline_fuzz_test.go b/pkg/query/outline_fuzz_test.go index f39edf5c2..77a5c6ee6 100644 --- a/pkg/query/outline_fuzz_test.go +++ b/pkg/query/outline_fuzz_test.go @@ -366,7 +366,6 @@ func dumpOutline(o Outline, indent string) string { // TestOutlineGeneratorBasic tests that the generator produces valid outlines func TestOutlineGeneratorBasic(t *testing.T) { - t.Parallel() require := require.New(t) // Test with various seeds @@ -403,7 +402,6 @@ func TestOutlineGeneratorBasic(t *testing.T) { // TestOutlineGeneratorDeterministic ensures the generator is deterministic func TestOutlineGeneratorDeterministic(t *testing.T) { - t.Parallel() require := require.New(t) data := []byte{1, 2, 3, 4, 5, 6, 7, 8, 5} @@ -421,7 +419,6 @@ func TestOutlineGeneratorDeterministic(t *testing.T) { // TestOutlineGeneratorCoverage checks that the generator covers different types func TestOutlineGeneratorCoverage(t *testing.T) { - t.Parallel() require := require.New(t) typesSeen := make(map[IteratorType]bool) diff --git a/pkg/query/outline_test.go b/pkg/query/outline_test.go index 8a5e000ba..dff2f3be5 100644 --- a/pkg/query/outline_test.go +++ b/pkg/query/outline_test.go @@ -11,10 +11,7 @@ import ( ) func TestOutline_Compile(t *testing.T) { - t.Parallel() - t.Run("NullIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{Type: NullIteratorType} @@ -31,7 +28,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("DatastoreIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) rel := schema.NewTestBaseRelation("document", "viewer", "user", tuple.Ellipsis) @@ -54,7 +50,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("DatastoreIteratorType_MissingRelation", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -71,7 +66,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("UnionIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) rel1 := schema.NewTestBaseRelation("doc", "viewer", "user", tuple.Ellipsis) @@ -97,7 +91,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("IntersectionIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) rel1 := schema.NewTestBaseRelation("doc", "viewer", "user", tuple.Ellipsis) @@ -123,7 +116,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("FixedIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := MustPathFromString("document:doc1#viewer@user:alice") @@ -148,7 +140,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("FixedIteratorType_NoPaths", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -168,7 +159,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("ArrowIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -191,7 +181,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("ArrowIteratorType_WrongSubiteratorCount", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -210,7 +199,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("ExclusionIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -233,7 +221,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("ExclusionIteratorType_WrongSubiteratorCount", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -252,7 +239,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("CaveatIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat := &core.ContextualizedCaveat{CaveatName: "test_caveat"} @@ -281,7 +267,6 @@ func TestOutline_Compile(t *testing.T) { // handles these cases before compilation (extracts caveats, normalizes structure) t.Run("AliasIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -306,7 +291,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("AliasIteratorType_MissingRelationName", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -326,7 +310,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("RecursiveIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -353,7 +336,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("RecursiveIteratorType_MissingDefinitionName", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -375,7 +357,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("RecursiveSentinelIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -399,7 +380,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("RecursiveSentinelIteratorType_MissingArgs", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -416,7 +396,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("IntersectionArrowIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -439,7 +418,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("SelfIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -463,7 +441,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("SelfIteratorType_MissingArgs", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -482,7 +459,6 @@ func TestOutline_Compile(t *testing.T) { }) t.Run("UnknownIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -499,10 +475,7 @@ func TestOutline_Compile(t *testing.T) { } func TestOutline_Decompile(t *testing.T) { - t.Parallel() - t.Run("NilIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) outline, err := Decompile(nil) @@ -511,7 +484,6 @@ func TestOutline_Decompile(t *testing.T) { }) t.Run("DatastoreIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) rel := schema.NewTestBaseRelation("document", "viewer", "user", tuple.Ellipsis) @@ -525,7 +497,6 @@ func TestOutline_Decompile(t *testing.T) { }) t.Run("UnionIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) union := NewUnionIterator( @@ -540,7 +511,6 @@ func TestOutline_Decompile(t *testing.T) { }) t.Run("IntersectionIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) intersection := NewIntersectionIterator( @@ -555,7 +525,6 @@ func TestOutline_Decompile(t *testing.T) { }) t.Run("FixedIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := MustPathFromString("document:doc1#viewer@user:alice") @@ -570,7 +539,6 @@ func TestOutline_Decompile(t *testing.T) { }) t.Run("ArrowIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) arrow := NewArrowIterator(NewFixedIterator(), NewFixedIterator()) @@ -582,7 +550,6 @@ func TestOutline_Decompile(t *testing.T) { }) t.Run("ExclusionIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) exclusion := NewExclusionIterator(NewFixedIterator(), NewFixedIterator()) @@ -594,7 +561,6 @@ func TestOutline_Decompile(t *testing.T) { }) t.Run("CaveatIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat := &core.ContextualizedCaveat{CaveatName: "test_caveat"} @@ -609,7 +575,6 @@ func TestOutline_Decompile(t *testing.T) { }) t.Run("AliasIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) alias := NewAliasIterator("viewer", NewFixedIterator()) @@ -622,7 +587,6 @@ func TestOutline_Decompile(t *testing.T) { }) t.Run("RecursiveIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) rec := NewRecursiveIterator(NewFixedIterator(), "document", "parent") @@ -636,7 +600,6 @@ func TestOutline_Decompile(t *testing.T) { }) t.Run("RecursiveSentinelIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) sentinel := NewRecursiveSentinelIterator("document", "parent", false) @@ -650,7 +613,6 @@ func TestOutline_Decompile(t *testing.T) { }) t.Run("IntersectionArrowIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) intArrow := NewIntersectionArrowIterator(NewFixedIterator(), NewFixedIterator()) @@ -662,7 +624,6 @@ func TestOutline_Decompile(t *testing.T) { }) t.Run("SelfIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) self := NewSelfIterator("viewer", "document") @@ -677,10 +638,7 @@ func TestOutline_Decompile(t *testing.T) { } func TestOutline_CompileDecompileRoundtrip(t *testing.T) { - t.Parallel() - t.Run("DatastoreIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) rel := schema.NewTestBaseRelation("document", "viewer", "user", tuple.Ellipsis) @@ -708,7 +666,6 @@ func TestOutline_CompileDecompileRoundtrip(t *testing.T) { }) t.Run("ComplexNestedStructure", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a complex nested structure @@ -744,7 +701,6 @@ func TestOutline_CompileDecompileRoundtrip(t *testing.T) { }) t.Run("ArrowWithDatastore", func(t *testing.T) { - t.Parallel() require := require.New(t) rel1 := schema.NewTestBaseRelation("document", "viewer", "user", tuple.Ellipsis) @@ -781,7 +737,6 @@ func TestOutline_CompileDecompileRoundtrip(t *testing.T) { }) t.Run("CaveatIterator", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat := &core.ContextualizedCaveat{CaveatName: "test_caveat"} @@ -811,10 +766,7 @@ func TestOutline_CompileDecompileRoundtrip(t *testing.T) { } func TestOutline_Equals(t *testing.T) { - t.Parallel() - t.Run("IdenticalOutlines", func(t *testing.T) { - t.Parallel() require := require.New(t) o1 := Outline{Type: NullIteratorType} @@ -825,7 +777,6 @@ func TestOutline_Equals(t *testing.T) { }) t.Run("DifferentTypes", func(t *testing.T) { - t.Parallel() require := require.New(t) o1 := Outline{Type: NullIteratorType} @@ -835,7 +786,6 @@ func TestOutline_Equals(t *testing.T) { }) t.Run("DifferentArgs", func(t *testing.T) { - t.Parallel() require := require.New(t) rel1 := schema.NewTestBaseRelation("document", "viewer", "user", tuple.Ellipsis) @@ -854,7 +804,6 @@ func TestOutline_Equals(t *testing.T) { }) t.Run("DifferentSubiteratorCount", func(t *testing.T) { - t.Parallel() require := require.New(t) o1 := Outline{ @@ -875,7 +824,6 @@ func TestOutline_Equals(t *testing.T) { }) t.Run("DifferentSubiterators", func(t *testing.T) { - t.Parallel() require := require.New(t) o1 := Outline{ @@ -895,7 +843,6 @@ func TestOutline_Equals(t *testing.T) { }) t.Run("NilArgs", func(t *testing.T) { - t.Parallel() require := require.New(t) o1 := Outline{Type: NullIteratorType, Args: nil} @@ -905,7 +852,6 @@ func TestOutline_Equals(t *testing.T) { }) t.Run("OneNilArgs", func(t *testing.T) { - t.Parallel() require := require.New(t) o1 := Outline{Type: FixedIteratorType, Args: nil} @@ -919,10 +865,7 @@ func TestOutline_Equals(t *testing.T) { } func TestOutlineCompare(t *testing.T) { - t.Parallel() - t.Run("EqualOutlines", func(t *testing.T) { - t.Parallel() require := require.New(t) o1 := Outline{Type: NullIteratorType} @@ -932,7 +875,6 @@ func TestOutlineCompare(t *testing.T) { }) t.Run("DifferentTypes", func(t *testing.T) { - t.Parallel() require := require.New(t) o1 := Outline{Type: DatastoreIteratorType} @@ -944,7 +886,6 @@ func TestOutlineCompare(t *testing.T) { }) t.Run("SameTypeDifferentArgs", func(t *testing.T) { - t.Parallel() require := require.New(t) o1 := Outline{ @@ -962,7 +903,6 @@ func TestOutlineCompare(t *testing.T) { }) t.Run("DifferentSubiteratorCount", func(t *testing.T) { - t.Parallel() require := require.New(t) o1 := Outline{ @@ -984,7 +924,6 @@ func TestOutlineCompare(t *testing.T) { }) t.Run("DifferentSubiterators", func(t *testing.T) { - t.Parallel() require := require.New(t) o1 := Outline{ @@ -1006,7 +945,6 @@ func TestOutlineCompare(t *testing.T) { }) t.Run("NilArgs", func(t *testing.T) { - t.Parallel() require := require.New(t) o1 := Outline{Type: FixedIteratorType, Args: nil} @@ -1019,10 +957,7 @@ func TestOutlineCompare(t *testing.T) { } func TestArgsCompare(t *testing.T) { - t.Parallel() - t.Run("BothNil", func(t *testing.T) { - t.Parallel() require := require.New(t) result := argsCompare(nil, nil) @@ -1030,7 +965,6 @@ func TestArgsCompare(t *testing.T) { }) t.Run("FirstNil", func(t *testing.T) { - t.Parallel() require := require.New(t) result := argsCompare(nil, &IteratorArgs{}) @@ -1038,7 +972,6 @@ func TestArgsCompare(t *testing.T) { }) t.Run("SecondNil", func(t *testing.T) { - t.Parallel() require := require.New(t) result := argsCompare(&IteratorArgs{}, nil) @@ -1046,7 +979,6 @@ func TestArgsCompare(t *testing.T) { }) t.Run("DifferentDefinitionName", func(t *testing.T) { - t.Parallel() require := require.New(t) a1 := &IteratorArgs{DefinitionName: "document"} @@ -1058,7 +990,6 @@ func TestArgsCompare(t *testing.T) { }) t.Run("DifferentRelationName", func(t *testing.T) { - t.Parallel() require := require.New(t) a1 := &IteratorArgs{ @@ -1076,7 +1007,6 @@ func TestArgsCompare(t *testing.T) { }) t.Run("DifferentRelation", func(t *testing.T) { - t.Parallel() require := require.New(t) rel1 := schema.NewTestBaseRelation("document", "viewer", "user", tuple.Ellipsis) @@ -1091,7 +1021,6 @@ func TestArgsCompare(t *testing.T) { }) t.Run("DifferentCaveat", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat1 := &core.ContextualizedCaveat{CaveatName: "caveat1"} @@ -1105,7 +1034,6 @@ func TestArgsCompare(t *testing.T) { }) t.Run("DifferentFixedPathsLength", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := MustPathFromString("document:doc1#viewer@user:alice") @@ -1118,7 +1046,6 @@ func TestArgsCompare(t *testing.T) { }) t.Run("DifferentFixedPaths", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := MustPathFromString("document:doc1#viewer@user:alice") @@ -1132,7 +1059,6 @@ func TestArgsCompare(t *testing.T) { }) t.Run("IdenticalArgs", func(t *testing.T) { - t.Parallel() require := require.New(t) rel := schema.NewTestBaseRelation("document", "viewer", "user", tuple.Ellipsis) @@ -1159,10 +1085,7 @@ func TestArgsCompare(t *testing.T) { } func TestCaveatCompare(t *testing.T) { - t.Parallel() - t.Run("BothNil", func(t *testing.T) { - t.Parallel() require := require.New(t) result := caveatCompare(nil, nil) @@ -1170,7 +1093,6 @@ func TestCaveatCompare(t *testing.T) { }) t.Run("FirstNil", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat := &core.ContextualizedCaveat{CaveatName: "test_caveat"} @@ -1179,7 +1101,6 @@ func TestCaveatCompare(t *testing.T) { }) t.Run("SecondNil", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat := &core.ContextualizedCaveat{CaveatName: "test_caveat"} @@ -1188,7 +1109,6 @@ func TestCaveatCompare(t *testing.T) { }) t.Run("DifferentCaveatNames", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat1 := &core.ContextualizedCaveat{CaveatName: "caveat1"} @@ -1200,7 +1120,6 @@ func TestCaveatCompare(t *testing.T) { }) t.Run("SameNameSameCaveat", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat1 := &core.ContextualizedCaveat{CaveatName: "test_caveat"} @@ -1211,7 +1130,6 @@ func TestCaveatCompare(t *testing.T) { }) t.Run("SameNameIdenticalCaveat", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat1 := &core.ContextualizedCaveat{ @@ -1228,10 +1146,7 @@ func TestCaveatCompare(t *testing.T) { } func TestCanonicalKey_Type(t *testing.T) { - t.Parallel() - t.Run("String method", func(t *testing.T) { - t.Parallel() require := require.New(t) key := CanonicalKey("test_key") @@ -1239,7 +1154,6 @@ func TestCanonicalKey_Type(t *testing.T) { }) t.Run("IsEmpty returns true for empty key", func(t *testing.T) { - t.Parallel() require := require.New(t) key := CanonicalKey("") @@ -1247,7 +1161,6 @@ func TestCanonicalKey_Type(t *testing.T) { }) t.Run("IsEmpty returns false for non-empty key", func(t *testing.T) { - t.Parallel() require := require.New(t) key := CanonicalKey("test_key") @@ -1255,7 +1168,6 @@ func TestCanonicalKey_Type(t *testing.T) { }) t.Run("Hash produces consistent value", func(t *testing.T) { - t.Parallel() require := require.New(t) key := CanonicalKey("test_key") @@ -1265,7 +1177,6 @@ func TestCanonicalKey_Type(t *testing.T) { }) t.Run("Hash produces different values for different keys", func(t *testing.T) { - t.Parallel() require := require.New(t) key1 := CanonicalKey("key1") @@ -1277,10 +1188,7 @@ func TestCanonicalKey_Type(t *testing.T) { } func TestSerializeOutline(t *testing.T) { - t.Parallel() - t.Run("NullIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{Type: NullIteratorType} @@ -1289,7 +1197,6 @@ func TestSerializeOutline(t *testing.T) { }) t.Run("DatastoreIteratorType with Relation", func(t *testing.T) { - t.Parallel() require := require.New(t) rel := schema.NewTestBaseRelation("document", "viewer", "user", tuple.Ellipsis) @@ -1308,7 +1215,6 @@ func TestSerializeOutline(t *testing.T) { }) t.Run("UnionIteratorType with subiterators", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -1324,7 +1230,6 @@ func TestSerializeOutline(t *testing.T) { }) t.Run("IntersectionIteratorType with subiterators", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -1340,7 +1245,6 @@ func TestSerializeOutline(t *testing.T) { }) t.Run("Nested structure", func(t *testing.T) { - t.Parallel() require := require.New(t) // Union( Null, Intersection( Null, Null ) ) @@ -1363,7 +1267,6 @@ func TestSerializeOutline(t *testing.T) { }) t.Run("CaveatIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat := &core.ContextualizedCaveat{CaveatName: "age_check"} @@ -1383,7 +1286,6 @@ func TestSerializeOutline(t *testing.T) { }) t.Run("AliasIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -1401,7 +1303,6 @@ func TestSerializeOutline(t *testing.T) { }) t.Run("RecursiveIteratorType", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -1420,7 +1321,6 @@ func TestSerializeOutline(t *testing.T) { }) t.Run("FixedIteratorType with paths", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := MustPathFromString("document:doc1#viewer@user:alice") @@ -1438,7 +1338,6 @@ func TestSerializeOutline(t *testing.T) { }) t.Run("Empty Args", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -1452,7 +1351,6 @@ func TestSerializeOutline(t *testing.T) { }) t.Run("Nil Args", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -1466,7 +1364,6 @@ func TestSerializeOutline(t *testing.T) { } func TestSerializeOutline_Deterministic(t *testing.T) { - t.Parallel() require := require.New(t) rel := schema.NewTestBaseRelation("document", "viewer", "user", tuple.Ellipsis) @@ -1492,10 +1389,7 @@ func TestSerializeOutline_Deterministic(t *testing.T) { } func TestSerializeOutline_Args(t *testing.T) { - t.Parallel() - t.Run("DefinitionName only", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -1510,7 +1404,6 @@ func TestSerializeOutline_Args(t *testing.T) { }) t.Run("RelationName only", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -1525,7 +1418,6 @@ func TestSerializeOutline_Args(t *testing.T) { }) t.Run("Multiple Args fields", func(t *testing.T) { - t.Parallel() require := require.New(t) outline := Outline{ @@ -1543,7 +1435,6 @@ func TestSerializeOutline_Args(t *testing.T) { } func TestSerializeOutline_IgnoresID(t *testing.T) { - t.Parallel() require := require.New(t) // Create two identical outlines with different IDs @@ -1564,7 +1455,6 @@ func TestSerializeOutline_IgnoresID(t *testing.T) { } func TestCanonicalKey_Hash(t *testing.T) { - t.Parallel() require := require.New(t) // Create different keys diff --git a/pkg/query/path_test.go b/pkg/query/path_test.go index 74dcb3cd6..5e7645395 100644 --- a/pkg/query/path_test.go +++ b/pkg/query/path_test.go @@ -12,7 +12,6 @@ import ( ) func TestPath_ResourceOAR(t *testing.T) { - t.Parallel() require := require.New(t) path := Path{ @@ -27,17 +26,13 @@ func TestPath_ResourceOAR(t *testing.T) { } func TestPath_IsExpired(t *testing.T) { - t.Parallel() - t.Run("nil_expiration", func(t *testing.T) { - t.Parallel() require := require.New(t) path := Path{} require.False(path.IsExpired()) }) t.Run("future_expiration", func(t *testing.T) { - t.Parallel() require := require.New(t) future := time.Now().Add(time.Hour) path := Path{Expiration: &future} @@ -45,7 +40,6 @@ func TestPath_IsExpired(t *testing.T) { }) t.Run("past_expiration", func(t *testing.T) { - t.Parallel() require := require.New(t) past := time.Now().Add(-time.Hour) path := Path{Expiration: &past} @@ -53,7 +47,6 @@ func TestPath_IsExpired(t *testing.T) { }) t.Run("exact_now_expiration", func(t *testing.T) { - t.Parallel() require := require.New(t) now := time.Now().Add(-time.Millisecond) path := &Path{Expiration: &now} @@ -63,10 +56,7 @@ func TestPath_IsExpired(t *testing.T) { } func TestPath_MergeOr(t *testing.T) { - t.Parallel() - t.Run("same_resource_and_subject", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat1 := caveats.CaveatExprForTesting("caveat1") caveat2 := caveats.CaveatExprForTesting("caveat2") @@ -94,7 +84,6 @@ func TestPath_MergeOr(t *testing.T) { }) t.Run("different_resources", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := Path{ Resource: NewObject("document", "doc1"), @@ -112,7 +101,6 @@ func TestPath_MergeOr(t *testing.T) { }) t.Run("different_subjects", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := Path{ Resource: NewObject("document", "doc1"), @@ -131,10 +119,7 @@ func TestPath_MergeOr(t *testing.T) { } func TestPath_MergeAnd(t *testing.T) { - t.Parallel() - t.Run("basic_merge", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat1 := caveats.CaveatExprForTesting("caveat1") caveat2 := caveats.CaveatExprForTesting("caveat2") @@ -163,10 +148,7 @@ func TestPath_MergeAnd(t *testing.T) { } func TestPath_MergeAndNot(t *testing.T) { - t.Parallel() - t.Run("basic_merge", func(t *testing.T) { - t.Parallel() require := require.New(t) caveat1 := caveats.CaveatExprForTesting("caveat1") caveat2 := caveats.CaveatExprForTesting("caveat2") @@ -195,12 +177,8 @@ func TestPath_MergeAndNot(t *testing.T) { } func TestPath_mergeFrom(t *testing.T) { - t.Parallel() - t.Run("relation_handling", func(t *testing.T) { - t.Parallel() t.Run("same_relation_preserved", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := Path{ Resource: NewObject("document", "doc1"), @@ -220,7 +198,6 @@ func TestPath_mergeFrom(t *testing.T) { }) t.Run("different_relation_cleared", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := Path{ Resource: NewObject("document", "doc1"), @@ -241,9 +218,7 @@ func TestPath_mergeFrom(t *testing.T) { }) t.Run("expiration_handling", func(t *testing.T) { - t.Parallel() t.Run("nil_expiration_both", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := Path{ Resource: NewObject("document", "doc1"), @@ -261,7 +236,6 @@ func TestPath_mergeFrom(t *testing.T) { }) t.Run("nil_expiration_first", func(t *testing.T) { - t.Parallel() require := require.New(t) later := time.Now().Add(time.Hour) path1 := Path{ @@ -282,7 +256,6 @@ func TestPath_mergeFrom(t *testing.T) { }) t.Run("earlier_expiration_wins", func(t *testing.T) { - t.Parallel() require := require.New(t) earlier := time.Now().Add(time.Hour) later := time.Now().Add(2 * time.Hour) @@ -306,7 +279,6 @@ func TestPath_mergeFrom(t *testing.T) { }) t.Run("integrity_handling", func(t *testing.T) { - t.Parallel() require := require.New(t) integrity1 := &core.RelationshipIntegrity{KeyId: "key1"} integrity2 := &core.RelationshipIntegrity{KeyId: "key2"} @@ -331,7 +303,6 @@ func TestPath_mergeFrom(t *testing.T) { }) t.Run("metadata_handling", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := Path{ Resource: NewObject("document", "doc1"), @@ -360,7 +331,6 @@ func TestPath_mergeFrom(t *testing.T) { }) t.Run("metadata_nil_initialization", func(t *testing.T) { - t.Parallel() require := require.New(t) path1 := Path{ Resource: NewObject("document", "doc1"), @@ -381,7 +351,6 @@ func TestPath_mergeFrom(t *testing.T) { }) t.Run("caveat_operations", func(t *testing.T) { - t.Parallel() caveat1 := caveats.CaveatExprForTesting("caveat1") caveat2 := caveats.CaveatExprForTesting("caveat2") @@ -437,11 +406,9 @@ func TestPath_mergeFrom(t *testing.T) { } func TestFromRelationship(t *testing.T) { - t.Parallel() require := require.New(t) t.Run("basic_conversion", func(t *testing.T) { - t.Parallel() rel := tuple.Relationship{ RelationshipReference: tuple.RelationshipReference{ Resource: tuple.ObjectAndRelation{ @@ -470,7 +437,6 @@ func TestFromRelationship(t *testing.T) { }) t.Run("with_caveat", func(t *testing.T) { - t.Parallel() caveat := &core.ContextualizedCaveat{CaveatName: "test_caveat"} expiration := time.Now().Add(time.Hour) integrity := &core.RelationshipIntegrity{KeyId: "key1"} @@ -503,11 +469,9 @@ func TestFromRelationship(t *testing.T) { } func TestPath_ToRelationship(t *testing.T) { - t.Parallel() require := require.New(t) t.Run("basic_conversion", func(t *testing.T) { - t.Parallel() path := Path{ Resource: NewObject("document", "doc1"), Relation: "viewer", @@ -528,7 +492,6 @@ func TestPath_ToRelationship(t *testing.T) { }) t.Run("with_simple_caveat", func(t *testing.T) { - t.Parallel() caveat := &core.ContextualizedCaveat{CaveatName: "test_caveat"} caveatExpr := caveats.CaveatAsExpr(caveat) expiration := time.Now().Add(time.Hour) @@ -552,7 +515,6 @@ func TestPath_ToRelationship(t *testing.T) { }) t.Run("empty_relation_error", func(t *testing.T) { - t.Parallel() path := Path{ Resource: NewObject("document", "doc1"), Relation: "", // Empty relation should cause error @@ -565,7 +527,6 @@ func TestPath_ToRelationship(t *testing.T) { }) t.Run("complex_caveat_error", func(t *testing.T) { - t.Parallel() // Create a complex caveat expression (OR operation) caveat1 := caveats.CaveatExprForTesting("caveat1") caveat2 := caveats.CaveatExprForTesting("caveat2") @@ -584,7 +545,6 @@ func TestPath_ToRelationship(t *testing.T) { }) t.Run("multiple_integrity_error", func(t *testing.T) { - t.Parallel() integrity1 := &core.RelationshipIntegrity{KeyId: "key1"} integrity2 := &core.RelationshipIntegrity{KeyId: "key2"} @@ -602,11 +562,9 @@ func TestPath_ToRelationship(t *testing.T) { } func TestPath_ConversionRoundtrip(t *testing.T) { - t.Parallel() require := require.New(t) t.Run("basic_roundtrip", func(t *testing.T) { - t.Parallel() originalRel := tuple.Relationship{ RelationshipReference: tuple.RelationshipReference{ Resource: tuple.ObjectAndRelation{ @@ -636,7 +594,6 @@ func TestPath_ConversionRoundtrip(t *testing.T) { }) t.Run("roundtrip_with_optional_fields", func(t *testing.T) { - t.Parallel() caveat := &core.ContextualizedCaveat{CaveatName: "test_caveat"} expiration := time.Now().Add(time.Hour).Truncate(time.Microsecond) // Truncate for comparison integrity := &core.RelationshipIntegrity{KeyId: "key1"} @@ -676,7 +633,6 @@ func TestPath_ConversionRoundtrip(t *testing.T) { // Additional comprehensive tests for uncovered path.go functions func TestPath_EqualsEndpoints(t *testing.T) { - t.Parallel() require := require.New(t) // Base paths for comparison @@ -687,23 +643,19 @@ func TestPath_EqualsEndpoints(t *testing.T) { path5 := MustPathFromString("document:doc1#view@user:bob") // Different subject t.Run("identical_endpoints", func(t *testing.T) { - t.Parallel() require.True(path1.EqualsEndpoints(path2)) }) t.Run("different_relation_same_endpoints", func(t *testing.T) { - t.Parallel() // EqualsEndpoints should ignore relation and only compare resource/subject require.True(path1.EqualsEndpoints(path3)) }) t.Run("different_resource", func(t *testing.T) { - t.Parallel() require.False(path1.EqualsEndpoints(path4)) }) t.Run("different_subject", func(t *testing.T) { - t.Parallel() require.False(path1.EqualsEndpoints(path5)) }) @@ -711,7 +663,6 @@ func TestPath_EqualsEndpoints(t *testing.T) { } func TestPath_Equals_Comprehensive(t *testing.T) { - t.Parallel() require := require.New(t) // Create paths with various attributes for comprehensive testing @@ -756,44 +707,37 @@ func TestPath_Equals_Comprehensive(t *testing.T) { pathWithIntegrity.Integrity = []*core.RelationshipIntegrity{{KeyId: "key1"}} t.Run("identical_paths", func(t *testing.T) { - t.Parallel() path1 := MustPathFromString("document:doc1#view@user:alice") path2 := MustPathFromString("document:doc1#view@user:alice") require.True(path1.Equals(path2)) }) t.Run("different_resource_type", func(t *testing.T) { - t.Parallel() path2 := MustPathFromString("folder:doc1#view@user:alice") require.False(basePath.Equals(path2)) }) t.Run("different_resource_id", func(t *testing.T) { - t.Parallel() path2 := MustPathFromString("document:doc2#view@user:alice") require.False(basePath.Equals(path2)) }) t.Run("different_relation", func(t *testing.T) { - t.Parallel() path2 := MustPathFromString("document:doc1#edit@user:alice") require.False(basePath.Equals(path2)) }) t.Run("different_subject_type", func(t *testing.T) { - t.Parallel() path2 := MustPathFromString("document:doc1#view@group:alice") require.False(basePath.Equals(path2)) }) t.Run("different_subject_id", func(t *testing.T) { - t.Parallel() path2 := MustPathFromString("document:doc1#view@user:bob") require.False(basePath.Equals(path2)) }) t.Run("different_subject_relation", func(t *testing.T) { - t.Parallel() path1 := MustPathFromString("document:doc1#view@group:admin#member") path2 := MustPathFromString("document:doc1#view@group:admin") require.False(path1.Equals(path2)) @@ -802,7 +746,6 @@ func TestPath_Equals_Comprehensive(t *testing.T) { // Note: nil path tests removed since Equals methods now use value receivers t.Run("caveat_differences", func(t *testing.T) { - t.Parallel() // Base path vs path with caveat require.False(basePath.Equals(pathWithCaveat)) @@ -815,7 +758,6 @@ func TestPath_Equals_Comprehensive(t *testing.T) { }) t.Run("expiration_differences", func(t *testing.T) { - t.Parallel() // Base path vs path with expiration require.False(basePath.Equals(pathWithExpiration)) @@ -828,7 +770,6 @@ func TestPath_Equals_Comprehensive(t *testing.T) { }) t.Run("metadata_differences", func(t *testing.T) { - t.Parallel() // Base path vs path with metadata require.False(basePath.Equals(pathWithMetadata)) @@ -841,7 +782,6 @@ func TestPath_Equals_Comprehensive(t *testing.T) { }) t.Run("integrity_differences", func(t *testing.T) { - t.Parallel() // Base path vs path with integrity require.False(basePath.Equals(pathWithIntegrity)) @@ -857,7 +797,6 @@ func TestPath_Equals_Comprehensive(t *testing.T) { } func TestPath_MergeAndNot_Comprehensive(t *testing.T) { - t.Parallel() require := require.New(t) // Create base paths @@ -886,7 +825,6 @@ func TestPath_MergeAndNot_Comprehensive(t *testing.T) { pathWithMetadata2.Metadata = map[string]any{"source": "path2", "priority": "low"} t.Run("basic_merge_and_not", func(t *testing.T) { - t.Parallel() // Make a copy to test on testPath := basePath testPath, err := testPath.MergeAndNot(pathWithCaveat1) @@ -901,7 +839,6 @@ func TestPath_MergeAndNot_Comprehensive(t *testing.T) { }) t.Run("both_paths_have_caveats", func(t *testing.T) { - t.Parallel() testPath := pathWithCaveat1 testPath, err := testPath.MergeAndNot(pathWithCaveat2) @@ -912,7 +849,6 @@ func TestPath_MergeAndNot_Comprehensive(t *testing.T) { }) t.Run("merge_metadata", func(t *testing.T) { - t.Parallel() testPath := pathWithMetadata1 testPath, err := testPath.MergeAndNot(pathWithMetadata2) @@ -925,7 +861,6 @@ func TestPath_MergeAndNot_Comprehensive(t *testing.T) { }) t.Run("merge_different_resources_should_error", func(t *testing.T) { - t.Parallel() differentResourcePath := MustPathFromString("folder:doc1#view@user:alice") testPath := basePath @@ -936,7 +871,6 @@ func TestPath_MergeAndNot_Comprehensive(t *testing.T) { }) t.Run("merge_different_subjects_should_error", func(t *testing.T) { - t.Parallel() differentSubjectPath := MustPathFromString("document:doc1#view@user:bob") testPath := basePath @@ -948,8 +882,6 @@ func TestPath_MergeAndNot_Comprehensive(t *testing.T) { } func TestPathOrder_Metadata(t *testing.T) { - t.Parallel() - base := MustPathFromString("document:doc1#view@user:alice") withMeta := func(m map[string]any) Path { p := base @@ -958,25 +890,21 @@ func TestPathOrder_Metadata(t *testing.T) { } t.Run("nil vs nil equal", func(t *testing.T) { - t.Parallel() require.Equal(t, 0, PathOrder(withMeta(nil), withMeta(nil))) }) t.Run("nil vs empty equal", func(t *testing.T) { - t.Parallel() // nil and empty map both have zero keys require.Equal(t, 0, PathOrder(withMeta(nil), withMeta(map[string]any{}))) }) t.Run("no metadata less than with metadata", func(t *testing.T) { - t.Parallel() // nil (0 keys) < map with 1 key ("a" is the first key encountered) require.Equal(t, -1, PathOrder(withMeta(nil), withMeta(map[string]any{"a": "x"}))) require.Equal(t, 1, PathOrder(withMeta(map[string]any{"a": "x"}), withMeta(nil))) }) t.Run("first differing key determines order", func(t *testing.T) { - t.Parallel() // {a:x} < {b:x} because key "a" < "b" require.Equal(t, -1, PathOrder( withMeta(map[string]any{"a": "x"}), @@ -989,7 +917,6 @@ func TestPathOrder_Metadata(t *testing.T) { }) t.Run("key order beats key count", func(t *testing.T) { - t.Parallel() // sorted keys ["a","b"] vs ["b","c"]: first key "a" < "b", so first map is less // even though both have the same count require.Equal(t, -1, PathOrder( @@ -999,7 +926,6 @@ func TestPathOrder_Metadata(t *testing.T) { }) t.Run("same keys compare values", func(t *testing.T) { - t.Parallel() require.Equal(t, -1, PathOrder( withMeta(map[string]any{"k": "alpha"}), withMeta(map[string]any{"k": "beta"}), @@ -1011,7 +937,6 @@ func TestPathOrder_Metadata(t *testing.T) { }) t.Run("same keys same values equal", func(t *testing.T) { - t.Parallel() require.Equal(t, 0, PathOrder( withMeta(map[string]any{"x": "1", "y": "2"}), withMeta(map[string]any{"x": "1", "y": "2"}), @@ -1019,7 +944,6 @@ func TestPathOrder_Metadata(t *testing.T) { }) t.Run("value compared in sorted key order", func(t *testing.T) { - t.Parallel() // Keys ["a","b"] match; first values match; second value "alpha" < "beta" require.Equal(t, -1, PathOrder( withMeta(map[string]any{"a": "same", "b": "alpha"}), @@ -1028,7 +952,6 @@ func TestPathOrder_Metadata(t *testing.T) { }) t.Run("prefix key list is less", func(t *testing.T) { - t.Parallel() // {a:x} keys ["a"] vs {a:x, b:x} keys ["a","b"]: first keys match, then left runs out require.Equal(t, -1, PathOrder( withMeta(map[string]any{"a": "x"}), @@ -1042,17 +965,13 @@ func TestPathOrder_Metadata(t *testing.T) { } func TestCombineExpiration(t *testing.T) { - t.Parallel() - t.Run("both_nil", func(t *testing.T) { - t.Parallel() require := require.New(t) result := combineExpiration(nil, nil) require.Nil(result) }) t.Run("first_nil", func(t *testing.T) { - t.Parallel() require := require.New(t) later := time.Now().Add(time.Hour) result := combineExpiration(nil, &later) @@ -1061,7 +980,6 @@ func TestCombineExpiration(t *testing.T) { }) t.Run("second_nil", func(t *testing.T) { - t.Parallel() require := require.New(t) later := time.Now().Add(time.Hour) result := combineExpiration(&later, nil) @@ -1070,7 +988,6 @@ func TestCombineExpiration(t *testing.T) { }) t.Run("first_earlier", func(t *testing.T) { - t.Parallel() require := require.New(t) earlier := time.Now().Add(time.Hour) later := time.Now().Add(2 * time.Hour) @@ -1080,7 +997,6 @@ func TestCombineExpiration(t *testing.T) { }) t.Run("second_earlier", func(t *testing.T) { - t.Parallel() require := require.New(t) earlier := time.Now().Add(time.Hour) later := time.Now().Add(2 * time.Hour) @@ -1090,7 +1006,6 @@ func TestCombineExpiration(t *testing.T) { }) t.Run("identical_times", func(t *testing.T) { - t.Parallel() require := require.New(t) now := time.Now().Add(time.Hour) result := combineExpiration(&now, &now) @@ -1100,24 +1015,19 @@ func TestCombineExpiration(t *testing.T) { } func TestCombineIntegrity(t *testing.T) { - t.Parallel() - t.Run("both_nil", func(t *testing.T) { - t.Parallel() require := require.New(t) result := combineIntegrity(nil, nil) require.Nil(result) // Should return nil to match codebase convention }) t.Run("both_empty", func(t *testing.T) { - t.Parallel() require := require.New(t) result := combineIntegrity([]*core.RelationshipIntegrity{}, []*core.RelationshipIntegrity{}) require.Nil(result) // Should return nil when both are empty }) t.Run("first_nil_second_has_values", func(t *testing.T) { - t.Parallel() require := require.New(t) integrity1 := &core.RelationshipIntegrity{KeyId: "key1"} result := combineIntegrity(nil, []*core.RelationshipIntegrity{integrity1}) @@ -1126,7 +1036,6 @@ func TestCombineIntegrity(t *testing.T) { }) t.Run("first_has_values_second_nil", func(t *testing.T) { - t.Parallel() require := require.New(t) integrity1 := &core.RelationshipIntegrity{KeyId: "key1"} result := combineIntegrity([]*core.RelationshipIntegrity{integrity1}, nil) @@ -1135,7 +1044,6 @@ func TestCombineIntegrity(t *testing.T) { }) t.Run("both_have_values", func(t *testing.T) { - t.Parallel() require := require.New(t) integrity1 := &core.RelationshipIntegrity{KeyId: "key1"} integrity2 := &core.RelationshipIntegrity{KeyId: "key2"} @@ -1149,7 +1057,6 @@ func TestCombineIntegrity(t *testing.T) { }) t.Run("multiple_values_each", func(t *testing.T) { - t.Parallel() require := require.New(t) integrity1 := &core.RelationshipIntegrity{KeyId: "key1"} integrity2 := &core.RelationshipIntegrity{KeyId: "key2"} @@ -1167,7 +1074,6 @@ func TestCombineIntegrity(t *testing.T) { }) t.Run("no_aliasing", func(t *testing.T) { - t.Parallel() require := require.New(t) // Verify that modifying the result doesn't affect the inputs integrity1 := &core.RelationshipIntegrity{KeyId: "key1"} diff --git a/pkg/query/quick_e2e_test.go b/pkg/query/quick_e2e_test.go index e722ce9c8..c40adea7b 100644 --- a/pkg/query/quick_e2e_test.go +++ b/pkg/query/quick_e2e_test.go @@ -14,8 +14,6 @@ import ( ) func TestCheck(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -49,8 +47,6 @@ func TestCheck(t *testing.T) { } func TestBaseIterSubjects(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -77,8 +73,6 @@ func TestBaseIterSubjects(t *testing.T) { } func TestCheckArrow(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) diff --git a/pkg/query/recursive_coverage_test.go b/pkg/query/recursive_coverage_test.go index 52fc66307..197b84fb7 100644 --- a/pkg/query/recursive_coverage_test.go +++ b/pkg/query/recursive_coverage_test.go @@ -14,7 +14,6 @@ import ( // TestRecursiveIterator_CanonicalKey tests the CanonicalKey() method (currently 0% coverage) func TestRecursiveIterator_CanonicalKey(t *testing.T) { - t.Parallel() require := require.New(t) sentinel := NewRecursiveSentinelIterator("folder", "view", false) @@ -29,7 +28,6 @@ func TestRecursiveIterator_CanonicalKey(t *testing.T) { // TestReplaceRecursiveSentinel_NonMatchingSentinel tests replacing sentinels that don't match func TestReplaceRecursiveSentinel_NonMatchingSentinel(t *testing.T) { - t.Parallel() require := require.New(t) // Create sentinels with different definitions/relations @@ -67,7 +65,6 @@ func TestReplaceRecursiveSentinel_NonMatchingSentinel(t *testing.T) { // TestReplaceRecursiveSentinel_DeepNesting tests replacement in deeply nested trees func TestReplaceRecursiveSentinel_DeepNesting(t *testing.T) { - t.Parallel() require := require.New(t) sentinel := NewRecursiveSentinelIterator("folder", "view", false) @@ -93,7 +90,6 @@ func TestReplaceRecursiveSentinel_DeepNesting(t *testing.T) { // TestBreadthFirstIterResources_MaxDepth tests that BFS respects max depth limit func TestBreadthFirstIterResources_MaxDepth(t *testing.T) { - t.Parallel() require := require.New(t) // Create an iterator that always returns new paths (infinite recursion) @@ -127,10 +123,7 @@ func TestBreadthFirstIterResources_MaxDepth(t *testing.T) { // TestBreadthFirstIterResources_ErrorHandling tests error paths in BFS IterResources func TestBreadthFirstIterResources_ErrorHandling(t *testing.T) { - t.Parallel() - t.Run("ErrorDuringQuery", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a faulty iterator that fails during query @@ -155,7 +148,6 @@ func TestBreadthFirstIterResources_ErrorHandling(t *testing.T) { }) t.Run("ErrorDuringCollection", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a faulty iterator that fails during collection @@ -182,7 +174,6 @@ func TestBreadthFirstIterResources_ErrorHandling(t *testing.T) { // TestBreadthFirstIterResources_MergeOrSemantics tests OR merging of duplicate paths func TestBreadthFirstIterResources_MergeOrSemantics(t *testing.T) { - t.Parallel() require := require.New(t) // Create an iterator that returns the same endpoint in different plies @@ -218,7 +209,6 @@ func TestBreadthFirstIterResources_MergeOrSemantics(t *testing.T) { // TestIterativeDeepening_MaxDepth tests that iterative deepening respects max depth func TestIterativeDeepening_MaxDepth(t *testing.T) { - t.Parallel() require := require.New(t) // Create a simple iterator that always returns something at each depth @@ -245,7 +235,6 @@ func TestIterativeDeepening_MaxDepth(t *testing.T) { // TestUnwrapRecursiveIterators_NestedRecursion tests unwrapping nested RecursiveIterators func TestUnwrapRecursiveIterators_NestedRecursion(t *testing.T) { - t.Parallel() require := require.New(t) // Create nested recursive iterators diff --git a/pkg/query/recursive_sentinel_test.go b/pkg/query/recursive_sentinel_test.go index 651e821a6..7baf747a4 100644 --- a/pkg/query/recursive_sentinel_test.go +++ b/pkg/query/recursive_sentinel_test.go @@ -9,10 +9,7 @@ import ( ) func TestRecursiveSentinel_Types(t *testing.T) { - t.Parallel() - t.Run("ResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) sentinel := NewRecursiveSentinelIterator("folder", "parent", false) @@ -25,7 +22,6 @@ func TestRecursiveSentinel_Types(t *testing.T) { }) t.Run("SubjectTypes_WithoutSubRelations", func(t *testing.T) { - t.Parallel() require := require.New(t) sentinel := NewRecursiveSentinelIterator("folder", "parent", false) @@ -38,7 +34,6 @@ func TestRecursiveSentinel_Types(t *testing.T) { }) t.Run("SubjectTypes_WithSubRelations", func(t *testing.T) { - t.Parallel() require := require.New(t) sentinel := NewRecursiveSentinelIterator("folder", "parent", true) diff --git a/pkg/query/recursive_strategies_test.go b/pkg/query/recursive_strategies_test.go index b0bbef906..806fa28a5 100644 --- a/pkg/query/recursive_strategies_test.go +++ b/pkg/query/recursive_strategies_test.go @@ -15,8 +15,6 @@ import ( // TestRecursiveCheckStrategies verifies that all three CheckImpl strategies // produce equivalent results for the same input. func TestRecursiveCheckStrategies(t *testing.T) { - t.Parallel() - // Create test paths for a simple recursive structure // These paths represent: folder1 -> folder2 -> user:alice paths := []Path{ @@ -54,8 +52,6 @@ func TestRecursiveCheckStrategies(t *testing.T) { for _, tc := range strategies { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - // Create a separate Context for each parallel subtest to avoid races. // Contexts contain mutable state (e.g., recursiveFrontierCollectors) // that must not be shared across concurrent goroutines. @@ -100,8 +96,6 @@ func TestRecursiveCheckStrategies(t *testing.T) { // TestRecursiveCheckStrategiesEmpty verifies that all strategies handle empty results correctly func TestRecursiveCheckStrategiesEmpty(t *testing.T) { - t.Parallel() - ds, err := memdb.NewMemdbDatastore(0, 0, memdb.DisableGC) require.NoError(t, err) @@ -135,8 +129,6 @@ func TestRecursiveCheckStrategiesEmpty(t *testing.T) { // TestRecursiveCheckStrategiesMultipleResources verifies strategies handle multiple resources correctly func TestRecursiveCheckStrategiesMultipleResources(t *testing.T) { - t.Parallel() - // Create test paths for multiple resources paths := []Path{ { diff --git a/pkg/query/recursive_test.go b/pkg/query/recursive_test.go index 7932b8258..0d1769097 100644 --- a/pkg/query/recursive_test.go +++ b/pkg/query/recursive_test.go @@ -361,10 +361,7 @@ func TestBFSResourcesWithEllipses(t *testing.T) { } func TestRecursiveIterator_Types(t *testing.T) { - t.Parallel() - t.Run("ResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a recursive iterator with a template tree @@ -379,7 +376,6 @@ func TestRecursiveIterator_Types(t *testing.T) { }) t.Run("SubjectTypes", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create a recursive iterator with a template tree @@ -396,7 +392,6 @@ func TestRecursiveIterator_Types(t *testing.T) { // TestRecursiveSentinel_ReplaceSubiterators tests that RecursiveSentinel panics func TestRecursiveSentinel_ReplaceSubiterators(t *testing.T) { - t.Parallel() require := require.New(t) sentinel := NewRecursiveSentinelIterator("folder", "view", false) diff --git a/pkg/query/self_test.go b/pkg/query/self_test.go index 9a66ae3aa..39c682867 100644 --- a/pkg/query/self_test.go +++ b/pkg/query/self_test.go @@ -7,8 +7,6 @@ import ( ) func TestSelfIterator(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context @@ -17,8 +15,6 @@ func TestSelfIterator(t *testing.T) { Executor: LocalExecutor{}, } t.Run("Check", func(t *testing.T) { - t.Parallel() - selfIt := NewSelfIterator("view", "user") // Create a resource seq with both Alice and Bob @@ -39,8 +35,6 @@ func TestSelfIterator(t *testing.T) { }) t.Run("Check_EmptyResults", func(t *testing.T) { - t.Parallel() - selfIt := NewSelfIterator("view", "user") // Only bob in the list now @@ -53,8 +47,6 @@ func TestSelfIterator(t *testing.T) { }) t.Run("IterResources", func(t *testing.T) { - t.Parallel() - selfIt := NewSelfIterator("view", "user") pathSeq, err := ctx.IterResources(selfIt, NewObject("user", "alice").WithEllipses(), NoObjectFilter()) require.NoError(err) @@ -73,8 +65,6 @@ func TestSelfIterator(t *testing.T) { }) t.Run("IterSubjects", func(t *testing.T) { - t.Parallel() - selfIt := NewSelfIterator("view", "user") pathSeq, err := ctx.IterSubjects(selfIt, NewObject("user", "alice"), NoObjectFilter()) require.NoError(err) @@ -94,8 +84,6 @@ func TestSelfIterator(t *testing.T) { } func TestSelfIteratorClone(t *testing.T) { - t.Parallel() - require := require.New(t) original := NewSelfIterator("original_relation", "user") @@ -115,8 +103,6 @@ func TestSelfIteratorClone(t *testing.T) { } func TestSelfIteratorExplain(t *testing.T) { - t.Parallel() - require := require.New(t) aliasIt := NewSelfIterator("some_relation", "user") @@ -127,10 +113,7 @@ func TestSelfIteratorExplain(t *testing.T) { } func TestSelf_Types(t *testing.T) { - t.Parallel() - t.Run("ResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) selfIt := NewSelfIterator("view", "user") @@ -142,7 +125,6 @@ func TestSelf_Types(t *testing.T) { }) t.Run("SubjectTypes", func(t *testing.T) { - t.Parallel() require := require.New(t) selfIt := NewSelfIterator("view", "user") @@ -154,7 +136,6 @@ func TestSelf_Types(t *testing.T) { }) t.Run("SubjectTypes_SameAsResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) selfIt := NewSelfIterator("edit", "document") diff --git a/pkg/query/simplify_caveat_test.go b/pkg/query/simplify_caveat_test.go index 15267c890..86b1b80b2 100644 --- a/pkg/query/simplify_caveat_test.go +++ b/pkg/query/simplify_caveat_test.go @@ -889,7 +889,6 @@ func mustToStruct(t *testing.T, data map[string]any) *structpb.Struct { // Additional tests for uncovered functions in simplify_caveat.go func TestMergeContextsForExpression(t *testing.T) { - t.Parallel() require := require.New(t) // Test merging contexts for complex expressions @@ -899,7 +898,6 @@ func TestMergeContextsForExpression(t *testing.T) { } t.Run("Simple caveat expression", func(t *testing.T) { - t.Parallel() // Create a simple caveat with relationship context caveatExpr := &core.CaveatExpression{ OperationOrCaveat: &core.CaveatExpression_Caveat{ @@ -923,7 +921,6 @@ func TestMergeContextsForExpression(t *testing.T) { }) t.Run("Complex AND expression", func(t *testing.T) { - t.Parallel() // Create AND expression with multiple caveats child1 := &core.CaveatExpression{ OperationOrCaveat: &core.CaveatExpression_Caveat{ @@ -962,7 +959,6 @@ func TestMergeContextsForExpression(t *testing.T) { }) t.Run("Query context overrides relationship context", func(t *testing.T) { - t.Parallel() // Test that query context takes precedence over relationship context caveatExpr := &core.CaveatExpression{ OperationOrCaveat: &core.CaveatExpression_Caveat{ @@ -983,7 +979,6 @@ func TestMergeContextsForExpression(t *testing.T) { }) t.Run("Empty expression", func(t *testing.T) { - t.Parallel() result := mergeContextsForExpression(nil, queryContext) // Should only have query context @@ -994,18 +989,15 @@ func TestMergeContextsForExpression(t *testing.T) { } func TestCollectRelationshipContexts(t *testing.T) { - t.Parallel() require := require.New(t) t.Run("Nil expression", func(t *testing.T) { - t.Parallel() contextMap := make(map[string]any) collectRelationshipContexts(nil, contextMap) require.Empty(contextMap) }) t.Run("Simple caveat", func(t *testing.T) { - t.Parallel() caveatExpr := &core.CaveatExpression{ OperationOrCaveat: &core.CaveatExpression_Caveat{ Caveat: &core.ContextualizedCaveat{ @@ -1024,7 +1016,6 @@ func TestCollectRelationshipContexts(t *testing.T) { }) t.Run("Caveat without context", func(t *testing.T) { - t.Parallel() caveatExpr := &core.CaveatExpression{ OperationOrCaveat: &core.CaveatExpression_Caveat{ Caveat: &core.ContextualizedCaveat{ @@ -1041,7 +1032,6 @@ func TestCollectRelationshipContexts(t *testing.T) { }) t.Run("AND operation with multiple caveats", func(t *testing.T) { - t.Parallel() child1 := &core.CaveatExpression{ OperationOrCaveat: &core.CaveatExpression_Caveat{ Caveat: &core.ContextualizedCaveat{ @@ -1077,7 +1067,6 @@ func TestCollectRelationshipContexts(t *testing.T) { }) t.Run("Nested operations", func(t *testing.T) { - t.Parallel() // Create OR( AND(caveat1, caveat2), caveat3 ) innerChild1 := &core.CaveatExpression{ OperationOrCaveat: &core.CaveatExpression_Caveat{ @@ -1131,7 +1120,6 @@ func TestCollectRelationshipContexts(t *testing.T) { }) t.Run("Operation without children", func(t *testing.T) { - t.Parallel() emptyOp := &core.CaveatExpression{ OperationOrCaveat: &core.CaveatExpression_Operation{ Operation: &core.CaveatOperation{ @@ -1238,7 +1226,6 @@ func TestSimplifyWithEmptyContext(t *testing.T) { } func TestSimplifyNotConditional(t *testing.T) { - t.Parallel() ctx := context.Background() require := require.New(t) diff --git a/pkg/query/union_test.go b/pkg/query/union_test.go index 3e7064780..4aad50ae3 100644 --- a/pkg/query/union_test.go +++ b/pkg/query/union_test.go @@ -10,16 +10,12 @@ import ( ) func TestUnionIterator(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context ctx := NewLocalContext(t.Context()) t.Run("Check_Union", func(t *testing.T) { - t.Parallel() - // Add different iterators with distinct data sets documentAccess := NewDocumentAccessFixedIterator() multiRole := NewMultiRoleFixedIterator() @@ -52,8 +48,6 @@ func TestUnionIterator(t *testing.T) { }) t.Run("Check_EmptyUnion", func(t *testing.T) { - t.Parallel() - union := NewUnionIterator() // Empty union should return empty results @@ -66,8 +60,6 @@ func TestUnionIterator(t *testing.T) { }) t.Run("Check_SingleSubIterator", func(t *testing.T) { - t.Parallel() - documentAccess := NewDocumentAccessFixedIterator() union := NewUnionIterator(documentAccess) @@ -86,8 +78,6 @@ func TestUnionIterator(t *testing.T) { }) t.Run("Check_EmptyResourceList", func(t *testing.T) { - t.Parallel() - documentAccess := NewDocumentAccessFixedIterator() union := NewUnionIterator(documentAccess) @@ -100,8 +90,6 @@ func TestUnionIterator(t *testing.T) { }) t.Run("Check_EarlyTermination", func(t *testing.T) { - t.Parallel() - // Add iterators that might find the same resource documentAccess := NewDocumentAccessFixedIterator() singleUser := NewSingleUserFixedIterator("alice") @@ -121,8 +109,6 @@ func TestUnionIterator(t *testing.T) { }) t.Run("Check_NoMatchingSubject", func(t *testing.T) { - t.Parallel() - documentAccess := NewDocumentAccessFixedIterator() union := NewUnionIterator(documentAccess) @@ -136,8 +122,6 @@ func TestUnionIterator(t *testing.T) { }) t.Run("IterSubjects", func(t *testing.T) { - t.Parallel() - // Add test iterators documentAccess := NewDocumentAccessFixedIterator() multiRole := NewMultiRoleFixedIterator() @@ -165,8 +149,6 @@ func TestUnionIterator(t *testing.T) { }) t.Run("IterResources", func(t *testing.T) { - t.Parallel() - // Add test iterators documentAccess := NewDocumentAccessFixedIterator() multiRole := NewMultiRoleFixedIterator() @@ -194,8 +176,6 @@ func TestUnionIterator(t *testing.T) { } func TestUnionIteratorClone(t *testing.T) { - t.Parallel() - require := require.New(t) // Use non-overlapping helper iterators to avoid union optimization issues @@ -226,13 +206,9 @@ func TestUnionIteratorClone(t *testing.T) { } func TestUnionIteratorExplain(t *testing.T) { - t.Parallel() - require := require.New(t) t.Run("EmptyUnion", func(t *testing.T) { - t.Parallel() - // NewUnionIterator() with no args returns empty FixedIterator (canonical form) union := NewUnionIterator() _, isFixed := union.(*FixedIterator) @@ -244,8 +220,6 @@ func TestUnionIteratorExplain(t *testing.T) { }) t.Run("UnionWithSubIterators", func(t *testing.T) { - t.Parallel() - documentAccess := NewDocumentAccessFixedIterator() multiRole := NewMultiRoleFixedIterator() @@ -262,8 +236,6 @@ func TestUnionIteratorExplain(t *testing.T) { } func TestUnionIteratorDuplicateElimination(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context @@ -294,8 +266,6 @@ func TestUnionIteratorDuplicateElimination(t *testing.T) { } func TestUnionIteratorMultipleResources(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context @@ -318,15 +288,11 @@ func TestUnionIteratorMultipleResources(t *testing.T) { } func TestUnionDeduplicationBugFix(t *testing.T) { - t.Parallel() - require := require.New(t) ctx := NewLocalContext(t.Context()) t.Run("DeduplicatesByResourceKey", func(t *testing.T) { - t.Parallel() - // Create relations that would create duplicates under the old string-based deduplication // but should be properly deduplicated by resource key (type + id) path1 := MustPathFromString("document:doc1#viewer@user:alice") @@ -351,8 +317,6 @@ func TestUnionDeduplicationBugFix(t *testing.T) { }) t.Run("PreferNoCaveatRelations", func(t *testing.T) { - t.Parallel() - // Create path without caveat pathNoCaveat := MustPathFromString("document:doc1#viewer@user:alice") @@ -368,8 +332,6 @@ func TestUnionDeduplicationBugFix(t *testing.T) { // Test both orders to ensure preference is consistent t.Run("NoCaveatFirst", func(t *testing.T) { - t.Parallel() - iter1 := NewFixedIterator(pathNoCaveat) iter2 := NewFixedIterator(pathWithCaveat) @@ -386,8 +348,6 @@ func TestUnionDeduplicationBugFix(t *testing.T) { }) t.Run("CaveatFirst", func(t *testing.T) { - t.Parallel() - iter1 := NewFixedIterator(pathWithCaveat) iter2 := NewFixedIterator(pathNoCaveat) @@ -405,8 +365,6 @@ func TestUnionDeduplicationBugFix(t *testing.T) { }) t.Run("DeduplicationWithDifferentResources", func(t *testing.T) { - t.Parallel() - // Relations to different resources should not be deduplicated pathDoc1 := MustPathFromString("document:doc1#viewer@user:alice") pathDoc2 := MustPathFromString("document:doc2#viewer@user:alice") @@ -431,8 +389,6 @@ func TestUnionDeduplicationBugFix(t *testing.T) { }) t.Run("DeduplicationSameResourceDifferentRelations", func(t *testing.T) { - t.Parallel() - // Relations with different relation names on the same resource should be deduplicated // because the fix deduplicates by resource (type + id), not by full relation pathViewer := MustPathFromString("document:doc1#viewer@user:alice") @@ -457,16 +413,12 @@ func TestUnionDeduplicationBugFix(t *testing.T) { } func TestUnionIteratorCaveatCombination(t *testing.T) { - t.Parallel() - require := require.New(t) // Create test context ctx := NewLocalContext(t.Context()) t.Run("CombineTwoCaveats_OR_Logic", func(t *testing.T) { - t.Parallel() - // Both paths have different caveats - should combine with OR logic pathWithCaveat1 := MustPathFromString("document:doc1#viewer@user:alice") pathWithCaveat1.Caveat = &core.CaveatExpression{ @@ -506,8 +458,6 @@ func TestUnionIteratorCaveatCombination(t *testing.T) { }) t.Run("NoCaveat_Wins_Over_Caveat", func(t *testing.T) { - t.Parallel() - // One path has no caveat, one has caveat - no caveat should win pathNoCaveat := MustPathFromString("document:doc1#viewer@user:alice") @@ -536,8 +486,6 @@ func TestUnionIteratorCaveatCombination(t *testing.T) { }) t.Run("Different_Resources_Not_Combined", func(t *testing.T) { - t.Parallel() - // Paths to different resources should not be combined pathDoc1 := MustPathFromString("document:doc1#viewer@user:alice") pathDoc1.Caveat = &core.CaveatExpression{ @@ -583,8 +531,6 @@ func TestUnionIteratorCaveatCombination(t *testing.T) { }) t.Run("Three_Relations_Same_Resource_Mixed_Caveats", func(t *testing.T) { - t.Parallel() - // Mix of paths: no caveat, caveat1, caveat2 - no caveat should win pathNoCaveat := MustPathFromString("document:doc1#viewer@user:alice") @@ -624,8 +570,6 @@ func TestUnionIteratorCaveatCombination(t *testing.T) { } func TestUnionIterSubjectsDeduplication(t *testing.T) { - t.Parallel() - require := require.New(t) ctx := &Context{ @@ -634,8 +578,6 @@ func TestUnionIterSubjectsDeduplication(t *testing.T) { } t.Run("DeduplicateSubjects", func(t *testing.T) { - t.Parallel() - // Create paths with same subject appearing in multiple iterators path1 := MustPathFromString("document:doc1#viewer@user:alice") path2 := MustPathFromString("document:doc1#viewer@user:alice") @@ -657,8 +599,6 @@ func TestUnionIterSubjectsDeduplication(t *testing.T) { }) t.Run("EmptyUnion", func(t *testing.T) { - t.Parallel() - union := NewUnionIterator() pathSeq, err := ctx.IterSubjects(union, NewObject("document", "doc1"), NoObjectFilter()) @@ -671,8 +611,6 @@ func TestUnionIterSubjectsDeduplication(t *testing.T) { }) t.Run("MultipleSubjects", func(t *testing.T) { - t.Parallel() - // Create paths with different subjects pathAlice := MustPathFromString("document:doc1#viewer@user:alice") pathBob := MustPathFromString("document:doc1#viewer@user:bob") @@ -703,8 +641,6 @@ func TestUnionIterSubjectsDeduplication(t *testing.T) { } func TestUnionIterResourcesDeduplication(t *testing.T) { - t.Parallel() - require := require.New(t) ctx := &Context{ @@ -713,8 +649,6 @@ func TestUnionIterResourcesDeduplication(t *testing.T) { } t.Run("DeduplicateResources", func(t *testing.T) { - t.Parallel() - // Create paths with same resource appearing in multiple iterators path1 := MustPathFromString("document:doc1#viewer@user:alice") path2 := MustPathFromString("document:doc1#editor@user:alice") @@ -736,8 +670,6 @@ func TestUnionIterResourcesDeduplication(t *testing.T) { }) t.Run("EmptyUnion", func(t *testing.T) { - t.Parallel() - union := NewUnionIterator() pathSeq, err := ctx.IterResources(union, NewObject("user", "alice").WithEllipses(), NoObjectFilter()) @@ -750,8 +682,6 @@ func TestUnionIterResourcesDeduplication(t *testing.T) { }) t.Run("MultipleResources", func(t *testing.T) { - t.Parallel() - // Create paths with different resources pathDoc1 := MustPathFromString("document:doc1#viewer@user:alice") pathDoc2 := MustPathFromString("document:doc2#viewer@user:alice") @@ -782,10 +712,7 @@ func TestUnionIterResourcesDeduplication(t *testing.T) { } func TestUnion_Types(t *testing.T) { - t.Parallel() - t.Run("ResourceType", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create union with fixed iterators @@ -803,7 +730,6 @@ func TestUnion_Types(t *testing.T) { }) t.Run("ResourceType_EmptyUnion", func(t *testing.T) { - t.Parallel() require := require.New(t) union := NewUnionIterator() @@ -814,7 +740,6 @@ func TestUnion_Types(t *testing.T) { }) t.Run("SubjectTypes", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create union with different subject types across iterators @@ -841,7 +766,6 @@ func TestUnion_Types(t *testing.T) { }) t.Run("SubjectTypes_Deduplication", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create union where multiple iterators have same subject types @@ -859,7 +783,6 @@ func TestUnion_Types(t *testing.T) { }) t.Run("SubjectTypes_EmptyUnion", func(t *testing.T) { - t.Parallel() require := require.New(t) union := NewUnionIterator() @@ -870,7 +793,6 @@ func TestUnion_Types(t *testing.T) { }) t.Run("ResourceType_Mismatch", func(t *testing.T) { - t.Parallel() require := require.New(t) // Create union with mismatched resource types diff --git a/pkg/query/wildcard_multirelation_test.go b/pkg/query/wildcard_multirelation_test.go index d67baaaa0..d719fd441 100644 --- a/pkg/query/wildcard_multirelation_test.go +++ b/pkg/query/wildcard_multirelation_test.go @@ -23,8 +23,6 @@ import ( // the wildcard branch should only enumerate subjects from its own relation, not // from other relations on the same resource. func TestIterSubjectsWildcardWithMultipleRelations(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -74,7 +72,6 @@ func TestIterSubjectsWildcardWithMultipleRelations(t *testing.T) { // Test the wildcard branch for viewer t.Run("WildcardBranchEnumeratesAllDefinedSubjects", func(t *testing.T) { - t.Parallel() // The wildcard branch should enumerate ALL subjects of the appropriate type that are // defined in the datastore, not just those with a relationship to this specific resource. // This is the intended behavior: when a wildcard (e.g., user:*) exists on a relation, @@ -106,7 +103,6 @@ func TestIterSubjectsWildcardWithMultipleRelations(t *testing.T) { // Test the Union (combined behavior) - this is what happens in the actual query plan t.Run("UnionDeduplicatesSubjects", func(t *testing.T) { - t.Parallel() // The Union of both branches should return all subjects with deduplication union := NewUnionIterator( NewDatastoreIterator(viewerRel.BaseRelations()[0]), // user (non-wildcard) diff --git a/pkg/query/wildcard_subjects_test.go b/pkg/query/wildcard_subjects_test.go index e0affd25e..a7c282d6f 100644 --- a/pkg/query/wildcard_subjects_test.go +++ b/pkg/query/wildcard_subjects_test.go @@ -20,8 +20,6 @@ import ( // TestIterSubjectsWithWildcard tests that wildcards are properly filtered and expanded func TestIterSubjectsWithWildcard(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -68,7 +66,6 @@ func TestIterSubjectsWithWildcard(t *testing.T) { // Test the non-wildcard branch (user) t.Run("NonWildcardBranch", func(t *testing.T) { - t.Parallel() // The non-wildcard branch should only return concrete subjects, filtering out wildcards nonWildcardBranch := NewDatastoreIterator(viewerRel.BaseRelations()[0]) // user (non-wildcard) @@ -87,7 +84,6 @@ func TestIterSubjectsWithWildcard(t *testing.T) { // Test the wildcard branch (user:*) t.Run("WildcardBranch", func(t *testing.T) { - t.Parallel() // The wildcard branch should enumerate concrete subjects when a wildcard exists wildcardBranch := NewDatastoreIterator(viewerRel.BaseRelations()[1]) // user:* (wildcard) @@ -106,7 +102,6 @@ func TestIterSubjectsWithWildcard(t *testing.T) { // Test the Union (combined behavior) t.Run("UnionDeduplication", func(t *testing.T) { - t.Parallel() // The Union of both branches should deduplicate the concrete user union := NewUnionIterator( NewDatastoreIterator(viewerRel.BaseRelations()[0]), // user @@ -130,8 +125,6 @@ func TestIterSubjectsWithWildcard(t *testing.T) { // TestIterSubjectsWildcardWithoutWildcardRelationship tests that the wildcard branch // returns empty when no wildcard relationship exists func TestIterSubjectsWildcardWithoutWildcardRelationship(t *testing.T) { - t.Parallel() - require := require.New(t) rawDS, err := dsfortesting.NewMemDBDatastoreForTesting(t, 0, 0, memdb.DisableGC) require.NoError(err) @@ -176,7 +169,6 @@ func TestIterSubjectsWildcardWithoutWildcardRelationship(t *testing.T) { // Test the wildcard branch when no wildcard relationship exists t.Run("WildcardBranchWithoutWildcard", func(t *testing.T) { - t.Parallel() // The wildcard branch should return empty because there's no wildcard relationship wildcardBranch := NewDatastoreIterator(viewerRel.BaseRelations()[1]) // user:* (wildcard) @@ -193,7 +185,6 @@ func TestIterSubjectsWildcardWithoutWildcardRelationship(t *testing.T) { // Test the non-wildcard branch still works t.Run("NonWildcardBranchWorksNormally", func(t *testing.T) { - t.Parallel() nonWildcardBranch := NewDatastoreIterator(viewerRel.BaseRelations()[0]) // user (non-wildcard) queryCtx := NewLocalContext(ctx, WithReader(datalayer.NewDataLayer(rawDS).SnapshotReader(revision))) diff --git a/pkg/schema/arrows_test.go b/pkg/schema/arrows_test.go index bba6a28a3..eecb95df5 100644 --- a/pkg/schema/arrows_test.go +++ b/pkg/schema/arrows_test.go @@ -10,8 +10,6 @@ import ( ) func TestLookupTuplesetArrows(t *testing.T) { - t.Parallel() - type testcase struct { name string schemaText string @@ -119,7 +117,6 @@ func TestLookupTuplesetArrows(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() schema, err := compiler.Compile(compiler.InputSchema{ Source: "", @@ -152,8 +149,6 @@ func TestLookupTuplesetArrows(t *testing.T) { } func TestAllReachableRelations(t *testing.T) { - t.Parallel() - type testcase struct { name string schemaText string @@ -251,7 +246,6 @@ func TestAllReachableRelations(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() schema, err := compiler.Compile(compiler.InputSchema{ Source: "", @@ -273,8 +267,6 @@ func TestAllReachableRelations(t *testing.T) { } func TestLookupArrowsWithComputedUserset(t *testing.T) { - t.Parallel() - type expectedArrow struct { parentNamespace string parentRelation string @@ -512,7 +504,6 @@ func TestLookupArrowsWithComputedUserset(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() schema, err := compiler.Compile(compiler.InputSchema{ Source: "", diff --git a/pkg/schema/full_reachability_test.go b/pkg/schema/full_reachability_test.go index 6f093ec0a..0a34af12f 100644 --- a/pkg/schema/full_reachability_test.go +++ b/pkg/schema/full_reachability_test.go @@ -22,8 +22,6 @@ type testcase struct { } func TestRelationsReferencing(t *testing.T) { - t.Parallel() - tcs := []testcase{ { name: "basic", @@ -351,7 +349,6 @@ func TestRelationsReferencing(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() schema, err := compiler.Compile(compiler.InputSchema{ Source: "", diff --git a/pkg/schema/type_check_test.go b/pkg/schema/type_check_test.go index 6a93fe56e..861ac9384 100644 --- a/pkg/schema/type_check_test.go +++ b/pkg/schema/type_check_test.go @@ -10,7 +10,6 @@ import ( ) func TestTypecheckingJustTypes(t *testing.T) { - t.Parallel() type testcase struct { name string schemaText string @@ -204,7 +203,6 @@ func TestTypecheckingJustTypes(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() schema, err := compiler.Compile(compiler.InputSchema{ Source: "", @@ -235,7 +233,6 @@ func TestTypecheckingJustTypes(t *testing.T) { // TODO(jschorr): Add to the consistency tests as well, to validate the full set of types within the consistency tests. func TestTypecheckingWithSubrelations(t *testing.T) { - t.Parallel() type testcase struct { name string schemaText string @@ -387,7 +384,6 @@ func TestTypecheckingWithSubrelations(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() schema, err := compiler.Compile(compiler.InputSchema{ Source: "", @@ -417,7 +413,6 @@ func TestTypecheckingWithSubrelations(t *testing.T) { } func TestTypeAnnotationsValidation(t *testing.T) { - t.Parallel() type testcase struct { name string schemaText string @@ -495,7 +490,6 @@ func TestTypeAnnotationsValidation(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() schema, err := compiler.Compile(compiler.InputSchema{ Source: "", @@ -536,7 +530,6 @@ func TestTypeAnnotationsValidation(t *testing.T) { func TestIncompleteSchema(t *testing.T) { // This test is a little redundant, as doing this type checking requires one to have the full schema, but it _may_ be pulled dynamically and fail. // So until we operate in complete schema caching, there are fail points that can bubble up. - t.Parallel() type testcase struct { name string schemaText string @@ -562,7 +555,6 @@ func TestIncompleteSchema(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() schema, err := compiler.Compile(compiler.InputSchema{ Source: "", diff --git a/pkg/schema/v2/convert_test.go b/pkg/schema/v2/convert_test.go index 22680b52c..28f437ea5 100644 --- a/pkg/schema/v2/convert_test.go +++ b/pkg/schema/v2/convert_test.go @@ -11,10 +11,7 @@ import ( ) func TestConvertDefinitionEdgeCases(t *testing.T) { - t.Parallel() - t.Run("definition with nil relation", func(t *testing.T) { - t.Parallel() def := &corev1.NamespaceDefinition{ Name: "test", Relation: []*corev1.Relation{ @@ -30,7 +27,6 @@ func TestConvertDefinitionEdgeCases(t *testing.T) { }) t.Run("definition with relation having both userset and typeinfo", func(t *testing.T) { - t.Parallel() // This should prioritize userset rewrite over type information def := &corev1.NamespaceDefinition{ Name: "test", @@ -70,17 +66,13 @@ func TestConvertDefinitionEdgeCases(t *testing.T) { } func TestConvertUsersetEdgeCases(t *testing.T) { - t.Parallel() - t.Run("nil userset", func(t *testing.T) { - t.Parallel() _, err := convertUserset(nil) require.Error(t, err) require.Contains(t, err.Error(), "userset rewrite is nil") }) t.Run("unknown rewrite operation", func(t *testing.T) { - t.Parallel() userset := &corev1.UsersetRewrite{ // No rewrite operation set } @@ -92,17 +84,13 @@ func TestConvertUsersetEdgeCases(t *testing.T) { } func TestConvertTypeInformationEdgeCases(t *testing.T) { - t.Parallel() - t.Run("nil type information", func(t *testing.T) { - t.Parallel() _, err := convertTypeInformation(nil) require.Error(t, err) require.Contains(t, err.Error(), "type information is nil") }) t.Run("type information with caveat and expiration", func(t *testing.T) { - t.Parallel() typeinfo := &corev1.TypeInformation{ AllowedDirectRelations: []*corev1.AllowedRelation{ { @@ -126,7 +114,6 @@ func TestConvertTypeInformationEdgeCases(t *testing.T) { }) t.Run("type information with empty relation name", func(t *testing.T) { - t.Parallel() typeinfo := &corev1.TypeInformation{ AllowedDirectRelations: []*corev1.AllowedRelation{ { @@ -146,7 +133,6 @@ func TestConvertTypeInformationEdgeCases(t *testing.T) { }) t.Run("type information with ellipsis relation", func(t *testing.T) { - t.Parallel() typeinfo := &corev1.TypeInformation{ AllowedDirectRelations: []*corev1.AllowedRelation{ { @@ -166,7 +152,6 @@ func TestConvertTypeInformationEdgeCases(t *testing.T) { }) t.Run("type information with specific subrelation", func(t *testing.T) { - t.Parallel() typeinfo := &corev1.TypeInformation{ AllowedDirectRelations: []*corev1.AllowedRelation{ { @@ -187,17 +172,13 @@ func TestConvertTypeInformationEdgeCases(t *testing.T) { } func TestConvertSetOperationEdgeCases(t *testing.T) { - t.Parallel() - t.Run("nil set operation", func(t *testing.T) { - t.Parallel() _, err := convertSetOperation(nil) require.Error(t, err) require.Contains(t, err.Error(), "set operation is nil") }) t.Run("empty set operation", func(t *testing.T) { - t.Parallel() setOp := &corev1.SetOperation{ Child: []*corev1.SetOperation_Child{}, } @@ -212,7 +193,6 @@ func TestConvertSetOperationEdgeCases(t *testing.T) { }) t.Run("single child optimization", func(t *testing.T) { - t.Parallel() setOp := &corev1.SetOperation{ Child: []*corev1.SetOperation_Child{ { @@ -232,17 +212,13 @@ func TestConvertSetOperationEdgeCases(t *testing.T) { } func TestConvertSetOperationAsIntersectionEdgeCases(t *testing.T) { - t.Parallel() - t.Run("nil set operation", func(t *testing.T) { - t.Parallel() _, err := convertSetOperationAsIntersection(nil) require.Error(t, err) require.Contains(t, err.Error(), "set operation is nil") }) t.Run("single child optimization", func(t *testing.T) { - t.Parallel() setOp := &corev1.SetOperation{ Child: []*corev1.SetOperation_Child{ { @@ -262,19 +238,14 @@ func TestConvertSetOperationAsIntersectionEdgeCases(t *testing.T) { } func TestConvertSetOperationAsExclusionEdgeCases(t *testing.T) { - t.Parallel() - t.Run("nil set operation", func(t *testing.T) { - t.Parallel() _, err := convertSetOperationAsExclusion(nil) require.Error(t, err) require.Contains(t, err.Error(), "set operation is nil") }) t.Run("wrong number of children", func(t *testing.T) { - t.Parallel() t.Run("no children", func(t *testing.T) { - t.Parallel() setOp := &corev1.SetOperation{ Child: []*corev1.SetOperation_Child{}, } @@ -285,7 +256,6 @@ func TestConvertSetOperationAsExclusionEdgeCases(t *testing.T) { }) t.Run("one child", func(t *testing.T) { - t.Parallel() setOp := &corev1.SetOperation{ Child: []*corev1.SetOperation_Child{ { @@ -300,7 +270,6 @@ func TestConvertSetOperationAsExclusionEdgeCases(t *testing.T) { }) t.Run("three children", func(t *testing.T) { - t.Parallel() setOp := &corev1.SetOperation{ Child: []*corev1.SetOperation_Child{ { @@ -322,7 +291,6 @@ func TestConvertSetOperationAsExclusionEdgeCases(t *testing.T) { }) t.Run("valid exclusion", func(t *testing.T) { - t.Parallel() setOp := &corev1.SetOperation{ Child: []*corev1.SetOperation_Child{ { @@ -359,17 +327,13 @@ func TestConvertSetOperationAsExclusionEdgeCases(t *testing.T) { } func TestConvertChildEdgeCases(t *testing.T) { - t.Parallel() - t.Run("nil child", func(t *testing.T) { - t.Parallel() _, err := convertChild(nil) require.Error(t, err) require.Contains(t, err.Error(), "child is nil") }) t.Run("XThis child", func(t *testing.T) { - t.Parallel() child := &corev1.SetOperation_Child{ ChildType: &corev1.SetOperation_Child_XThis{}, } @@ -383,7 +347,6 @@ func TestConvertChildEdgeCases(t *testing.T) { }) t.Run("ComputedUserset child", func(t *testing.T) { - t.Parallel() child := &corev1.SetOperation_Child{ ChildType: &corev1.SetOperation_Child_ComputedUserset{ ComputedUserset: &corev1.ComputedUserset{ @@ -401,7 +364,6 @@ func TestConvertChildEdgeCases(t *testing.T) { }) t.Run("UsersetRewrite child", func(t *testing.T) { - t.Parallel() child := &corev1.SetOperation_Child{ ChildType: &corev1.SetOperation_Child_UsersetRewrite{ UsersetRewrite: &corev1.UsersetRewrite{ @@ -428,7 +390,6 @@ func TestConvertChildEdgeCases(t *testing.T) { }) t.Run("TupleToUserset child", func(t *testing.T) { - t.Parallel() child := &corev1.SetOperation_Child{ ChildType: &corev1.SetOperation_Child_TupleToUserset{ TupleToUserset: &corev1.TupleToUserset{ @@ -452,7 +413,6 @@ func TestConvertChildEdgeCases(t *testing.T) { }) t.Run("XNil child", func(t *testing.T) { - t.Parallel() child := &corev1.SetOperation_Child{ ChildType: &corev1.SetOperation_Child_XNil{}, } @@ -466,7 +426,6 @@ func TestConvertChildEdgeCases(t *testing.T) { }) t.Run("unknown child type", func(t *testing.T) { - t.Parallel() child := &corev1.SetOperation_Child{ // No ChildType set } @@ -478,10 +437,7 @@ func TestConvertChildEdgeCases(t *testing.T) { } func TestConvertCaveatEdgeCases(t *testing.T) { - t.Parallel() - t.Run("caveat with empty parameter types", func(t *testing.T) { - t.Parallel() def := &corev1.CaveatDefinition{ Name: "test_caveat", SerializedExpression: []byte("test expression"), @@ -496,7 +452,6 @@ func TestConvertCaveatEdgeCases(t *testing.T) { }) t.Run("caveat with multiple parameter types", func(t *testing.T) { - t.Parallel() def := &corev1.CaveatDefinition{ Name: "complex_caveat", SerializedExpression: []byte("complex expression"), @@ -525,10 +480,7 @@ func TestConvertCaveatEdgeCases(t *testing.T) { } func TestConvertChildWithNestedOperations(t *testing.T) { - t.Parallel() - t.Run("nested union in userset rewrite", func(t *testing.T) { - t.Parallel() child := &corev1.SetOperation_Child{ ChildType: &corev1.SetOperation_Child_UsersetRewrite{ UsersetRewrite: &corev1.UsersetRewrite{ @@ -573,7 +525,6 @@ func TestConvertChildWithNestedOperations(t *testing.T) { }) t.Run("nested intersection in userset rewrite", func(t *testing.T) { - t.Parallel() child := &corev1.SetOperation_Child{ ChildType: &corev1.SetOperation_Child_UsersetRewrite{ UsersetRewrite: &corev1.UsersetRewrite{ @@ -610,7 +561,6 @@ func TestConvertChildWithNestedOperations(t *testing.T) { }) t.Run("error in nested userset rewrite", func(t *testing.T) { - t.Parallel() child := &corev1.SetOperation_Child{ ChildType: &corev1.SetOperation_Child_UsersetRewrite{ UsersetRewrite: nil, // This should cause an error @@ -624,11 +574,7 @@ func TestConvertChildWithNestedOperations(t *testing.T) { } func TestConvertFunctionedTupleToUserset(t *testing.T) { - t.Parallel() - t.Run("convert FUNCTION_ANY", func(t *testing.T) { - t.Parallel() - child := &corev1.SetOperation_Child{ ChildType: &corev1.SetOperation_Child_FunctionedTupleToUserset{ FunctionedTupleToUserset: &corev1.FunctionedTupleToUserset{ @@ -654,8 +600,6 @@ func TestConvertFunctionedTupleToUserset(t *testing.T) { }) t.Run("convert FUNCTION_ALL", func(t *testing.T) { - t.Parallel() - child := &corev1.SetOperation_Child{ ChildType: &corev1.SetOperation_Child_FunctionedTupleToUserset{ FunctionedTupleToUserset: &corev1.FunctionedTupleToUserset{ @@ -681,8 +625,6 @@ func TestConvertFunctionedTupleToUserset(t *testing.T) { }) t.Run("convert unknown function type", func(t *testing.T) { - t.Parallel() - child := &corev1.SetOperation_Child{ ChildType: &corev1.SetOperation_Child_FunctionedTupleToUserset{ FunctionedTupleToUserset: &corev1.FunctionedTupleToUserset{ @@ -703,8 +645,6 @@ func TestConvertFunctionedTupleToUserset(t *testing.T) { }) t.Run("full definition with functioned tupleset", func(t *testing.T) { - t.Parallel() - def := &corev1.NamespaceDefinition{ Name: "document", Relation: []*corev1.Relation{ @@ -790,8 +730,6 @@ func TestConvertFunctionedTupleToUserset(t *testing.T) { } func TestConvertFunctionType(t *testing.T) { - t.Parallel() - tests := []struct { name string input corev1.FunctionedTupleToUserset_Function @@ -820,8 +758,6 @@ func TestConvertFunctionType(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - t.Parallel() - result, err := convertFunctionType(tt.input) if tt.wantErr { require.Error(t, err) @@ -835,11 +771,7 @@ func TestConvertFunctionType(t *testing.T) { } func TestMetadataPreservation(t *testing.T) { - t.Parallel() - t.Run("namespace definition metadata with doc comments is preserved", func(t *testing.T) { - t.Parallel() - // Create doc comment metadata docComment := &implv1.DocComment{ Comment: "This is a test resource", @@ -899,8 +831,6 @@ func TestMetadataPreservation(t *testing.T) { }) t.Run("caveat definition metadata with doc comments is preserved", func(t *testing.T) { - t.Parallel() - // Create doc comment metadata docComment := &implv1.DocComment{ Comment: "This is a test caveat", @@ -950,8 +880,6 @@ func TestMetadataPreservation(t *testing.T) { }) t.Run("relation metadata with doc comments and relation kind is preserved", func(t *testing.T) { - t.Parallel() - // Create doc comment metadata docComment := &implv1.DocComment{ Comment: "This is a viewer relation", @@ -1035,8 +963,6 @@ func TestMetadataPreservation(t *testing.T) { }) t.Run("permission metadata with type annotations is preserved", func(t *testing.T) { - t.Parallel() - // Create permission metadata with type annotations permissionMetadata := &implv1.RelationMetadata{ Kind: implv1.RelationMetadata_PERMISSION, @@ -1105,11 +1031,7 @@ func TestMetadataPreservation(t *testing.T) { // TestConvertOperationParentPointers verifies that parent pointers are correctly set // when operations are converted from proto definitions. func TestConvertOperationParentPointers(t *testing.T) { - t.Parallel() - t.Run("comprehensive parent pointer verification", func(t *testing.T) { - t.Parallel() - // Create a comprehensive proto definition that exercises all operation types and parent relationships def := &corev1.NamespaceDefinition{ Name: "document", @@ -1440,8 +1362,6 @@ func TestConvertOperationParentPointers(t *testing.T) { }) t.Run("deeply nested operations maintain parent chain", func(t *testing.T) { - t.Parallel() - // Create a deeply nested structure to verify the entire parent chain // Use 2 children at the root union to avoid single-child optimization def := &corev1.NamespaceDefinition{ @@ -1565,8 +1485,6 @@ func TestConvertOperationParentPointers(t *testing.T) { }) t.Run("single child optimization preserves parent pointers", func(t *testing.T) { - t.Parallel() - // Test that single-child optimization (unwrapping) still maintains parent pointers def := &corev1.NamespaceDefinition{ Name: "doc", diff --git a/pkg/schema/v2/operations_test.go b/pkg/schema/v2/operations_test.go index b2f0c25d3..fd9ff8db6 100644 --- a/pkg/schema/v2/operations_test.go +++ b/pkg/schema/v2/operations_test.go @@ -10,8 +10,6 @@ import ( // for all elements created during construction. This ensures that the entire schema hierarchy is // connected and can be traversed upward from any element. func TestBuilderSetsParentsCorrectly(t *testing.T) { - t.Parallel() - // Build a comprehensive schema using the fluent builder schema := NewSchemaBuilder(). AddDefinition("user"). diff --git a/pkg/schema/v2/schema_conversion_test.go b/pkg/schema/v2/schema_conversion_test.go index 92de0a50d..c0561f634 100644 --- a/pkg/schema/v2/schema_conversion_test.go +++ b/pkg/schema/v2/schema_conversion_test.go @@ -10,8 +10,6 @@ import ( ) func TestSchemaConversionFromCompiler(t *testing.T) { - t.Parallel() - type testcase struct { name string schemaText string @@ -238,7 +236,6 @@ func TestSchemaConversionFromCompiler(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() // Compile the schema using the existing compiler compiled, err := compiler.Compile(compiler.InputSchema{ @@ -343,8 +340,6 @@ func TestSchemaConversionFromCompiler(t *testing.T) { } func TestSchemaConversionEdgeCases(t *testing.T) { - t.Parallel() - type testcase struct { name string schemaText string @@ -388,7 +383,6 @@ func TestSchemaConversionEdgeCases(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() // Compile the schema compiled, err := compiler.Compile(compiler.InputSchema{ @@ -433,8 +427,6 @@ func TestSchemaConversionEdgeCases(t *testing.T) { } func TestSchemaConversionOperationTypes(t *testing.T) { - t.Parallel() - type testcase struct { name string schemaText string @@ -504,7 +496,6 @@ func TestSchemaConversionOperationTypes(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() // Compile and build schema compiled, err := compiler.Compile(compiler.InputSchema{ diff --git a/pkg/schema/v2/schema_test.go b/pkg/schema/v2/schema_test.go index d412b37a2..cfd7a9841 100644 --- a/pkg/schema/v2/schema_test.go +++ b/pkg/schema/v2/schema_test.go @@ -10,8 +10,6 @@ import ( ) func TestGetTypeDefinition(t *testing.T) { - t.Parallel() - schemaText := ` definition user {} @@ -36,7 +34,6 @@ func TestGetTypeDefinition(t *testing.T) { require.NoError(t, err) t.Run("existing type definition", func(t *testing.T) { - t.Parallel() def, ok := schema.GetTypeDefinition("user") require.True(t, ok) require.NotNil(t, def) @@ -44,7 +41,6 @@ func TestGetTypeDefinition(t *testing.T) { }) t.Run("another existing type definition", func(t *testing.T) { - t.Parallel() def, ok := schema.GetTypeDefinition("organization") require.True(t, ok) require.NotNil(t, def) @@ -52,14 +48,12 @@ func TestGetTypeDefinition(t *testing.T) { }) t.Run("non-existent type definition", func(t *testing.T) { - t.Parallel() def, ok := schema.GetTypeDefinition("nonexistent") require.False(t, ok) require.Nil(t, def) }) t.Run("empty string type definition", func(t *testing.T) { - t.Parallel() def, ok := schema.GetTypeDefinition("") require.False(t, ok) require.Nil(t, def) @@ -67,8 +61,6 @@ func TestGetTypeDefinition(t *testing.T) { } func TestGetRelation(t *testing.T) { - t.Parallel() - schemaText := ` definition user {} @@ -98,7 +90,6 @@ func TestGetRelation(t *testing.T) { require.NotNil(t, orgDef) t.Run("existing relation", func(t *testing.T) { - t.Parallel() rel, ok := orgDef.GetRelation("member") require.True(t, ok) require.NotNil(t, rel) @@ -106,7 +97,6 @@ func TestGetRelation(t *testing.T) { }) t.Run("another existing relation", func(t *testing.T) { - t.Parallel() rel, ok := orgDef.GetRelation("admin") require.True(t, ok) require.NotNil(t, rel) @@ -114,21 +104,18 @@ func TestGetRelation(t *testing.T) { }) t.Run("non-existent relation", func(t *testing.T) { - t.Parallel() rel, ok := orgDef.GetRelation("nonexistent") require.False(t, ok) require.Nil(t, rel) }) t.Run("empty string relation", func(t *testing.T) { - t.Parallel() rel, ok := orgDef.GetRelation("") require.False(t, ok) require.Nil(t, rel) }) t.Run("definition with no relations", func(t *testing.T) { - t.Parallel() userDef, ok := schema.GetTypeDefinition("user") require.True(t, ok) require.NotNil(t, userDef) @@ -140,8 +127,6 @@ func TestGetRelation(t *testing.T) { } func TestGetPermission(t *testing.T) { - t.Parallel() - schemaText := ` definition user {} @@ -172,7 +157,6 @@ func TestGetPermission(t *testing.T) { require.NotNil(t, resourceDef) t.Run("existing permission", func(t *testing.T) { - t.Parallel() perm, ok := resourceDef.GetPermission("view") require.True(t, ok) require.NotNil(t, perm) @@ -180,7 +164,6 @@ func TestGetPermission(t *testing.T) { }) t.Run("another existing permission", func(t *testing.T) { - t.Parallel() perm, ok := resourceDef.GetPermission("edit") require.True(t, ok) require.NotNil(t, perm) @@ -188,21 +171,18 @@ func TestGetPermission(t *testing.T) { }) t.Run("non-existent permission", func(t *testing.T) { - t.Parallel() perm, ok := resourceDef.GetPermission("nonexistent") require.False(t, ok) require.Nil(t, perm) }) t.Run("empty string permission", func(t *testing.T) { - t.Parallel() perm, ok := resourceDef.GetPermission("") require.False(t, ok) require.Nil(t, perm) }) t.Run("definition with no permissions", func(t *testing.T) { - t.Parallel() userDef, ok := schema.GetTypeDefinition("user") require.True(t, ok) require.NotNil(t, userDef) @@ -331,8 +311,6 @@ func TestFindParent_SkipIntermediateTypes(t *testing.T) { } func TestBaseRelationCompare(t *testing.T) { - t.Parallel() - getBase := func(t *testing.T, s *Schema, defName, relName string, idx int) *BaseRelation { t.Helper() def, ok := s.GetTypeDefinition(defName) @@ -343,13 +321,11 @@ func TestBaseRelationCompare(t *testing.T) { } t.Run("both nil", func(t *testing.T) { - t.Parallel() var a, b *BaseRelation require.Equal(t, 0, a.Compare(b)) }) t.Run("left nil", func(t *testing.T) { - t.Parallel() s := NewSchemaBuilder(). AddDefinition("user").Done(). AddDefinition("doc").AddRelation("viewer").AllowedDirectRelation("user").Done().Done(). @@ -360,7 +336,6 @@ func TestBaseRelationCompare(t *testing.T) { }) t.Run("right nil", func(t *testing.T) { - t.Parallel() s := NewSchemaBuilder(). AddDefinition("user").Done(). AddDefinition("doc").AddRelation("viewer").AllowedDirectRelation("user").Done().Done(). @@ -370,7 +345,6 @@ func TestBaseRelationCompare(t *testing.T) { }) t.Run("equal", func(t *testing.T) { - t.Parallel() s := NewSchemaBuilder(). AddDefinition("user").Done(). AddDefinition("doc").AddRelation("viewer"). @@ -384,7 +358,6 @@ func TestBaseRelationCompare(t *testing.T) { }) t.Run("different definition name", func(t *testing.T) { - t.Parallel() s := NewSchemaBuilder(). AddDefinition("user").Done(). AddDefinition("aaa").AddRelation("viewer").AllowedDirectRelation("user").Done().Done(). @@ -397,7 +370,6 @@ func TestBaseRelationCompare(t *testing.T) { }) t.Run("different relation name", func(t *testing.T) { - t.Parallel() s := NewSchemaBuilder(). AddDefinition("user").Done(). AddDefinition("doc"). @@ -412,7 +384,6 @@ func TestBaseRelationCompare(t *testing.T) { }) t.Run("different subject type", func(t *testing.T) { - t.Parallel() s := NewSchemaBuilder(). AddDefinition("org").Done(). AddDefinition("user").Done(). @@ -428,7 +399,6 @@ func TestBaseRelationCompare(t *testing.T) { }) t.Run("different subrelation", func(t *testing.T) { - t.Parallel() s := NewSchemaBuilder(). AddDefinition("org").Done(). AddDefinition("doc").AddRelation("viewer"). @@ -443,7 +413,6 @@ func TestBaseRelationCompare(t *testing.T) { }) t.Run("different caveat", func(t *testing.T) { - t.Parallel() s := NewSchemaBuilder(). AddDefinition("user").Done(). AddDefinition("doc").AddRelation("viewer"). @@ -458,7 +427,6 @@ func TestBaseRelationCompare(t *testing.T) { }) t.Run("different wildcard", func(t *testing.T) { - t.Parallel() // Use AllowedRelation with empty subrelation and AllowedWildcard (also empty subrelation) // so comparison reaches the wildcard field. s := NewSchemaBuilder(). @@ -475,7 +443,6 @@ func TestBaseRelationCompare(t *testing.T) { }) t.Run("different expiration", func(t *testing.T) { - t.Parallel() s := NewSchemaBuilder(). AddDefinition("user").Done(). AddDefinition("doc").AddRelation("viewer"). diff --git a/pkg/schema/v2/tocorev1_test.go b/pkg/schema/v2/tocorev1_test.go index 7e664ae9b..637ad38c2 100644 --- a/pkg/schema/v2/tocorev1_test.go +++ b/pkg/schema/v2/tocorev1_test.go @@ -10,8 +10,6 @@ import ( ) func TestAsCompiledSchema(t *testing.T) { - t.Parallel() - type testcase struct { name string schemaText string @@ -139,7 +137,6 @@ func TestAsCompiledSchema(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() // Compile the schema using the existing compiler compiled, err := compiler.Compile(compiler.InputSchema{ @@ -184,8 +181,6 @@ func TestAsCompiledSchema(t *testing.T) { } func TestAsCompiledSchemaRoundTrip(t *testing.T) { - t.Parallel() - schemaText := ` use self @@ -268,8 +263,6 @@ func TestAsCompiledSchemaRoundTrip(t *testing.T) { } func TestAsCompiledSchemaNilSchema(t *testing.T) { - t.Parallel() - var nilSchema *Schema compiled, err := nilSchema.AsCompiledSchema() require.Error(t, err) @@ -278,8 +271,6 @@ func TestAsCompiledSchemaNilSchema(t *testing.T) { } func TestAsCompiledSchemaEmptySchema(t *testing.T) { - t.Parallel() - schemaText := `` // Compile an empty schema @@ -305,8 +296,6 @@ func TestAsCompiledSchemaEmptySchema(t *testing.T) { } func TestAsCompiledSchemaOrderedDefinitions(t *testing.T) { - t.Parallel() - schemaText := ` caveat caveat1(x string) { x == "a" } diff --git a/pkg/schema/v2/todefinitions_test.go b/pkg/schema/v2/todefinitions_test.go index c8f0271fe..4e2e88566 100644 --- a/pkg/schema/v2/todefinitions_test.go +++ b/pkg/schema/v2/todefinitions_test.go @@ -13,8 +13,6 @@ import ( ) func TestToDefinitionsBasic(t *testing.T) { - t.Parallel() - type testcase struct { name string schemaText string @@ -119,7 +117,6 @@ func TestToDefinitionsBasic(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() // Compile schema compiled, err := compiler.Compile(compiler.InputSchema{ @@ -147,11 +144,7 @@ func TestToDefinitionsBasic(t *testing.T) { } func TestToDefinitionsMetadataPreservation(t *testing.T) { - t.Parallel() - t.Run("definition metadata is preserved", func(t *testing.T) { - t.Parallel() - // Create a definition with metadata docComment := &implv1.DocComment{ Comment: "This is a test definition", @@ -186,8 +179,6 @@ func TestToDefinitionsMetadataPreservation(t *testing.T) { }) t.Run("relation metadata with comments is preserved", func(t *testing.T) { - t.Parallel() - // Create relation with doc comment docComment := &implv1.DocComment{ Comment: "This is a viewer relation", @@ -259,8 +250,6 @@ func TestToDefinitionsMetadataPreservation(t *testing.T) { }) t.Run("caveat metadata is preserved", func(t *testing.T) { - t.Parallel() - // Create caveat with metadata docComment := &implv1.DocComment{ Comment: "This checks IP addresses", @@ -296,8 +285,6 @@ func TestToDefinitionsMetadataPreservation(t *testing.T) { } func TestToDefinitionsRelationsHaveProperMetadata(t *testing.T) { - t.Parallel() - schemaText := ` definition user {} @@ -339,8 +326,6 @@ func TestToDefinitionsRelationsHaveProperMetadata(t *testing.T) { } func TestToDefinitionsPermissionsHaveProperMetadata(t *testing.T) { - t.Parallel() - schemaText := ` definition user {} @@ -428,8 +413,6 @@ func TestToDefinitionsPermissionsHaveProperMetadata(t *testing.T) { } func TestToDefinitionsFlattenedSchema(t *testing.T) { - t.Parallel() - schemaText := ` definition user {} @@ -489,8 +472,6 @@ func TestToDefinitionsFlattenedSchema(t *testing.T) { } func TestToDefinitionsResolvedSchema(t *testing.T) { - t.Parallel() - schemaText := ` definition user {} @@ -550,8 +531,6 @@ func TestToDefinitionsResolvedSchema(t *testing.T) { } func TestToDefinitionsComplexSchema(t *testing.T) { - t.Parallel() - schemaText := ` caveat ip_check(ip string) { ip == "127.0.0.1" @@ -622,8 +601,6 @@ func TestToDefinitionsComplexSchema(t *testing.T) { } func TestToDefinitionsRoundTrip(t *testing.T) { - t.Parallel() - schemaText := ` caveat expiration(expires_at timestamp, current_time timestamp) { expires_at > current_time @@ -697,8 +674,6 @@ func TestToDefinitionsRoundTrip(t *testing.T) { } func TestToDefinitionsNilSchema(t *testing.T) { - t.Parallel() - var nilSchema *Schema defs, caveats, err := nilSchema.ToDefinitions() require.Error(t, err) @@ -708,8 +683,6 @@ func TestToDefinitionsNilSchema(t *testing.T) { } func TestToDefinitionsEmptySchema(t *testing.T) { - t.Parallel() - schema := &Schema{ definitions: make(map[string]*Definition), caveats: make(map[string]*Caveat), diff --git a/pkg/schema/v2/todefinitions_typesystem_test.go b/pkg/schema/v2/todefinitions_typesystem_test.go index 4ac711502..6ba3eb8b0 100644 --- a/pkg/schema/v2/todefinitions_typesystem_test.go +++ b/pkg/schema/v2/todefinitions_typesystem_test.go @@ -15,8 +15,6 @@ import ( type definitionTester func(t *testing.T, def *pkgschema.Definition) func TestToDefinitionsRoundTripWithTypeSystem(t *testing.T) { - t.Parallel() - type testcase struct { name string schemaText string @@ -365,7 +363,6 @@ func TestToDefinitionsRoundTripWithTypeSystem(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() // Step 1: Compile original schema compiled1, err := compiler.Compile(compiler.InputSchema{ @@ -406,8 +403,6 @@ func TestToDefinitionsRoundTripWithTypeSystem(t *testing.T) { } func TestToDefinitionsFlattenedRoundTripWithTypeSystem(t *testing.T) { - t.Parallel() - type testcase struct { name string schemaText string @@ -603,7 +598,6 @@ func TestToDefinitionsFlattenedRoundTripWithTypeSystem(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { tc := tc - t.Parallel() // Step 1: Compile original schema compiled1, err := compiler.Compile(compiler.InputSchema{ @@ -652,8 +646,6 @@ func TestToDefinitionsFlattenedRoundTripWithTypeSystem(t *testing.T) { } func TestToDefinitionsRoundTripWithTypeSystemNegativeCases(t *testing.T) { - t.Parallel() - schemaText := ` definition user {} definition team {} @@ -697,7 +689,6 @@ func TestToDefinitionsRoundTripWithTypeSystemNegativeCases(t *testing.T) { require.NoError(t, err) t.Run("disallowed namespace", func(t *testing.T) { - t.Parallel() // team is not allowed on viewer relation allowed, err := def.IsAllowedDirectNamespace("viewer", "team") require.NoError(t, err) @@ -705,7 +696,6 @@ func TestToDefinitionsRoundTripWithTypeSystemNegativeCases(t *testing.T) { }) t.Run("disallowed relation on allowed namespace", func(t *testing.T) { - t.Parallel() // organization is allowed on org relation, but not with the "admin" relation allowed, err := def.IsAllowedDirectRelation("org", "organization", "admin") require.NoError(t, err) @@ -713,7 +703,6 @@ func TestToDefinitionsRoundTripWithTypeSystemNegativeCases(t *testing.T) { }) t.Run("non-existent relation", func(t *testing.T) { - t.Parallel() // nonexistent relation should return false exists := def.HasRelation("nonexistent") require.False(t, exists) @@ -726,7 +715,6 @@ func TestToDefinitionsRoundTripWithTypeSystemNegativeCases(t *testing.T) { }) t.Run("permission has no type information", func(t *testing.T) { - t.Parallel() // view is a permission, so it should not have type information hasTypeInfo := def.HasTypeInformation("view") require.False(t, hasTypeInfo) diff --git a/pkg/schemadsl/compiler/compiler_test.go b/pkg/schemadsl/compiler/compiler_test.go index f59cea378..22f70c9e1 100644 --- a/pkg/schemadsl/compiler/compiler_test.go +++ b/pkg/schemadsl/compiler/compiler_test.go @@ -23,8 +23,6 @@ var ( ) func TestCompile(t *testing.T) { - t.Parallel() - type compileTest struct { name string objectPrefix ObjectPrefixOption @@ -1432,7 +1430,6 @@ func TestCompile(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - t.Parallel() require := require.New(t) compiled, err := Compile(InputSchema{ input.Source(test.name), test.input, @@ -1511,8 +1508,6 @@ func filterSourcePositions(m protoreflect.Message) { } func TestSkipValidation(t *testing.T) { - t.Parallel() - _, err := Compile(InputSchema{"test", `definition a/def {}`}, AllowUnprefixedObjectType()) require.Error(t, err) @@ -1521,8 +1516,6 @@ func TestSkipValidation(t *testing.T) { } func TestSuperLargeCaveatCompile(t *testing.T) { - t.Parallel() - b, err := os.ReadFile("../parser/tests/superlarge.zed") if err != nil { panic(err) @@ -1537,8 +1530,6 @@ func TestSuperLargeCaveatCompile(t *testing.T) { } func TestCompileWithCustomCaveatTypeSet(t *testing.T) { - t.Parallel() - schema := ` caveat somecaveat(someparam int, somevar somecustomtype) { someparam.isEven() diff --git a/pkg/schemadsl/compiler/development_test.go b/pkg/schemadsl/compiler/development_test.go index 071e254ee..5f97c65e5 100644 --- a/pkg/schemadsl/compiler/development_test.go +++ b/pkg/schemadsl/compiler/development_test.go @@ -10,8 +10,6 @@ import ( ) func TestPositionToAstNode(t *testing.T) { - t.Parallel() - tcs := []struct { name string schema string @@ -218,8 +216,6 @@ func TestPositionToAstNode(t *testing.T) { for _, tc := range tcs { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - compiled, err := Compile(InputSchema{ Source: input.Source("test"), SchemaString: tc.schema, diff --git a/pkg/schemadsl/compiler/importer_test.go b/pkg/schemadsl/compiler/importer_test.go index c1c62d1f3..05a925d1e 100644 --- a/pkg/schemadsl/compiler/importer_test.go +++ b/pkg/schemadsl/compiler/importer_test.go @@ -55,8 +55,6 @@ func (it *importerTest) writeExpected(schema string) { } func TestImporter(t *testing.T) { - t.Parallel() - workingDir, err := os.Getwd() require.NoError(t, err) @@ -73,8 +71,6 @@ func TestImporter(t *testing.T) { for _, test := range importerTests { t.Run(test.name, func(t *testing.T) { - t.Parallel() - sourceFolder := path.Join(workingDir, test.relativePath()) inputSchema := test.input() @@ -99,8 +95,6 @@ func TestImporter(t *testing.T) { } }) t.Run("fs/"+test.name, func(t *testing.T) { - t.Parallel() - fsys, err := fs.Sub(testFS, filepath.Join("importer-test", test.folder)) require.NoError(t, err) @@ -129,8 +123,6 @@ func TestImporter(t *testing.T) { } func TestImportCycleCausesError(t *testing.T) { - t.Parallel() - workingDir, err := os.Getwd() require.NoError(t, err) test := importerTest{"", "circular-import"} @@ -149,8 +141,6 @@ func TestImportCycleCausesError(t *testing.T) { } func TestEscapeAttemptCausesError(t *testing.T) { - t.Parallel() - workingDir, err := os.Getwd() require.NoError(t, err) test := importerTest{"", "escape-attempt"} @@ -169,8 +159,6 @@ func TestEscapeAttemptCausesError(t *testing.T) { } func TestConflictingDefinitionsCausesError(t *testing.T) { - t.Parallel() - workingDir, err := os.Getwd() require.NoError(t, err) test := importerTest{"", "conflicting-definitions"} diff --git a/pkg/schemadsl/parser/parser_test.go b/pkg/schemadsl/parser/parser_test.go index d1720d63b..9ddda1925 100644 --- a/pkg/schemadsl/parser/parser_test.go +++ b/pkg/schemadsl/parser/parser_test.go @@ -89,8 +89,6 @@ func (tn *testNode) MustDecorateWithInt(property string, value int) AstNode { } func TestParser(t *testing.T) { - t.Parallel() - parserTests := []parserTest{ {"empty file test", "empty"}, {"basic definition test", "basic"}, @@ -159,7 +157,6 @@ func TestParser(t *testing.T) { for _, test := range parserTests { t.Run(test.name, func(t *testing.T) { - t.Parallel() root := Parse(createAstNode, input.Source(test.name), test.input()) parseTree := getParseTree((root).(*testNode), 0) assert := assert.New(t)