-
Notifications
You must be signed in to change notification settings - Fork 220
Automatically sync the Rocrate and README content during pipelines lint #3688
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
Changes from 2 commits
b91e8e9
2deaeef
fc9d3b9
e4c87a4
6b71393
5b32f47
9224c28
b78edae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,25 +12,6 @@ def test_rocrate_readme_sync_pass(self): | |
| assert len(results.get("failed", [])) == 0 | ||
| assert len(results.get("passed", [])) > 0 | ||
|
|
||
| def test_rocrate_readme_sync_fail(self): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this test is still valid, no?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed it because there won't be any "failed" cases anymore👀 shall I always keep the tests for all cases?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We still have the error (at
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There won't be failed cases if I remove all the checks such as |
||
| self.lint_obj._load() | ||
|
|
||
| json_path = Path(self.lint_obj.wf_path, "ro-crate-metadata.json") | ||
| with open(json_path) as f: | ||
| try: | ||
| rocrate = json.load(f) | ||
| except json.JSONDecodeError as e: | ||
| raise UserWarning(f"Unable to load JSON file '{json_path}' due to error {e}") | ||
| rocrate["@graph"][0]["description"] = "This is a test script" | ||
| with open(json_path, "w") as f: | ||
| json.dump(rocrate, f, indent=4) | ||
| results = self.lint_obj.rocrate_readme_sync() | ||
| assert len(results.get("failed", [])) == 1 | ||
| assert ( | ||
| "The RO-Crate descriptions do not match the README.md content. Use `nf-core pipelines lint --fix rocrate_readme_sync` to update." | ||
| in results.get("failed", []) | ||
| ) | ||
|
|
||
| def test_rocrate_readme_sync_fixed(self): | ||
| self.lint_obj._load() | ||
| json_path = Path(self.lint_obj.wf_path, "ro-crate-metadata.json") | ||
|
|
@@ -43,12 +24,6 @@ def test_rocrate_readme_sync_fixed(self): | |
| with open(json_path, "w") as f: | ||
| json.dump(rocrate, f, indent=4) | ||
|
|
||
| results = self.lint_obj.rocrate_readme_sync() | ||
| assert len(results.get("failed", [])) == 1 | ||
|
|
||
| # Fix the issue | ||
| assert "rocrate_readme_sync" in self.lint_obj.lint_tests | ||
| self.lint_obj.fix = ["rocrate_readme_sync"] | ||
| self.lint_obj._load() | ||
| results = self.lint_obj.rocrate_readme_sync() | ||
| assert len(results.get("failed", [])) == 0 | ||
| assert len(results.get("fixed", [])) == 1 | ||
Uh oh!
There was an error while loading. Please reload this page.