@@ -329,10 +329,10 @@ class BuildTriggerTests: AppTestCase {
329329
330330 func test_triggerBuildsUnchecked( ) async throws {
331331 try await withDependencies {
332+ $0. environment. builderToken = { " builder token " }
332333 $0. environment. buildTimeout = { 10 }
333334 } operation: {
334335 // setup
335- Current . builderToken = { " builder token " }
336336 Current . gitlabPipelineToken = { " pipeline token " }
337337 Current . siteURL = { " http://example.com " }
338338
@@ -390,11 +390,11 @@ class BuildTriggerTests: AppTestCase {
390390
391391 func test_triggerBuildsUnchecked_supported( ) async throws {
392392 try await withDependencies {
393+ $0. environment. builderToken = { " builder token " }
393394 $0. environment. buildTimeout = { 10 }
394395 } operation: {
395396 // Explicitly test the full range of all currently triggered platforms and swift versions
396397 // setup
397- Current . builderToken = { " builder token " }
398398 Current . gitlabPipelineToken = { " pipeline token " }
399399 Current . siteURL = { " http://example.com " }
400400
@@ -470,6 +470,7 @@ class BuildTriggerTests: AppTestCase {
470470
471471 func test_triggerBuildsUnchecked_build_exists( ) async throws {
472472 try await withDependencies {
473+ $0. environment. builderToken = { " builder token " }
473474 $0. environment. buildTimeout = { 10 }
474475 } operation: {
475476 // Tests error handling when a build record already exists and `create` raises a
@@ -483,7 +484,6 @@ class BuildTriggerTests: AppTestCase {
483484 // being completely ignored because the command errors out.
484485 // See https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server/issues/2237
485486 // setup
486- Current . builderToken = { " builder token " }
487487 Current . gitlabPipelineToken = { " pipeline token " }
488488 Current . siteURL = { " http://example.com " }
489489
@@ -550,11 +550,11 @@ class BuildTriggerTests: AppTestCase {
550550 func test_triggerBuilds_checked( ) async throws {
551551 try await withDependencies {
552552 $0. environment. allowBuildTriggers = { true }
553+ $0. environment. builderToken = { " builder token " }
553554 $0. environment. buildTimeout = { 10 }
554555 } operation: {
555556 // Ensure we respect the pipeline limit when triggering builds
556557 // setup
557- Current . builderToken = { " builder token " }
558558 Current . gitlabPipelineToken = { " pipeline token " }
559559 Current . siteURL = { " http://example.com " }
560560 Current . gitlabPipelineLimit = { 300 }
@@ -662,11 +662,11 @@ class BuildTriggerTests: AppTestCase {
662662 func test_triggerBuilds_multiplePackages( ) async throws {
663663 try await withDependencies {
664664 $0. environment. allowBuildTriggers = { true }
665+ $0. environment. builderToken = { " builder token " }
665666 $0. environment. buildTimeout = { 10 }
666667 } operation: {
667668 // Ensure we respect the pipeline limit when triggering builds for multiple package ids
668669 // setup
669- Current . builderToken = { " builder token " }
670670 Current . gitlabPipelineToken = { " pipeline token " }
671671 Current . siteURL = { " http://example.com " }
672672 Current . gitlabPipelineLimit = { 300 }
@@ -712,10 +712,10 @@ class BuildTriggerTests: AppTestCase {
712712 func test_triggerBuilds_trimming( ) async throws {
713713 try await withDependencies {
714714 $0. environment. allowBuildTriggers = { true }
715+ $0. environment. builderToken = { " builder token " }
715716 } operation: {
716717 // Ensure we trim builds as part of triggering
717718 // setup
718- Current . builderToken = { " builder token " }
719719 Current . gitlabPipelineToken = { " pipeline token " }
720720 Current . siteURL = { " http://example.com " }
721721 Current . gitlabPipelineLimit = { 300 }
@@ -747,11 +747,11 @@ class BuildTriggerTests: AppTestCase {
747747 func test_triggerBuilds_error( ) async throws {
748748 try await withDependencies {
749749 $0. environment. allowBuildTriggers = { true }
750+ $0. environment. builderToken = { " builder token " }
750751 $0. environment. buildTimeout = { 10 }
751752 } operation: {
752753 // Ensure we trim builds as part of triggering
753754 // setup
754- Current . builderToken = { " builder token " }
755755 Current . gitlabPipelineToken = { " pipeline token " }
756756 Current . siteURL = { " http://example.com " }
757757 Current . gitlabPipelineLimit = { 300 }
@@ -843,11 +843,11 @@ class BuildTriggerTests: AppTestCase {
843843
844844 func test_override_switch( ) async throws {
845845 try await withDependencies {
846+ $0. environment. builderToken = { " builder token " }
846847 $0. environment. buildTimeout = { 10 }
847848 } operation: {
848849 // Ensure don't trigger if the override is off
849850 // setup
850- Current . builderToken = { " builder token " }
851851 Current . gitlabPipelineToken = { " pipeline token " }
852852 Current . siteURL = { " http://example.com " }
853853 // Use live dependency but replace actual client with a mock so we can
@@ -917,11 +917,11 @@ class BuildTriggerTests: AppTestCase {
917917 func test_downscaling( ) async throws {
918918 try await withDependencies {
919919 $0. environment. allowBuildTriggers = { true }
920+ $0. environment. builderToken = { " builder token " }
920921 $0. environment. buildTimeout = { 10 }
921922 } operation: {
922923 // Test build trigger downscaling behaviour
923924 // setup
924- Current . builderToken = { " builder token " }
925925 Current . gitlabPipelineToken = { " pipeline token " }
926926 Current . siteURL = { " http://example.com " }
927927 Current . buildTriggerDownscaling = { 0.05 } // 5% downscaling rate
@@ -990,11 +990,11 @@ class BuildTriggerTests: AppTestCase {
990990 func test_downscaling_allow_list_override( ) async throws {
991991 try await withDependencies {
992992 $0. environment. allowBuildTriggers = { true }
993+ $0. environment. builderToken = { " builder token " }
993994 $0. environment. buildTimeout = { 10 }
994995 } operation: {
995996 // Test build trigger downscaling behaviour for allow-listed packages
996997 // setup
997- Current . builderToken = { " builder token " }
998998 Current . gitlabPipelineToken = { " pipeline token " }
999999 Current . siteURL = { " http://example.com " }
10001000 Current . buildTriggerDownscaling = { 0.05 } // 5% downscaling rate
0 commit comments