Skip to content
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

Remove obsolete code for testing generation of jormungandr-config.yaml #956

Merged
merged 2 commits into from
Nov 20, 2019

Conversation

piotr-iohk
Copy link
Contributor

@piotr-iohk piotr-iohk commented Nov 4, 2019

Issue Number

#832

Overview

  • I have removed spec related to config.yaml generation
  • made that our integration tests are using config.yaml
  • added test for launch with --genesis-block-hash (passive mode)

Comments

@piotr-iohk piotr-iohk self-assigned this Nov 4, 2019
@piotr-iohk piotr-iohk changed the title Piotr/launch in passive mode tests Launch in passive mode test Nov 4, 2019
@piotr-iohk piotr-iohk force-pushed the piotr/launch-in-passive-mode-tests branch 2 times, most recently from 25e1d3b to 2b062f0 Compare November 5, 2019 09:22
@piotr-iohk piotr-iohk requested a review from rvl November 5, 2019 09:47
@piotr-iohk piotr-iohk force-pushed the piotr/launch-in-passive-mode-tests branch 2 times, most recently from ab946d2 to 5ea721b Compare November 7, 2019 12:21
@piotr-iohk
Copy link
Contributor Author

bors try

iohk-bors bot added a commit that referenced this pull request Nov 7, 2019
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Nov 7, 2019

try

Build succeeded

@piotr-iohk piotr-iohk force-pushed the piotr/launch-in-passive-mode-tests branch from 5ea721b to 66b20d1 Compare November 12, 2019 14:15

spec :: forall t. KnownCommand t => SpecWith (Context t)
spec = do
block0H <- runIO $ T.unpack <$> getBlock0HText
let configForLaunch = "test/data/jormungandr/config-for-passive-launch.yaml"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use OS-agnostic path separator here to make the reference works fine on all platforms!

import System.FilePath((</>))

let configForLaunch = "test" </> "data" </> ...

address: "/ip4/127.0.0.1/tcp/8081",
id: "1a563f5c367515f5eadc1c6c690d55320ef578fdd8c2bbe1"
}
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's that trusted peer coming from though 😶 ?
Can this list be empty (not sure of Jörmungandr behavior in this scenario)?

Also, I wonder about the potential value of such automated test. To be really interesting, we would have to connect to actual peers and see that we are processing blocks. Yet this requires a running network to connect to. I think that's something we'd better do as a nightly test, very much like the restoration test we used to have.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's that trusted peer coming from though no_mouth ?

From here -> https://github.com/input-output-hk/cardano-wallet/pull/956/files#diff-61049af2693330dca34f6fedf02ab74eR1-R5
(as the config.yaml is used to start the main jormungandr in integration tests -> https://github.com/input-output-hk/cardano-wallet/pull/956/files#diff-6309c3e81be1c6f2739233773ccb247bR52-R54)

Also, I wonder about the potential value of such automated test

The test launches a wallet and a node in a passive mode and connects to a main jormungandr. (Pretty much a Daedalus use case)
This check may be too weak -> https://github.com/input-output-hk/cardano-wallet/pull/956/files#diff-64ca464507dd45f6fad843c0767f1962R81-R85, yet, again, this is what Daedalus is doing. (see: #1009 (comment))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. We can't actually rely on 8081 to always be available on the machine, especially in CI.
This setup requires a bit more effort and is something we'll work out for the nightly tests! I'll open a corresponding ticket on the laboratory to capture this and close this PR if you don't mind ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, would it make sense then to rework this PR and leave the first commit actually (without modifications to config.yaml)? It is about removing old test code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmmm. But we still do use that code actually. The call to genConfigYaml is essential to make sure we run various executions of Jörmungandr using different state directory.

The public_address part is probably obsolete now however, because this can now be removed entirely from the configuration file and we have no particular use for it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait a minute.. I think you're right actually 🤔 ... even the storage directory, it isn't taken from the configuration anymore...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. We are no longer generating config.yaml for jormungandr like we used to.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, so we can indeed keep that first commit modulo the public_id addition in the configuration file.
Eventually, we should even get rid of:

            [ "--secret", testDataDir </> "secret.yaml"
            , "--config" , testDataDir </> "config.yaml"
            ]

which should be done at the call-site and not from this function.

@piotr-iohk piotr-iohk force-pushed the piotr/launch-in-passive-mode-tests branch from 66b20d1 to 9287c5f Compare November 13, 2019 22:09
@piotr-iohk piotr-iohk changed the title Launch in passive mode test Remove obsolete code for testing generation of jormungandr-config.yaml Nov 20, 2019
@piotr-iohk piotr-iohk force-pushed the piotr/launch-in-passive-mode-tests branch from 9287c5f to 80faee2 Compare November 20, 2019 15:13
@@ -80,7 +80,7 @@ prop_combineDefaults
prop_combineDefaults mStake = do
combineMetrics mStake Map.empty Map.empty
===
(Right $ Map.map (, Quantity 0, 0) mStake)
Right (Map.map (, Quantity 0, 0) mStake)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm. Why not 😅 ...

@KtorZ
Copy link
Member

KtorZ commented Nov 20, 2019

bors r+

iohk-bors bot added a commit that referenced this pull request Nov 20, 2019
956: Remove obsolete code for testing generation of jormungandr-config.yaml r=KtorZ a=piotr-iohk

# Issue Number

#832 

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [ ] I have removed spec related to `config.yaml` generation
- [ ] made that our integration tests are using `config.yaml`
- [ ] ~added test for `launch` with `--genesis-block-hash` (passive mode)~


# Comments

<!-- 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)
 ✓ Once created, link this PR to its corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
-->


Co-authored-by: Piotr Stachyra <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Nov 20, 2019

Build succeeded

@iohk-bors iohk-bors bot merged commit 80faee2 into master Nov 20, 2019
@KtorZ KtorZ deleted the piotr/launch-in-passive-mode-tests branch November 20, 2019 16:15
@KtorZ KtorZ added this to the Support Delegated Addresses milestone Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants