Skip to content

Commit

Permalink
Fix travis build for cross compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
orium committed Jan 16, 2020
1 parent 77e419d commit 926b536
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 64 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
language: scala

scala:
- 2.12.10
# We just keep the latest version here. All scripts do their own cross-building (because they are supposed to do
# that locally.)
- 2.13.1

script:
- alias sbt='sbt ++$TRAVIS_SCALA_VERSION -jvm-opts .jvmopts'
- bash ./scripts/local-build-test.sh

after_success:
Expand Down
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ def compilerOptionsVersion(scalaVersion: String) =
case _ => Nil
})

lazy val scalaVersion212: String = "2.12.10"
lazy val scalaVersion213: String = "2.13.1"
lazy val scalaVersion212: String = "2.12.10"
lazy val scalaVersion213: String = "2.13.1"
lazy val supportedScalaVersions = List(scalaVersion212, scalaVersion213)

ThisBuild / scalaVersion := scalaVersion213
ThisBuild / scalaVersion := scalaVersion212

lazy val commonSettings = Seq(
version := "2.3.12",
Expand Down Expand Up @@ -458,13 +458,13 @@ lazy val docs =
.enablePlugins(ParadoxSitePlugin)
.enablePlugins(GhpagesPlugin)
.settings(
scalaVersion := scalaVersion212, // WIP!
paradoxTheme := Some(builtinParadoxTheme("generic")),
name := "scalapact-docs",
git.remoteRepo := "[email protected]:ITV/scala-pact.git",
sourceDirectory in Paradox := sourceDirectory.value / "main" / "paradox",
skip in publish := true
)
.settings(scala212OnlySettings)

lazy val scalaPactProject =
(project in file("."))
Expand Down
44 changes: 22 additions & 22 deletions example/provider/delivered_pacts/Consumer_Provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,6 @@
"name" : "Provider"
},
"interactions" : [
{
"request" : {
"method" : "GET",
"path" : "/results"
},
"description" : "Fetching results",
"response" : {
"status" : 200,
"headers" : {
"Pact" : "modifiedRequest"
},
"body" : {
"count" : 3,
"results" : [
"Bob",
"Fred",
"Harry"
]
}
},
"providerState" : "Results: Bob, Fred, Harry"
},
{
"request" : {
"method" : "GET",
Expand Down Expand Up @@ -56,6 +34,28 @@
}
}
}
},
{
"request" : {
"method" : "GET",
"path" : "/results"
},
"description" : "Fetching results",
"response" : {
"status" : 200,
"headers" : {
"Pact" : "modifiedRequest"
},
"body" : {
"count" : 3,
"results" : [
"Bob",
"Fred",
"Harry"
]
}
},
"providerState" : "Results: Bob, Fred, Harry"
}
],
"consumer" : {
Expand Down
44 changes: 22 additions & 22 deletions example/provider_tests/delivered_pacts/Consumer_Provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,6 @@
"name" : "Provider"
},
"interactions" : [
{
"request" : {
"method" : "GET",
"path" : "/results"
},
"description" : "Fetching results",
"response" : {
"status" : 200,
"headers" : {
"Pact" : "modifiedRequest"
},
"body" : {
"count" : 3,
"results" : [
"Bob",
"Fred",
"Harry"
]
}
},
"providerState" : "Results: Bob, Fred, Harry"
},
{
"request" : {
"method" : "GET",
Expand Down Expand Up @@ -56,6 +34,28 @@
}
}
}
},
{
"request" : {
"method" : "GET",
"path" : "/results"
},
"description" : "Fetching results",
"response" : {
"status" : 200,
"headers" : {
"Pact" : "modifiedRequest"
},
"body" : {
"count" : 3,
"results" : [
"Bob",
"Fred",
"Harry"
]
}
},
"providerState" : "Results: Bob, Fred, Harry"
}
],
"consumer" : {
Expand Down
3 changes: 1 addition & 2 deletions scripts/localpublish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ set -e
echo "Locally published Scala-Pact"
echo "****************************"

sbt localPublishScalaPact

sbt +localPublishScalaPact
2 changes: 1 addition & 1 deletion scripts/publish-docs.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

sbt docs/clean docs/paradox docs/makeSite docs/ghpagesPushSite
sbt +docs/clean +docs/paradox +docs/makeSite +docs/ghpagesPushSite
4 changes: 2 additions & 2 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fi
echo ""
echo "Preparing Scala-Pact for publishing"

sbt prepareScalaPactPublish
sbt +prepareScalaPactPublish

echo ""
echo -e "Preparation complete, release to Sonatype? [y/n] \c"
Expand All @@ -40,4 +40,4 @@ else
echo "Publishing now.."
fi

sbt sonatypeBundleRelease
sbt +sonatypeBundleRelease
6 changes: 3 additions & 3 deletions scripts/spec-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ echo "**********************"

# At this point, all the local publishing (therefore: clean update compile test publishLocal) should be done.

sbt test:compile
sbt pactSpec/test
sbt testsWithDeps/test
sbt +test:compile
sbt +pactSpec/test
sbt +testsWithDeps/test
10 changes: 5 additions & 5 deletions scripts/test-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ echo "***********************"
echo ""
echo "> Consumer tests"
cd example/consumer
sbt clean update compile pactTest
sbt +clean +update +compile +pactTest
cd ..
bash deliver.sh

echo ""
echo "> Provider verification by test suite"
cd provider_tests
sbt clean update compile test
sbt +clean +update +compile +test
cd ..

echo ""
echo "> Provider verification by external testing"
cd provider
sbt run &
sbt +run &

echo "..wait a bit for the service to start"
simple_countdown 30

sbt "pactVerify --source delivered_pacts/ --host localhost --port 8080 --clientTimeout 2"
sbt "+pactVerify --source delivered_pacts/ --host localhost --port 8080 --clientTimeout 2"

cd ../..

pkill -1 -f sbt-launch.jar
pkill -1 -f sbt-launch.jar
2 changes: 1 addition & 1 deletion scripts/test-verifier.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ sbt "testsWithDeps/pactVerify --source target/pacts --clientTimeout 10"
pkill -1 -f sbt-launch.jar

remove_plugin_file
remove_config_file
remove_config_file

0 comments on commit 926b536

Please sign in to comment.