-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Various extensions and improvements for asserts #12528
Conversation
has_n_columns
, has_size
and has_n_lines
assertions
Amazing! |
I'm not sure I see the benefit of For |
You have a point here .. but for Maybe we can leave it because it makes it a bit easier for tool developers to switch from |
While we are at it we can also think about other useful extensions. Just thought that asserting a min/max number of lines/size/columns might be nice. But these could be separate new assertions as well. |
Ping @jmchilton since you wrote this TODO
|
has_n_columns
, has_size
and has_n_lines
assertionshas_n_columns
, has_size
and has_n_lines
assertions; and other improvements for asserts
46e14e5
to
d1ad4c6
Compare
has_n_columns
, has_size
and has_n_lines
assertions; and other improvements for assertshas_n_columns
, has_size
and has_n_lines
assertions; add linting for assertions and other improvements for asserts
f52a798
to
44ba8d0
Compare
2447fd9
to
9d1b62e
Compare
@simonbray I removed For the
.. For the assertions the argumentation does not work that well. Because the expected size |
9d1b62e
to
6da192e
Compare
I guess it is no problem to add it, if it is more intuitive to use than the way I suggested. |
5f25d9e
to
fbe06fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this is ready to merge @bernt-matthias ?
@mvdbeek .. nearly. I still need to execute my first TODO, i.e. check if I did not change functionality of the assertions: by creating a backport PR of the new linter tests (minus those that check new arguments) Guess I can do this today and will ping you. Would also be handy for the other linter PR (guess this needs a bit of merging). |
@@ -0,0 +1,1012 @@ | |||
import os | |||
import shutil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing!
I opened a PR applying most of the new tests on the old assertion code #13241 There a few tests failing. In my opinion all of these cases are bugs of the old code .. but other people might think its change of functionality. So here are the cases and my explanation element_text_is failure The text of the
It did not because
Now element_text failure
I think in the old code this would also work if there We can easily change the new implementation to also pass has_archive_member non-archive Applying a Now the assertion just fails. has_archive_member zip absent member Applying a has_archive_member tar absent member Same as above has_archive_member tar non-file member Here the used path matches only for a directory in the zipfile. This is due to an inconsistency how zip and tar handle has_archive_member zip with content assertion If there are multiple members matching the path (note that Since the order of the matches was undefined this easily In the new implementation the matching members are sorted. |
Sooo, we merge ? |
Fine with merging from my side. |
This PR was merged without a "kind/" label, please correct. |
since the allow extensions: (K|M|G|T|P|E)i follow up on galaxyproject#12528
with the added typing -- in particular Optional[int] (ie Union[int, None]) -- the tests in the assertions would have gone much more complicated since galaxyproject#12528 they are also covered by the xsd and therefor not really needed
since the allow extensions: (K|M|G|T|P|E)i follow up on galaxyproject#12528
with the added typing -- in particular Optional[int] (ie Union[int, None]) -- the tests in the assertions would have gone much more complicated since galaxyproject#12528 they are also covered by the xsd and therefor not really needed
implemented herehttps://github.com/galaxyproject/galaxy/pull/12528
implemented herehttps://github.com/galaxyproject/galaxy/pull/12528
implemented herehttps://github.com/galaxyproject/galaxy/pull/12528
for has_n_columns follow up on galaxyproject#12528
forgotten here galaxyproject#12528 but I guess we do not need to backport further since it only affects the tool linting xsd check
forgotten here galaxyproject#12528 but I guess we do not need to backport further since it only affects the tool linting xsd check
Changes to text, size, tabular, archive, and xml assertions:
n
,delta
,min
,max
for all of them (previously onlydelta
inhas_size
). I hope that we can save lots of test data files, since this can replace<output compare="sim_size">
.xml_element
assertion andhas_n_elements_with_path
supportn
,delta
,min
,max
negate
attributeChanges to
has_n_columns
wanted to use a
has_n_columns
for this file https://github.com/galaxyproject/tools-iuc/blob/master/tools/stacks2/test-data/populations/populations.sumstats.tsv which is not useful due to the leading comment lines which have different numbers of columns. This PR adds a new attributecomment
to the tag which allows to ignore comment lines for the assertion.Furthermore:
xml assertions
xml_element
assertion which generalizes all other xml assertionsassert_xml_element
Tests and xsd changes
More
element_text_is
andattribute_is
: they also allowed only a prefix matchingTODO (input needed):
len(x) == 1
to allow for reformulation)n
,delta
,min
,max
to allow for500k
,50M
, ...str
(because the parser does not parse them toint
,...),None
(i.e. this is currently not consistent) .. but I have no idea what it is good forgalaxy/lib/galaxy/tool_util/verify/asserts/text.py
Line 8 in 7335edd
negate
?has_archive_member
andelement_text
passedNone
to contained assertions. This has been changed .. so not necessary anymoren
/value
xml_element
assertion andhas_n_elements_with_path
negate
How to test the changes?
(Select all options that apply)
License