Skip to content

Commit

Permalink
change to scala-cli and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
fhackett committed Oct 28, 2024
1 parent 57bb694 commit 13e6abc
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 47 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ 'main' ]

jobs:
build:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -16,17 +16,14 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
- name: Setup Go environment
uses: actions/setup-go@v5
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.golang-version }}
- name: Run tests
run: sbt "testOnly -- -l org.scalatest.tags.Slow"
- uses: VirtusLab/scala-cli-setup@main
with:
jvm: ${{ matrix.java-version }}
- name: 'Run tests'
run: scala-cli test . -- -l org.scalatest.tags.Slow"
- name: 'Upload Fuzz Test Results on Test Failure (in case there are some)'
if: ${{ failure() }}
uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -395,3 +395,4 @@ test/files/**/*.txt
*.old

.metals/
.scala-build/
31 changes: 0 additions & 31 deletions build.sbt

This file was deleted.

23 changes: 23 additions & 0 deletions project.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Main
//> using scala "2.13.15"
//> using options "-deprecation"

//> using dependency "com.lihaoyi:::ammonite:3.0.0"
//> using dependency "com.lihaoyi::os-lib:0.11.3"
//> using dependency "com.lihaoyi::upickle:1.5.0"
//> using dependency "io.github.java-diff-utils:java-diff-utils:4.12"
//> using dependency "org.rogach::scallop:5.1.0"
//> using dependency "org.scala-lang.modules::scala-parser-combinators:2.4.0"
//> using dependency "org.scala-lang:scala-reflect:2.13.15"

//> using exclude "systems/"

// Test
//> using testFramework org.scalatest.tools.Framework
//> using test.dependency "com.github.daddykotex::courier:3.2.0"
//> using test.dependency "com.lihaoyi::mainargs:0.7.6"
//> using test.dependency "com.lihaoyi::pprint:0.9.0"
//> using test.dependency "com.lihaoyi::upickle:4.0.2"
//> using test.dependency "org.scalacheck::scalacheck:1.18.1"
//> using test.dependency "org.scalatest::scalatest:3.2.19"

17 changes: 11 additions & 6 deletions test/pgo/util/TLAExpressionFuzzTestUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import scala.util.control.NonFatal
import scala.util.{Failure, Success}

trait TLAExpressionFuzzTestUtils {
final class TLAExpressionFuzzTestProps(seedStr: String, workDir: os.Path) extends Properties("TLAExpression") {
private abstract class TLAExpressionFuzzTestProps extends Properties("TLAExpression") {
def seedStr: String
def workDir: os.Path
import org.scalacheck.Prop._

private val testFile = workDir / "TestBed.tla"
Expand Down Expand Up @@ -171,13 +173,16 @@ trait TLAExpressionFuzzTestUtils {

def runExpressionFuzzTesting(seed: Seed = Seed.random(), dealWithGoCache: Boolean = false): FuzzTestingResult = {
var resultCatcher: Option[Test.Result] = None
val seedStr = seed.toBase64
val _seedStr = seed.toBase64
if(dealWithGoCache) {
os.proc("go", "clean", "-cache").call()
}
val workDir = os.temp.dir(deleteOnExit = false)
val _workDir = os.temp.dir(deleteOnExit = false)
try {
val props = new TLAExpressionFuzzTestProps(seedStr = seedStr, workDir = workDir)
object props extends TLAExpressionFuzzTestProps {
def seedStr = _seedStr
def workDir = _workDir
}
Test.checkProperties(
prms = Test.Parameters.default
.withInitialSeed(seed)
Expand All @@ -193,7 +198,7 @@ trait TLAExpressionFuzzTestUtils {

FuzzTestingResult(
success = resultCatcher.get.passed,
seed = seedStr,
seed = _seedStr,
cases = props.cases,
degenerateCases = props.degenerateCases,
testOut = props.testOut,
Expand All @@ -203,7 +208,7 @@ trait TLAExpressionFuzzTestUtils {
nodeFrequencies = props.nodeFrequencies,
treeSizes = props.treeSizes)
} finally {
os.remove.all(workDir)
os.remove.all(_workDir)
}
}

Expand Down

0 comments on commit 13e6abc

Please sign in to comment.