Skip to content

Commit

Permalink
adapt linter names in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed May 2, 2024
1 parent 702167d commit 14519c9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,26 @@ def test_fail_tools(self):

def test_lint_default(self):
with self._isolate_repo("single_tool"):
self._check_exit_code(["lint", "--skip", "citations"])
self._check_exit_code(["lint", "--skip", "CitationsMissing"])

This comment has been minimized.

Copy link
@mvdbeek

mvdbeek May 2, 2024

Member

This seems like the wrong way around, existing invocations should continue to work IMO.

This comment has been minimized.

Copy link
@bernt-matthias

bernt-matthias May 2, 2024

Author Contributor

Each of these skip names corresponded to the name of one of the old linter functions and this connection is made automatically (https://github.com/galaxyproject/galaxy/blob/33f77b4e24e18b2f95cd50c6d7ac11c2da3885d0/lib/galaxy/tool_util/lint.py#L218).

I cant think of a good way that would fix this the other way round.

This comment has been minimized.

Copy link
@bernt-matthias

bernt-matthias May 2, 2024

Author Contributor

The commit was intended for #1441 anyway. I moved it over.

with self._isolate_repo("single_tool"):
self._check_exit_code(["lint"], exit_code=1)

def test_lint_multiple(self):
names = ["fail_citation.xml", "fail_order.xml"]
paths = list(map(lambda p: os.path.join(TEST_TOOLS_DIR, p), names))
self._check_exit_code(["lint"] + paths, exit_code=1)
self._check_exit_code(["lint", "--skip", "citations,xml_order"] + paths, exit_code=0)
self._check_exit_code(["lint", "--skip", "CitationsMissing,XMLOrder"] + paths, exit_code=0)

def test_skips(self):
fail_citation = os.path.join(TEST_TOOLS_DIR, "fail_citation.xml")
lint_cmd = ["lint", fail_citation]
self._check_exit_code(lint_cmd, exit_code=1)

lint_cmd = ["lint", "--skip", "citations", fail_citation]
lint_cmd = ["lint", "--skip", "CitationsMissing", fail_citation]
self._check_exit_code(lint_cmd, exit_code=0)

# Check string splitting and stuff.
lint_cmd = ["lint", "--skip", "xml_order, citations", fail_citation]
lint_cmd = ["lint", "--skip", "XMLOrder, CitationsMissing", fail_citation]
self._check_exit_code(lint_cmd, exit_code=0)

# Check skip_file (containing the same skips)
Expand All @@ -71,16 +71,16 @@ def test_recursive(self):
nested_dir = os.path.join(TEST_REPOS_DIR, "multi_repos_nested")

# Fails to find any tools without -r.
lint_cmd = ["lint", "--skip", "citations", nested_dir]
lint_cmd = ["lint", "--skip", "CitationsMissing", nested_dir]
self._check_exit_code(lint_cmd, exit_code=2)

# Works with -r.
lint_cmd = ["lint", "--skip", "citations", "-r", nested_dir]
lint_cmd = ["lint", "--skip", "CitationsMissing", "-r", nested_dir]
self._check_exit_code(lint_cmd, exit_code=0)

def test_empty_cdata(self):
empty_cdata = os.path.join(TEST_TOOLS_DIR, "empty_cdata.xml")
lint_cmd = ["lint", "--skip", "citations,help", empty_cdata]
lint_cmd = ["lint", "--skip", "CitationsMissing,HelpEmpty", empty_cdata]
self._check_exit_code(lint_cmd, exit_code=0)

def test_lint_doi(self):
Expand Down

0 comments on commit 14519c9

Please sign in to comment.