qiime2 / q2-metadata

BSD 3-Clause "New" or "Revised" License
3 stars 17 forks source link

Test suite failure #55

Closed tillea closed 1 year ago

tillea commented 1 year ago

Bug Description FAILED q2_metadata/tests/test_tabulate.py::TestUsageExamples::test_examples

Steps to reproduce the behavior I wanted to upgrade the Debian package of q2-metadata. You can find the full build log in the Debian development Git. It says:

_______________________ TestUsageExamples.test_examples ________________________
format_str = 'QualityFilterStatsDirFmt'
    def parse_format(format_str):
        if format_str is None:
            return None

        pm = qiime2.sdk.PluginManager()
        try:
>           format_record = pm.formats[format_str]
E           KeyError: 'QualityFilterStatsDirFmt'
/usr/lib/python3/dist-packages/qiime2/sdk/util.py:90: KeyError
During handling of the above exception, another exception occurred:
self = <q2_metadata.tests.test_tabulate.TestUsageExamples testMethod=test_examples>
    def test_examples(self):
>       self.execute_examples()
q2_metadata/tests/test_tabulate.py:108:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/qiime2/plugin/testing.py:263: in execute_examples
    example_f(use)
q2_metadata/_examples.py:22: in tabulate_example
    stats = use.init_artifact_from_url('demux_stats', stats_url)
/usr/lib/python3/dist-packages/qiime2/sdk/usage.py:990: in init_artifact_from_url
    return self.init_artifact(name, factory)
/usr/lib/python3/dist-packages/qiime2/sdk/usage.py:1607: in init_artifact
    variable.execute()
/usr/lib/python3/dist-packages/qiime2/sdk/usage.py:581: in execute
    self.value = self.factory()
/usr/lib/python3/dist-packages/qiime2/sdk/usage.py:981: in factory
    result = qiime2.Artifact.load(f.name)
/usr/lib/python3/dist-packages/qiime2/sdk/result.py:79: in load
    archiver = archive.Archiver.load(filepath)
/usr/lib/python3/dist-packages/qiime2/core/archive/archiver.py:372: in load
    ref = cls(data_path, process_alias, Format(rec), cache)
/usr/lib/python3/dist-packages/qiime2/core/archive/format/v1.py:29: in __init__
    super().__init__(archive_record)
/usr/lib/python3/dist-packages/qiime2/core/archive/format/v0.py:73: in __init__
    self.format = sdk.parse_format(format)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
format_str = 'QualityFilterStatsDirFmt'
    def parse_format(format_str):
        if format_str is None:
            return None

        pm = qiime2.sdk.PluginManager()
        try:
            format_record = pm.formats[format_str]
        except KeyError:
>           raise TypeError("No format: %s" % format_str)
E           TypeError: No format: QualityFilterStatsDirFmt
/usr/lib/python3/dist-packages/qiime2/sdk/util.py:92: TypeError
---------- coverage: platform linux, python 3.11.1-final-0 -----------

Expected behavior Just passing the full test suite you are providing.

Computation Environment

Kind regards, Andreas.

ebolyen commented 1 year ago

Hey @tillea,

That lines up with a failure we recently experienced when we added a usage example in https://github.com/qiime2/q2-metadata/pull/49

It created a dependency on q2-quality-filter which defines that missing format (https://github.com/qiime2/q2-metadata/pull/49/commits/7a15d2e9ac681efd9a506973b51f40cadd165f3c) which I expect is not part of your dependency system.

We've since dropped those examples as it wasn't really a goal to induce that dependency in the first place: https://github.com/qiime2/q2-metadata/pull/54

So for the current release, updating the deps in your build system ought to get that working, and then the next release (2023.2) will go back to the original set of dependencies.

ebolyen commented 1 year ago

Closing for now, but let me know if I misunderstood the situation :)