Skip to content

Commit

Permalink
add envvar to bypass bazelbuild/rules_closure#351
Browse files Browse the repository at this point in the history
fix stage1-core.sh
  • Loading branch information
Peng Cheng committed May 12, 2022
1 parent 063e796 commit c676133
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ case class IncrementallyCachedRDD[T: ClassTag](
val result = SCFunctions(sparkContext).withJob(info) {

this
.mapOncePerWorker { v =>
.mapOncePerWorker { _ =>
logInfo(info + s" - executor ${SparkHelper.taskLocationStrOpt.getOrElse("??")}")
val result = depCache.cleanUp()

Expand Down
2 changes: 1 addition & 1 deletion dev/CI/stage1-core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ source "${FWDIR}/profiles/${1}/.common.sh"

"$FWDIR"/mvn-install.sh "${MVN_PROFILES[@]}" -Pbenchmark && \
"$FWDIR"/test.sh "${MVN_PROFILES[@]}" -Pbenchmark || \
("$FWDIR"/test-reports.sh && throw -1)
(dev/test-reports.sh && exit 1)
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ abstract class WebInteraction(

new org.openqa.selenium.interactions.Actions(session.driverOf(Web))
}

}

object WebInteraction {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ object WebDriverFactory {
FileUtils.forceDelete(dstFile)
}

lazy val defaultServiceBuilder: PhantomJSDriverService.Builder = {
lazy val defaultBuilder: PhantomJSDriverService.Builder = {

new PhantomJSDriverService.Builder()
.usingAnyFreePort()
.withLogFile(new File("phantomjsdriver.log"))
}
}

Expand Down Expand Up @@ -182,40 +183,32 @@ object WebDriverFactory {
override def _createImpl(session: Session, lifespan: Lifespan): CleanWebDriver = {
val caps = newCaps(session.spooky)

// lazy val service: PhantomJSDriverService = {
//
// // Look for Proxy configuration within the Capabilities
// val proxy = {
// val setting = session.spooky.spookyConf.webProxy()
// asSeleniumProxy(setting)
// }
//
// // var proxy = null
// // if (desiredCapabilities != null) proxy = Proxy.extractFrom(desiredCapabilities)
//
// // Find PhantomJS executable
// val phantomjsfile = findPhantomJS(desiredCapabilities, PHANTOMJS_DOC_LINK, PHANTOMJS_DOWNLOAD_LINK)
//
// // Find GhostDriver main JavaScript file
// val ghostDriverfile = findGhostDriver(desiredCapabilities, GHOSTDRIVER_DOC_LINK, GHOSTDRIVER_DOWNLOAD_LINK)
//
// // Build & return service
// new PhantomJSDriverService.Builder()
// .usingAnyFreePort()
// .withProxy(proxy)
// .usingPhantomJSExecutable(phantomjsfile)
// .usingGhostDriver(ghostDriverfile)
// .usingAnyFreePort
// .withProxy(proxy)
// .withLogFile(new File(PHANTOMJS_DEFAULT_LOGFILE))
// .usingCommandLineArguments(findCLIArgumentsFromCaps(desiredCapabilities, PHANTOMJS_CLI_ARGS))
// .usingGhostDriverCommandLineArguments(
// findCLIArgumentsFromCaps(desiredCapabilities, PHANTOMJS_GHOSTDRIVER_CLI_ARGS)
// )
// .build
// }

val self = new PhantomJSDriver(caps)
lazy val service: PhantomJSDriverService = {

val deployment = deploy(session.spooky)
val pathStr = deployment.verifiedLocalPath

val proxyOpt = Option(session.spooky.spookyConf.webProxy()).map { v =>
asSeleniumProxy(v)
}

import scala.collection.JavaConverters._

var builder = PhantomJS.defaultBuilder
.usingPhantomJSExecutable(new File(pathStr))
.withEnvironment(
Map(
"OPENSSL_CONF" -> "/dev/null" //https://github.com/bazelbuild/rules_closure/issues/351
).asJava
)
proxyOpt.foreach { proxy =>
builder = builder.withProxy(proxy)
}

builder.build
}

val self = new PhantomJSDriver(service, caps)
new CleanWebDriver(self, lifespan)
}
}
Expand Down

0 comments on commit c676133

Please sign in to comment.