-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Electrum tests pass on windows (#932)
There was an obscure Docker error when trying to start an Electrum server in tests. [1] It appears that there is a conflict between Docker and Hyper-V on some range of ports. A workaround is to just change the port we were using. [1] docker/for-win#3171
- Loading branch information
Showing
3 changed files
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,19 +25,21 @@ import org.scalatest.Suite | |
trait ElectrumxService extends DockerTestKit { | ||
self: Suite => | ||
|
||
val electrumPort = 47000 | ||
|
||
val electrumxContainer = if (System.getProperty("os.name").startsWith("Linux")) { | ||
// "host" mode will let the container access the host network on linux | ||
// we use our own docker image because other images on Docker lag behind and don't yet support 1.4 | ||
DockerContainer("acinq/electrumx") | ||
.withNetworkMode("host") | ||
.withEnv("DAEMON_URL=http://foo:bar@localhost:28332", "COIN=BitcoinSegwit", "NET=regtest") | ||
.withEnv("DAEMON_URL=http://foo:bar@localhost:28332", "COIN=BitcoinSegwit", "NET=regtest", s"TCP_PORT=$electrumPort") | ||
//.withLogLineReceiver(LogLineReceiver(true, println)) | ||
} else { | ||
// on windows or oxs, host mode is not available, but from docker 18.03 on host.docker.internal can be used instead | ||
// host.docker.internal is not (yet ?) available on linux though | ||
DockerContainer("acinq/electrumx") | ||
.withPorts(50001 -> Some(50001)) | ||
.withEnv("DAEMON_URL=http://foo:[email protected]:28332", "COIN=BitcoinSegwit", "NET=regtest", "TCP_PORT=50001") | ||
.withPorts(electrumPort -> Some(electrumPort)) | ||
.withEnv("DAEMON_URL=http://foo:[email protected]:28332", "COIN=BitcoinSegwit", "NET=regtest", s"TCP_PORT=$electrumPort") | ||
//.withLogLineReceiver(LogLineReceiver(true, println)) | ||
} | ||
|
||
|