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

core: Cover Init & IsInit funcs with additional tests #90

Closed
Bidon15 opened this issue Sep 28, 2021 · 1 comment
Closed

core: Cover Init & IsInit funcs with additional tests #90

Bidon15 opened this issue Sep 28, 2021 · 1 comment
Labels
area:core_and_app Relationship with Core node and Celestia-App area:storage

Comments

@Bidon15
Copy link
Member

Bidon15 commented Sep 28, 2021

At the moment, we only have 1 happy test-case for the core's initialisation
For more quality assurance, we should consider adding such test-cases to core

Negative test-cases, such as:

  • invalid paths
  • playing around with generated files(mocks)

Positive test-cases, such as:

  • custom paths
@Bidon15 Bidon15 added area:storage area:core_and_app Relationship with Core node and Celestia-App labels Sep 28, 2021
@renaynay
Copy link
Member

Closing as we removed embedded node option

distractedm1nd added a commit to distractedm1nd/celestia-node that referenced this issue Sep 6, 2022
…f a PR (celestiaorg#90)

* refactor(node): state module improvements

* Move settings, opts and config out of `node/node` back to `node`
* `state` pkg module improvements
	* Absorb Config and options from `node/key` pkg
	* Don't use core.Config on Module constructor and take from the DI instead
	* Use node Type and Config  on Module constructor
* first steps towarads `core` pkg modulazation

* chore(swamp): fix linter by shortening import alias

* refactor: moving header to subpackage

* refactor: moving share components to share subpackage

* chore: basic linting

* refactor/chore: renaming services and methods to satisfy linter

* refactor: moving node construction to node/module.go

* refactor: rpc and core subpackages

* refactor: building node in /node/module.go, rpc and core fixes for tests

* refactor: modularized daser and simplified node/module.go

* refactor: passing configs by ref to actually modify node.Config, moving p2p opts, removing config_opts, renaming files to match new scheme

* refactor(node): move some global node options to their respective node modules

* refactor: unexporting moduleOpts and fields

* refactor: variadic options for modules

* refactor: removing lifecycle hooks

* refactor: renaming node to nodebuilder

* refactor: implementing review comments

* fix: renaming test directories to nodebuilder

* refactor: config setters separated from options, writing config to env for persisting options during initialization

* refactor: minor review comments (cleaning clutter to get to the juicy stuff)

* refactor: exporting share.Discovery, providing it directly, removing Full and Light availability constructors in nodebuilder/share

* refactor: providing header service directly in module

* refactor: making InitStore invoke directly without returning a function, removing dead code

* fix: fixing issue where flags do not persist when init is called twice

Co-authored-by: renaynay <renaynay@users.noreply.github.com>

* chore: removing dead code

* refactor: deferring setting node config during flag parsing

* refactor: collapsing switch in DefaultConfig

* refactor: removing nodebuilder/daser/daser.go

* refactor: fx lifecycle in for core/remote

* chore: imports

* refactor: removing all setters, moving checks to construction

* refactor: adding cfg.ValidateBasic to each nodebuilder module

* refactor: moving core sanity checks to cfg.ValidateBasic and populating default conf

* fix: replacing IP on sanity check

* renaming to sanitizeIP

Co-authored-by @Wondertan 
Co-authored-by: Ryan <ryanford@poluglottos.com>
Co-authored-by: renaynay <renaynay@users.noreply.github.com>
renaynay added a commit that referenced this issue Sep 23, 2022
…modules (#997)

* refactor: implement better node pkg structuring for node/state pkg

* refactor: rename node/config pkg to node/node

* refactor(node/state): Use fx annotation from #923

* refactor(node/state): use constructor from state pkg directly

* fix: review suggestions

* refactor(node): state module improvements and PR review in the form of a PR (#90)

* refactor(node): state module improvements

* Move settings, opts and config out of `node/node` back to `node`
* `state` pkg module improvements
	* Absorb Config and options from `node/key` pkg
	* Don't use core.Config on Module constructor and take from the DI instead
	* Use node Type and Config  on Module constructor
* first steps towarads `core` pkg modulazation

* chore(swamp): fix linter by shortening import alias

* refactor: moving header to subpackage

* refactor: moving share components to share subpackage

* chore: basic linting

* refactor/chore: renaming services and methods to satisfy linter

* refactor: moving node construction to node/module.go

* refactor: rpc and core subpackages

* refactor: building node in /node/module.go, rpc and core fixes for tests

* refactor: modularized daser and simplified node/module.go

* refactor: passing configs by ref to actually modify node.Config, moving p2p opts, removing config_opts, renaming files to match new scheme

* refactor(node): move some global node options to their respective node modules

* refactor: unexporting moduleOpts and fields

* refactor: variadic options for modules

* refactor: removing lifecycle hooks

* refactor: renaming node to nodebuilder

* refactor: implementing review comments

* fix: renaming test directories to nodebuilder

* refactor: config setters separated from options, writing config to env for persisting options during initialization

* refactor: minor review comments (cleaning clutter to get to the juicy stuff)

* refactor: exporting share.Discovery, providing it directly, removing Full and Light availability constructors in nodebuilder/share

* refactor: providing header service directly in module

* refactor: making InitStore invoke directly without returning a function, removing dead code

* fix: fixing issue where flags do not persist when init is called twice

Co-authored-by: renaynay <renaynay@users.noreply.github.com>

* chore: removing dead code

* refactor: deferring setting node config during flag parsing

* refactor: collapsing switch in DefaultConfig

* refactor: removing nodebuilder/daser/daser.go

* refactor: fx lifecycle in for core/remote

* chore: imports

* refactor: removing all setters, moving checks to construction

* refactor: adding cfg.ValidateBasic to each nodebuilder module

* refactor: moving core sanity checks to cfg.ValidateBasic and populating default conf

* fix: replacing IP on sanity check

* renaming to sanitizeIP

Co-authored-by @Wondertan
Co-authored-by: Ryan <ryanford@poluglottos.com>
Co-authored-by: renaynay <renaynay@users.noreply.github.com>

* Fix issues with config persistence / invoking validation on config (#95)

* fix config

* make sure to save config before starting node, otherwise all overrides are lost

* chore: lint

* refactor|test(nodebuilder/tests): update fraud tests to use new nodebuilder configuration functionality

* refactor(nodebuilder/header): adapt Fraud (with syncer) to refactoring changes

* refactor(nodebuilder/header): restore logic that syncer fails with Warn if no chain head

* fix(tests): fixing TestFraudProofSyncing

* fix(cmd): not persisting config with flags on start

* refactor(nodebuilder): consistent baseComponents, adding back daser proxy constructor, renaming Loader to ConfigLoader

* lint: fixing goimports after rebase

* refactor: implement better node pkg structuring for node/state pkg

* refactor: rename node/config pkg to node/node

* refactor(node/state): Use fx annotation from #923

* refactor(node/state): use constructor from state pkg directly

* fix: review suggestions

* refactor(node): state module improvements and PR review in the form of a PR (#90)

* refactor(node): state module improvements

* Move settings, opts and config out of `node/node` back to `node`
* `state` pkg module improvements
	* Absorb Config and options from `node/key` pkg
	* Don't use core.Config on Module constructor and take from the DI instead
	* Use node Type and Config  on Module constructor
* first steps towarads `core` pkg modulazation

* chore(swamp): fix linter by shortening import alias

* refactor: moving header to subpackage

* refactor: moving share components to share subpackage

* chore: basic linting

* refactor/chore: renaming services and methods to satisfy linter

* refactor: moving node construction to node/module.go

* refactor: rpc and core subpackages

* refactor: building node in /node/module.go, rpc and core fixes for tests

* refactor: modularized daser and simplified node/module.go

* refactor: passing configs by ref to actually modify node.Config, moving p2p opts, removing config_opts, renaming files to match new scheme

* refactor(node): move some global node options to their respective node modules

* refactor: unexporting moduleOpts and fields

* refactor: variadic options for modules

* refactor: removing lifecycle hooks

* refactor: renaming node to nodebuilder

* refactor: implementing review comments

* fix: renaming test directories to nodebuilder

* refactor: config setters separated from options, writing config to env for persisting options during initialization

* refactor: minor review comments (cleaning clutter to get to the juicy stuff)

* refactor: exporting share.Discovery, providing it directly, removing Full and Light availability constructors in nodebuilder/share

* refactor: providing header service directly in module

* refactor: making InitStore invoke directly without returning a function, removing dead code

* fix: fixing issue where flags do not persist when init is called twice

Co-authored-by: renaynay <renaynay@users.noreply.github.com>

* chore: removing dead code

* refactor: deferring setting node config during flag parsing

* refactor: collapsing switch in DefaultConfig

* refactor: removing nodebuilder/daser/daser.go

* refactor: fx lifecycle in for core/remote

* chore: imports

* refactor: removing all setters, moving checks to construction

* refactor: adding cfg.ValidateBasic to each nodebuilder module

* refactor: moving core sanity checks to cfg.ValidateBasic and populating default conf

* fix: replacing IP on sanity check

* renaming to sanitizeIP

Co-authored-by @Wondertan
Co-authored-by: Ryan <ryanford@poluglottos.com>
Co-authored-by: renaynay <renaynay@users.noreply.github.com>

* Fix issues with config persistence / invoking validation on config (#95)

* fix config

* make sure to save config before starting node, otherwise all overrides are lost

* chore: lint

* refactor|test(nodebuilder/tests): update fraud tests to use new nodebuilder configuration functionality

* refactor(nodebuilder/header): adapt Fraud (with syncer) to refactoring changes

* refactor(nodebuilder/header): restore logic that syncer fails with Warn if no chain head

* fix(tests): fixing TestFraudProofSyncing

* fix(cmd): not persisting config with flags on start

* refactor(nodebuilder): consistent baseComponents, adding back daser proxy constructor, renaming Loader to ConfigLoader

* lint: fixing goimports after rebase

* chore(docs): removing multiline todo from godoc comment for new gofmt compliance

* fix(test): Fixing rpc test from rebase

* refactor(nodebuilder/fraud): Move fraud-related constructors into separate module

* refactor(service/rpc): Wrap port parsing error

* refactor(nodebuilder|service): Wrap config error messages with pkg name

* refactor(nodebuilder): cfg.ValidateBasic -> cfg.Validate

* refactor(nodebuilder): Move refresh routing period check into config validation and fix err check in rpc/config

* refactor(das | nodebuilder/p2p): apply suggestions from @Wondertan approval review

* fix(cmd): replace logger in cmd after rebase/merge conflict issues

* refactor(cmd): set context with config at end of parsing, not in every individual flag parsing func

* refactor(cmd): simplify returns in flags_p2p

Co-authored-by: Ryan <ryanford@poluglottos.com>
Co-authored-by: Hlib Kanunnikov <hlibwondertan@gmail.com>
Co-authored-by: renaynay <renaynay@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core_and_app Relationship with Core node and Celestia-App area:storage
Projects
None yet
Development

No branches or pull requests

2 participants