Skip to content

Commit

Permalink
[ADP-3258] Enable integration tests in Conway era (#4410)
Browse files Browse the repository at this point in the history
- [x] Enable all integration tests in Conway
- [x] Mark tests that are failing for Conway WIP as pending (grep for
`noConway`)
- [x] Set `AsyncExceptions`  logging to critical
- [x] Bump NodeToClient protocol version to from V_13 to V_16

ADP-3258
  • Loading branch information
paolino authored Jan 30, 2024
2 parents 19c5bb0 + 61c6037 commit 8738867
Show file tree
Hide file tree
Showing 11 changed files with 4,829 additions and 3,377 deletions.
98 changes: 65 additions & 33 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
LC_ALL := 'C.UTF-8'

default:
@just --list

# check that the code is formatted with stylish-haskell
syntax:
./.buildkite/check-code-format.sh

# build wallet-e2e suite with cabal
hlint:
nix develop --command bash -c 'hlint lib'

# build wallet
build:
cabal build all
cabal build all -Werror -O0 -v0

# build after clean
clean-build:
cabal clean
cabal build all -Werror -O0 -v0

# run a nix shell with `cardano-wallet` in scope
wallet:
Expand All @@ -28,19 +38,6 @@ unit:
cabal run cardano-wallet:test:unit \
--test-options '--cluster-configs lib/local-cluster/test/data/cluster-configs'

# run integration tests
integration:
LOCAL_CLUSTER_CONFIGS=lib/local-cluster/test/data/cluster-configs \
nix shell '.#cardano-wallet' -c cabal test integration

babbage-integration-tests-cabal-no-wallet-match match:
echo "Running integration tests without cardano-wallet exe compiled"
LOCAL_CLUSTER_CONFIGS=../../lib/local-cluster/test/data/cluster-configs \
CARDANO_WALLET_TEST_DATA=test/data \
LOCAL_CLUSTER_ERA=babbage \
TESTS_RETRY_FAILED=1 \
cabal test integration -O0 -v0 --test-options '--match="{{match}}"'

# run wallet-e2e suite against the preprod network
e2e-preprod:
nix run '.#cardano-wallet-e2e' -- preprod \
Expand All @@ -62,32 +59,67 @@ e2e-local:
e2e-manual:
nix run '.#cardano-wallet-e2e' -- manual

#run integration tests locally via babbage-integration-exe
babbage-integration-tests:
LOCAL_CLUSTER_CONFIGS=lib/local-cluster/test/data/cluster-configs \
CARDANO_WALLET_TEST_DATA=./lib/wallet/test/data \
# run any integration test matching the given pattern via cabal
integration-tests-cabal-match match:
echo "Running integration tests with cardano-wallet exe compiled"
LOCAL_CLUSTER_CONFIGS=../../lib/local-cluster/test/data/cluster-configs \
CARDANO_WALLET_TEST_DATA=test/data \
cabal test integration -O0 -v0 \
--test-options '--match="{{match}}"'

# run any integration test matching the given pattern via cabal
integration-tests-cabal-options options:
echo "Running integration tests with cardano-wallet exe compiled"
LOCAL_CLUSTER_CONFIGS=../../lib/local-cluster/test/data/cluster-configs \
CARDANO_WALLET_TEST_DATA=test/data \
cabal test integration -O0 -v0 \
--test-options 'options'

# run babbage integration tests matching the given pattern via cabal
babbage-integration-tests-cabal-match match:
LOCAL_CLUSTER_ERA=babbage \
TESTS_RETRY_FAILED=1 \
nix shell \
'.#cardano-node' \
'.#cardano-cli' \
'.#cardano-wallet' \
'.#integration-exe' \
-c integration-exe -j 3
just integration-tests-cabal-match "{{match}}"

# run integration tests locally via conway-integration-exe
conway-integration-tests:
# run conway integration tests matching the given pattern via cabal
conway-integration-tests-cabal-match match:
LOCAL_CLUSTER_ERA=conway \
just integration-tests-cabal-match "{{match}}"

# run babbage integration tests via cabal
babbage-integration-tests-cabal:
just babbage-integration-tests-cabal-match ""

# run conway integration tests via cabal
conway-integration-tests-cabal:
just conway-integration-tests-cabal-match ""


# run any integration test matching the given pattern via nix
integration-tests match:
LOCAL_CLUSTER_CONFIGS=lib/local-cluster/test/data/cluster-configs \
CARDANO_WALLET_TEST_DATA=./lib/wallet/test/data \
LOCAL_CLUSTER_ERA=conway \
TESTS_RETRY_FAILED=1 \
nix shell \
'.#local-cluster' \
'.#cardano-node' \
'.#cardano-cli' \
'.#cardano-wallet' \
'.#integration-exe' \
-c integration-exe -j 3
-c integration-exe -j 3 --match="{{match}}"

hlint:
nix develop --command bash -c 'hlint lib'
# run babbage integration tests matching the given pattern via nix
babbage-integration-tests-match match:
LOCAL_CLUSTER_ERA=babbage \
just integration-tests "{{match}}"

# run conway integration tests matching the given pattern via nix
conway-integration-tests-match match:
LOCAL_CLUSTER_ERA=conway \
just integration-tests "{{match}}"

# run babbage integration tests via nix
babbage-integration-tests:
just babbage-integration-tests-match ""

# run conway integration tests via nix
conway-integration-tests:
just conway-integration-tests-match ""
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ emptyGenesis gp = W.Block

-- | The protocol client version. Distinct from the codecs version.
nodeToClientVersions :: [NodeToClientVersion]
nodeToClientVersions = [NodeToClientV_13]
nodeToClientVersions = [NodeToClientV_16]

--------------------------------------------------------------------------------
--
Expand Down
8 changes: 8 additions & 0 deletions lib/wallet/integration/src/Test/Integration/Framework/DSL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ module Test.Integration.Framework.DSL
, runResourceT
, ResourceT
, listLimitedTransactions
, noConway
) where

import Prelude
Expand Down Expand Up @@ -428,6 +429,7 @@ import Control.Monad
, replicateM
, unless
, void
, when
, (>=>)
)
import Control.Monad.IO.Unlift
Expand Down Expand Up @@ -585,6 +587,7 @@ import System.IO
import Test.Hspec
( Expectation
, HasCallStack
, pendingWith
)
import Test.Hspec.Expectations.Lifted
( expectationFailure
Expand Down Expand Up @@ -3554,3 +3557,8 @@ replaceStakeKey addr1 addr2 =
addr = either (error . show) id $
decodeAddress (sNetworkId @n) $ Bech32.encodeLenient hrp dp
in ApiAddress addr

noConway :: MonadIO m => Context -> String -> m ()
noConway ctx reason = liftIO $ do
when (_mainEra ctx == ApiConway) $
pendingWith $ "CONWAY is not supported: " <> reason
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ import Test.Integration.Framework.DSL
, json
, listAddresses
, minUTxOValue
, noConway
, notDelegating
, notRetiringPools
, patchSharedWallet
Expand Down Expand Up @@ -1811,7 +1812,7 @@ spec = describe "SHARED_TRANSACTIONS" $ do

it "SHARED_TRANSACTIONS_DELEGATION_01a - \
\Can join stakepool, rejoin another and quit" $ \ctx -> runResourceT $ do

noConway ctx "delegation"
(party1,party2) <- fixtureSharedWalletDelegating @n ctx
let depositAmt = ApiAmount 1_000_000

Expand Down
Loading

0 comments on commit 8738867

Please sign in to comment.