-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add era-specific integration test assertions #2483
Conversation
<$> poolConfigsFromEnv | ||
<*> clusterEraFromEnv defaultEra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was intended for running the integration tests on multiple eras on the same run.
Now I want to retrieve the clusterEra
independently.
Arguably, a localClusterConfigFromEnv :: ClusterEra -> IO LocalClusterConfig
that doesn't use clusterEraFromEnv
internally might be neater in that case, but 🤷♂️
@@ -416,9 +418,17 @@ data ClusterEra | |||
| MaryHardFork | |||
deriving (Show, Read, Eq, Ord, Bounded, Enum) | |||
|
|||
-- | Convert @ClusterEra@ to a @ApiEra@. | |||
clusterToApiEra :: ClusterEra -> ApiEra | |||
clusterToApiEra = \case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could replace ClusterEra
with ApiEra
, but I think this is fine. Maybe they diverge sometime.
78c06ab
to
dd07b54
Compare
bors try |
tryBuild failed: |
dd07b54
to
ed34ad0
Compare
bors try |
lib/core-integration/src/Test/Integration/Scenario/API/Shelley/Network.hs
Outdated
Show resolved
Hide resolved
lib/core-integration/src/Test/Integration/Scenario/API/Shelley/Network.hs
Outdated
Show resolved
Hide resolved
tryBuild failed:
|
The fork is at genesis. If the node has synced anything (which we should be able to expect), then we shouldn't need the eventually. A recent change in the NetworkLayer also causes the wallet to block until it can retrieve the node's PParams, further decreasing the risk of something unexpected being returned here.
ed34ad0
to
78bef42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
bors r+ |
2483: Add era-specific integration test assertions r=Anviking a=Anviking # Issue Number ADP-681 # Overview - [x] Add a `_mainEra :: ApiEra` to the test `Context` - [x] GET /network/parameters `eras` object should be non-Nothing for `byron .. mainEra`, and Nothing for the rest. - [x] GET /network/information `node_era` `shouldBe` `mainEra` - [x] Remove redundant eventually # Comments - [x] Do these tests _actually_ cover a faulty implementation? -> Yes (if run manually on all eras) - When replacing `QueryIfCurrentMary` with `QueryIfCurrentAllegra` - `LOCAL_CLUSTER_ERA=mary` -> uncaught - `LOCAL_CLUSTER_ERA=allegra` caught (error below) - `LOCAL_CLUSTER_ERA=shelley` uncaught ``` For era: ApiMary While verifying (Status {statusCode = 200, statusMessage = "OK"},Right (ApiNetworkParameters {genesisBlockHash = ApiT {getApiT = Hash "G\204\242\&0\STXQ\253D\STX&9\254\200\134\230\207\207\222\DC1\206\177B\201\175>\SUB\b\244\EMr/?"}, blockchainStartTime = ApiT {getApiT = StartTime 2021-02-01 13:07:11 UTC}, slotLength = Quantity {getQuantity = 0.2s}, epochLength = Quantity {getQuantity = 50}, securityParameter = Quantity {getQuantity = 5}, activeSlotCoefficient = Quantity {getQuantity = 50.0}, decentralizationLevel = Quantity {getQuantity = Percentage {getPercentage = 3 % 4}}, desiredPoolNumber = 3, minimumUtxoValue = Quantity {getQuantity = 1000000}, eras = ApiEraInfo {byron = Just (ApiEpochInfo {epochNumber = ApiT {getApiT = EpochNo {unEpochNo = 0}}, epochStartTime = 2021-02-01 13:07:11 UTC}), shelley = Just (ApiEpochInfo {epochNumber = ApiT {getApiT = EpochNo {unEpochNo = 0}}, epochStartTime = 2021-02-01 13:07:11 UTC}), allegra = Just (ApiEpochInfo {epochNumber = ApiT {getApiT = EpochNo {unEpochNo = 0}}, epochStartTime = 2021-02-01 13:07:11 UTC}), mary = Just (ApiEpochInfo {epochNumber = ApiT {getApiT = EpochNo {unEpochNo = 0}}, epochStartTime = 2021-02-01 13:07:11 UTC})}})) expected: Nothing but got: Just (ApiEpochInfo {epochNumber = ApiT {getApiT = EpochNo {unEpochNo = 0}}, epochStartTime = 2021-02-01 13:07:11 UTC}) ``` <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket ✓ Acknowledge any changes required to the Wiki ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages. --> Co-authored-by: Johannes Lund <johannes.lund@iohk.io>
Build failed:
|
bors r+ |
Build succeeded: |
Issue Number
ADP-681
Overview
_mainEra :: ApiEra
to the testContext
eras
object should be non-Nothing forbyron .. mainEra
, and Nothing for the rest.node_era
shouldBe
mainEra
Comments
QueryIfCurrentMary
withQueryIfCurrentAllegra
LOCAL_CLUSTER_ERA=mary
-> uncaughtLOCAL_CLUSTER_ERA=allegra
caught (error below)LOCAL_CLUSTER_ERA=shelley
uncaught