Skip to content

Commit

Permalink
Use random wallet port in e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Anviking committed Feb 27, 2025
1 parent e33f1e9 commit c88c1ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/integration/cardano-wallet-integration.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ test-suite e2e
, bytestring
, cardano-addresses
, cardano-wallet-api
, cardano-wallet-application-extras
, cardano-wallet-exe
, cardano-wallet-integration:framework
, cardano-wallet-launcher
Expand Down
10 changes: 7 additions & 3 deletions lib/integration/exe/e2e.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ import Cardano.Wallet.Api.Types
import Cardano.Wallet.Application.CLI
( Port (..)
)
import Cardano.Wallet.Network.Ports
( getRandomPort
)
import Cardano.Wallet.Primitive.NetworkId
( NetworkDiscriminant (Testnet)
)
Expand Down Expand Up @@ -203,18 +206,19 @@ configureContext (E2EConfig preprodMnemonics alreadyRunningWallet) action =
}

withCardanoNode nullTracer nodeConfig $ \(JustK node) -> do
walletPort <- getRandomPort
let walletConfig =
CardanoWalletConfig
{ walletPort = 8090
{ walletPort = walletPort
, walletDatabaseDir = "wallet-db"
, walletNetwork = Launcher.Testnet "byron-genesis.json"
, executable = Nothing
, workingDir = Just dir
, extraArgs = []
}
withCardanoWallet nullTracer node walletConfig
$ \(CardanoWalletConn walletPort _) -> do
action =<< contextFromWalletPort walletPort
$ \(CardanoWalletConn walletPort' _) -> do
action =<< contextFromWalletPort walletPort'

contextFromWalletPort :: PortNumber -> IO Context
contextFromWalletPort walletPort = do
Expand Down

0 comments on commit c88c1ff

Please sign in to comment.