diff --git a/.github/workflows/verify_consumer_pacts.yml b/.github/workflows/verify_consumer_pacts.yml index 70edaf3a1..663b1afb8 100644 --- a/.github/workflows/verify_consumer_pacts.yml +++ b/.github/workflows/verify_consumer_pacts.yml @@ -139,16 +139,16 @@ jobs: fi git fetch if [[ ! -z "${{ env.CHECKOUT_BRANCH }}" ]] && [[ ! -z "${{ env.CHECKOUT_SHA }}" ]]; then - echo "git checkout ${{ env.CHECKOUT_BRANCH }} ${{ env.CHECKOUT_SHA }}" - git checkout ${{ env.CHECKOUT_BRANCH }} ${{ env.CHECKOUT_SHA }} + echo "git checkout -b ${{ env.CHECKOUT_BRANCH }} ${{ env.CHECKOUT_SHA }}" + git checkout -b ${{ env.CHECKOUT_BRANCH }} ${{ env.CHECKOUT_SHA }} || echo "already in ${{ env.CHECKOUT_BRANCH }}" echo "git branch" git branch else - if [[ "${{ github.event_name }}" == "push" ]]; then + if [[ "${{ github.event_name }}" == "push" ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "git checkout ${{ env.CURRENT_BRANCH }}" git checkout ${{ env.CURRENT_BRANCH }} else - echo "git checkout ${{ env.CURRENT_BRANCH }} ${{ env.CURRENT_SHA }}" + echo "git checkout -b ${{ env.CURRENT_BRANCH }} ${{ env.CURRENT_SHA }}" git checkout -b ${{ env.CURRENT_BRANCH }} ${{ env.CURRENT_SHA }} fi fi diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/provider/SamProviderSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/provider/SamProviderSpec.scala index e6af93b82..52fd70079 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/provider/SamProviderSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/provider/SamProviderSpec.scala @@ -129,6 +129,16 @@ class SamProviderSpec }) } yield () + private def mockGetArbitraryPetServiceAccountToken(): IO[Unit] = for { + _ <- IO( + when { + googleExt.getArbitraryPetServiceAccountToken(any[SamUser], any[Set[String]], any[SamRequestContext]) + } thenReturn { + Future.successful("aToken") + } + ) + } yield () + private def mockResourceActionPermission(action: ResourceAction, hasPermission: Boolean): IO[Unit] = for { _ <- IO( lenient() @@ -142,7 +152,7 @@ class SamProviderSpec private val providerStatesHandler: StateManagementFunction = StateManagementFunction { case ProviderState(States.UserExists, _) => - logger.debug(States.UserExists) + mockGetArbitraryPetServiceAccountToken().unsafeRunSync() case ProviderState(States.SamOK, _) => mockCriticalSubsystemsStatus(true).unsafeRunSync() case ProviderState(States.SamNotOK, _) =>