planemo icon indicating copy to clipboard operation
planemo copied to clipboard

Using `expect_test_failure` causes lint to fail

Open elichad opened this issue 4 years ago • 6 comments

The expect_test_failure test attribute was added in Galaxy 22.01 (https://github.com/galaxyproject/galaxy/pull/10304), but using it causes a linting error as 'not allowed':

.. ERROR: Invalid XML found in file: pm_muairss_write.xml. 
Errors [/tmp/tmpp56zw22j:111:0:ERROR:SCHEMASV:SCHEMAV_CVC_COMPLEX_TYPE_3_2_1: Element 'test', attribute 'expect_test_failure': The attribute 'expect_test_failure' is not allowed.]

The tests themselves work fine, it's only the linting that fails. I'm using Planemo v0.74.9

elichad avatar Apr 21 '22 17:04 elichad

A release of galaxy-tool-util for 22.01 is needed. Ping @jmchilton @mvdbeek

@elichad out of interest : what is the use case for this attribute in this test? I'm surprised to see it used in normal tool tests..

bernt-matthias avatar Apr 27 '22 07:04 bernt-matthias

I have a tool which accepts four different data types, but one of the data types is failing due to a bug in our package upstream. We have identical tests for each data type which use <assert_contents> on the output, and I prefer to mark an expected failure temporarily rather than rely on remembering to add the test later when the bug is fixed. https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/blob/cifxyz/pm_muairss_write/pm_muairss_write.xml#L111

elichad avatar Apr 27 '22 10:04 elichad

That is the underlying program produces wrong output that does not match the assertion? Sounds like a great use case for expect_test_failure.

bernt-matthias avatar Apr 27 '22 12:04 bernt-matthias

It actually just raises an error and doesn't produce any output, but expect_failure doesn't like it (edit: fails in planemo test) if you have output tests as well

elichad avatar Apr 27 '22 12:04 elichad

I'm surprised that this works in planemo test .. is the program producing a nonzero exit code?

bernt-matthias avatar Apr 27 '22 13:04 bernt-matthias

Yes, it's nonzero.

elichad avatar Apr 27 '22 13:04 elichad

I think the linting issue should be fixed in the latest planemo releases, and we have a couple of tests in the iuc that use expect_failure , so I'll close this as likely fixed.

mvdbeek avatar Oct 19 '22 15:10 mvdbeek