Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
lolgab committed Jan 13, 2025
1 parent f251291 commit 859e20d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
./mill --disable-ticker integration.test
- name: Start NGINX Unit daemon
run: sudo systemctl start unit.service
# - name: Run Mill Plugin Tests
# run: ./mill --disable-ticker snunit-mill-plugin-itest.__.test
- name: Run Mill Plugin Tests
run: ./mill --disable-ticker snunit-mill-plugin.__.test
# - name: Build and Test Sbt plugin
# run: |
# (
Expand Down
4 changes: 1 addition & 3 deletions build.mill.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ val testServerPort = 8081
object Common {
trait Shared extends ScalaModule with ScalafixModule {
def organization = "com.github.lolgab"
def name = "snunit"
def crossScalaVersion: String

def scalacOptions = super.scalacOptions() ++
Seq("-deprecation")
Expand Down Expand Up @@ -261,7 +259,7 @@ object integration extends ScalaModule {
}
}

object `snunit-mill-plugin` extends ScalaModule with Publish with BuildInfo {
object `snunit-mill-plugin` extends Common.Shared with Publish with BuildInfo {
def buildInfoMembers = Seq(
BuildInfo.Value("snunitVersion", publishVersion())
)
Expand Down
6 changes: 3 additions & 3 deletions snunit-mill-plugin/src/snunit/plugin/SNUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ trait SNUnit extends ScalaNativeModule {
}

def snunitNGINXUnitBinary = Task {
val platform = System.getProperty("os.name", "unknown")
val platform = System.getProperty("os.name", "unknown").toLowerCase()

val openSslParams =
if (platform.contains("mac"))
if (platform.contains("mac")) {
List("--cc-opt=-I/opt/homebrew/opt/openssl@3/include", "--ld-opt=-L/opt/homebrew/opt/openssl@3/lib")
else Nil
} else Nil

// val unitDir = snunitNGINXUnitSources().path
val unitDir = os.Path("/Users/lorenzo/unit")
Expand Down
4 changes: 2 additions & 2 deletions snunit-mill-plugin/test/src/snunit/plugin/SNUnitTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ object SNUnitTests extends TestSuite {
val resourceFolder = os.Path(sys.env("MILL_TEST_RESOURCE_DIR").split(";").head)

UnitTester(build, resourceFolder / "simple").scoped { eval =>
scala.concurrent.ExecutionContext.global.execute(() => eval(build.snunitRunNGINXUnit))
scala.concurrent.ExecutionContext.global.execute(() => eval(build.snunitRunNGINXUnit()))
var started = false
while (!started) {
try {
val response = requests.get("http://127.0.0.1:8080", check = false).text
val response = requests.get("http://127.0.0.1:8080", check = false).text()
started = true
response ==> "TEST SNUnit Mill Plugin"
} catch {
Expand Down

0 comments on commit 859e20d

Please sign in to comment.