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

refactor: #195 verbose and porcelain are a cli feature and not in core #210

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

nroulon
Copy link
Contributor

@nroulon nroulon commented Feb 7, 2023

Verbose and trace (verbose ++) are a logger level, now every class can use it. Some log are modify, like normal mode print less (no config, summary print only executed script, …), driver print, trace can print shell command used for mongo cli and stdout of the command, …

porcelain is managed by cli module and not by core and other modules

Resolve #195

@nroulon nroulon requested a review from Lysoun February 7, 2023 17:17
Copy link
Member

@driccio driccio left a comment

Choose a reason for hiding this comment

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

Thanks for your work.

Not your fault but I don't get why -v is a suboption of a command. Would have been better to have it as a global option.

@nroulon
Copy link
Contributor Author

nroulon commented Apr 4, 2023

Agree, i will move -v and -vv as a global config in this PR.

@github-actions
Copy link

Unit Test Results

  60 files   - 1    60 suites   - 1   3m 43s ⏱️ +46s
229 tests ±0  229 ✔️ ±0  0 💤 ±0  0 ±0 
306 runs  ±0  306 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit a39846a. ± Comparison against base commit 9e94312.

This pull request removes 11 and adds 11 tests. Note that renamed tests count towards both.
datamaintain.cli.app.PrintConfigTest ‑ should print config when command is mark-script-as-exectued()
datamaintain.core.report.ReportTest$ExecuteLogs ‑ should display relative paths when porcelain is true()
datamaintain.core.report.ReportTest$ExecuteLogs ‑ should not display relative paths when porcelain is false()
datamaintain.core.report.ReportTest$ExecuteLogs ‑ should print only summary if neither verbose nor porcelain are set()
datamaintain.core.script.FileScriptTest ‑ should compute the porcelainName when porcelain is set to true()
datamaintain.core.script.FileScriptTest ‑ should not compute the porcelainName when porcelain is set to false()
datamaintain.core.step.ScannerTest ‑ should collect script porcelain names()
datamaintain.core.step.ScannerTest$PorcelainNameComputation ‑ should compute porcelainName when porcelain is set to true()
datamaintain.core.step.ScannerTest$PorcelainNameComputation ‑ should not compute porcelainName when porcelain is set to false()
datamaintain.core.util.PorcelainUtilTest ‑ should_extract_relative_path()
…
datamaintain.cli.app.PrintConfigTest ‑ should print config when command is mark-script-as-executed()
datamaintain.cli.app.update.db.MarkOneScriptAsExecutedTest$ConfigurationBuild$GenericConfiguration$Verbose ‑ should build config with trace set to true even if verbose is set()
datamaintain.cli.app.update.db.MarkOneScriptAsExecutedTest$ConfigurationBuild$GenericConfiguration$Verbose ‑ should build config with trace set to true()
datamaintain.cli.app.update.db.UpdateDbTest$ConfigurationBuild$GenericConfiguration$Verbose ‑ should build config with trace set to true even if verbose is set()
datamaintain.cli.app.update.db.UpdateDbTest$ConfigurationBuild$GenericConfiguration$Verbose ‑ should build config with trace set to true()
datamaintain.cli.app.utils.PorcelainUtilTest ‑ should_extract_relative_path()
datamaintain.cli.app.utils.PorcelainUtilTest ‑ should_extract_relative_path_without_start_slash()
datamaintain.core.report.ReportTest$ExecuteLogs ‑ should print only summary on debug()
datamaintain.core.report.ReportTest$ExecuteLogs ‑ should print only summary on trace()
datamaintain.core.report.ReportTest$ExecuteLogs ‑ should print only summary()
…

@nroulon nroulon requested a review from driccio June 13, 2023 15:34
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.

Allow access to verbose function anywhere in Datamaintain class
2 participants