avocado-framework / avocado

Avocado is a set of tools and libraries to help with automated testing. One can call it a test framework with benefits. Native tests are written in Python and they follow the unittest pattern, but any executable can serve as a test.
https://avocado-framework.github.io/
Other
336 stars 335 forks source link

Avocado fails with dependency duplicates #5904

Closed richtja closed 2 months ago

richtja commented 2 months ago

Describe the bug When the avocado test is run with two same dependencies, the avocado fails on running them. This might cause real trouble with #5504.

Steps to reproduce

$ avocado run -- passtest_with_dependency.py passtest_with_dependency.py passtest_with_dependency.py

from avocado import Test

class PassTest(Test):
    """
    Example test that passes.

    :avocado: dependency={"type": "package", "name": "hello"}
    :avocado: dependency={"type": "package", "name": "hello"}
    :avocado: dependency={"type": "package", "name": "hello"}
    :avocado: dependency={"type": "package", "name": "hello"}
    :avocado: dependency={"type": "package", "name": "hello"}
    """

    def test(self):
        """
        A test simply doesn't have to fail in order to pass
        """

Expected behaviour

JOB ID     : b529a1b269183256a2e55a278e96f1f0ec03bb6e
JOB LOG    : ~/avocado/job-results/job-2024-04-12T14.52-b529a1b/job.log
 (01/10) passtest_with_dependency.py:PassTest.test: STARTED
 (02/10) passtest_with_dependency.py:PassTest.test: STARTED
 (03/10) passtest_with_dependency.py:PassTest.test: STARTED
 (04/10) passtest_with_dependency.py:PassTest.test: STARTED
 (05/10) passtest_with_dependency.py:PassTest.test: STARTED
 (06/10) passtest_with_dependency.py:PassTest.test: STARTED
 (07/10) passtest_with_dependency.py:PassTest.test: STARTED
 (08/10) passtest_with_dependency.py:PassTest.test: STARTED
 (09/10) passtest_with_dependency.py:PassTest.test: STARTED
 (10/10) passtest_with_dependency.py:PassTest.test: STARTED
 (01/10) passtest_with_dependency.py:PassTest.test: PASS (0.01 s)
 (02/10) passtest_with_dependency.py:PassTest.test: PASS (0.01 s)
 (03/10) passtest_with_dependency.py:PassTest.test: PASS (0.01 s)
 (04/10) passtest_with_dependency.py:PassTest.test: PASS (0.01 s)
 (05/10) passtest_with_dependency.py:PassTest.test: PASS (0.01 s)
 (06/10) passtest_with_dependency.py:PassTest.test: PASS (0.01 s)
 (07/10) passtest_with_dependency.py:PassTest.test: PASS (0.01 s)
 (08/10) passtest_with_dependency.py:PassTest.test: PASS (0.01 s)
 (09/10) passtest_with_dependency.py:PassTest.test: PASS (0.01 s)
 (10/10) passtest_with_dependency.py:PassTest.test: PASS (0.01 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : ~/avocado/job-results/job-2024-04-12T14.52-b529a1b/results.html
JOB TIME   : 1.95 s

Current behaviour

$ avocado run -- passtest_with_dependency.py passtest_with_dependency.py passtest_with_dependency.py passtest_with_dependency.py passtest_with_dependency.py passtest_with_dependency.py passtest_with_dependency.py passtest_with_dependency.py passtest_with_dependency.py passtest_with_dependency.py 
JOB ID     : 9e24c01717368b5b94a61430a267bacc46b315ff
JOB LOG    : /home/cleber/avocado/job-results/job-2024-04-12T08.05-9e24c01/job.log
RESULTS    : PASS 0 | ERROR 0 | FAIL 0 | SKIP 10 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /home/cleber/avocado/job-results/job-2024-04-12T08.05-9e24c01/results.html
JOB TIME   : 3.74 s