From b1361c8e79c829f52c49920c2f74353124f1a00a Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Sun, 31 Dec 2023 18:20:43 +0200 Subject: [PATCH 1/2] Separate collection and non-collection data element in tool schema. New lxml is more strict when validating the xml schema and fails with ``` lxml.etree.XMLSchemaParseError: complex type 'Output': The content model is not determinist., line 5329 ``` this is because `filter` and `discover_datasets` are present in OutputDataElement and OutputCollectionElement, making ``` ``` not deterministic. In any case this isn't an accurate model of what is allowed and parsed, as you can't use collection-specific discover_datasets options outside of a dataset collection. I **think** that the reason for adding OutputCollectionElement to the sequence is that you can have a `data` element nested in a `collection` element. To continue allowing this and making it more precise I've added an additional `OutputCollectionDataElement` type that is allowed within `collection`. This then should allow us to remove `OutputCollectionElement` from the `OutputData` type. A quick test against IUC and devteam revealed no problem with this approach per se, however it showed that https://github.com/galaxyproject/tools-iuc/blob/aa8360cb3ec9faf1488938a430855977632706ff/tools/krakentools/extract_kraken_reads.xml#L145 uses `change_format` which is not implemented for collections. --- lib/galaxy/tool_util/xsd/galaxy.xsd | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tool_util/xsd/galaxy.xsd b/lib/galaxy/tool_util/xsd/galaxy.xsd index 01ac39775ac3..445dbe1be17c 100644 --- a/lib/galaxy/tool_util/xsd/galaxy.xsd +++ b/lib/galaxy/tool_util/xsd/galaxy.xsd @@ -5282,12 +5282,20 @@ on Human (hg18)``. - + + + + + + + + + - From 4027c99350ba068f87e9c5e7887095350cd011ae Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 1 Jan 2024 10:07:30 +0200 Subject: [PATCH 2/2] Skip test when ftp.gnu.org not available --- test/unit/files/test_ftp.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/unit/files/test_ftp.py b/test/unit/files/test_ftp.py index 55b63944dc01..0a8d3018344d 100644 --- a/test/unit/files/test_ftp.py +++ b/test/unit/files/test_ftp.py @@ -1,5 +1,8 @@ import os +import pytest +from fs.errors import RemoteConnectionError + from ._util import ( assert_realizes_contains, configured_file_sources, @@ -19,12 +22,15 @@ def test_file_source_ftp_specific(): assert file_source_pair.path == test_url assert file_source_pair.file_source.id == "test1" - assert_realizes_contains( - file_sources, - test_url, - "This is ftp.gnu.org, the FTP server of the the GNU project.", - user_context=user_context, - ) + try: + assert_realizes_contains( + file_sources, + test_url, + "This is ftp.gnu.org, the FTP server of the the GNU project.", + user_context=user_context, + ) + except RemoteConnectionError: + pytest.skip("ftp.gnu.org not available") def test_file_source_ftp_generic():