Skip to content

Commit

Permalink
try it out
Browse files Browse the repository at this point in the history
  • Loading branch information
THWiseman committed Dec 5, 2023
1 parent bb1e394 commit 6793805
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/scalafmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Scalafmt'

#This github action runs the scalafmt linting tool on the entire codebase.
# It fails if any files are not formatted properly.

run-name: ${{ format('{0} Scalafmt', github.actor) }}

on:
workflow_dispatch:
push:

permissions:
contents: read

jobs:
run-scalafmt:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.target-branch }}
- uses: ./.github/set_up_cromwell_action #This github action will set up git-secrets, caching, java, and sbt.
with:
cromwell_repo_token: ${{ secrets.BROADBOT_GITHUB_TOKEN }}
- name: Run Scalafmt
run: |
sbt scalafmtCheckAll scalafmtDetailedError:true scalafmtLogOnEachError:true scalafmtFailOnErrors:true
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ object DockerCredentials {
object DockerCredentialUsernameAndPassword {
private val tokenStringFormat = raw"([^:]*):(.*)".r

def unapply(arg: DockerCredentials): Option[(String, String)] = Try(
new String(Base64.getDecoder.decode(arg.token))
).toOption match {
case Some(tokenStringFormat(username, password)) => Some((username, password))
def unapply(arg: DockerCredentials): Option[(String, String)] = Try(new String(Base64.getDecoder.decode(arg.token))).toOption match {case Some(tokenStringFormat(username, password)) => Some((username, password))
case _ => None
}
}
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.1.1")
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.4")
addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addDependencyTreePlugin
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,13 @@ class TesAsyncBackendJobExecutionActorSpec extends AnyFlatSpec with Matchers wit
val mockBlob: BlobPath = generateMockBlobPath
if (pathToConvert.get.pathAsString.contains(someBlobUrl)) Try(mockBlob) else Failure(new Exception("failed"))
}

//this comment is way too long anaaaaathis comment is way too long anaaaaathis comment is way too long anaaaaathis comment is way too long anaaaaathis comment is way too long anaaaaathis comment is way too long anaaaaathis comment is way too long anaaaaathis comment is way too long anaaaaathis comment is way too long anaaaaa
it should "not return sas endpoint when no blob paths are provided" in {
val mockLogger: JobLogger = mock[JobLogger]
val emptyInputs: List[Input] = List()
val bloblessInputs: List[Input] = List(notBlobInput_1, notBlobInput_2)
TesAsyncBackendJobExecutionActor
.determineWSMSasEndpointFromInputs(emptyInputs, pathGetter, mockLogger, blobConverter)
.isFailure shouldBe true
TesAsyncBackendJobExecutionActor
.determineWSMSasEndpointFromInputs(bloblessInputs, pathGetter, mockLogger, blobConverter)
.isFailure shouldBe true
TesAsyncBackendJobExecutionActor.determineWSMSasEndpointFromInputs(emptyInputs, pathGetter, mockLogger, blobConverter).isFailure shouldBe true
TesAsyncBackendJobExecutionActor.determineWSMSasEndpointFromInputs(bloblessInputs, pathGetter, mockLogger, blobConverter).isFailure shouldBe true
}

it should "return a sas endpoint based on inputs when blob paths are provided" in {
Expand Down

0 comments on commit 6793805

Please sign in to comment.