avocado-framework/avocado

Suite / Job Configuration not respected in runnables created from recipe in runnable-recipe(s) resolver

Closed this issue · 0 comments

Describe the bug
Then the runnable-recipe and runnable-recipes resolvers are used with the Job API, and a configuration is supplied in the suite (or job), it's not passed on to the created runnables.

Steps to reproduce

  1. Have suite config that has a config item such as runner.identifier_format set to NOT FOO
  2. The suite config resolution should point to a file that will be resolved by the runnable-recipe resolver, such as examples/nrunner/recipes/runnable/noop.json (that lacks the runner.identifer_format config
  3. Crate a suite, with suite = TestSuite.from_config(config)
  4. With the resolver working correctly and one test being created in the suite, check for the configuration with suite.tests[0].config.get("runner.identifier_format")

The following test shows the bug in action:

class T(unittest.TestCase):
    def test_job_config_runnable_recipe_resolver_config(self):
        config = {
            "resolver.references": ["examples/nrunner/recipes/runnable/noop.json",],
            "runner.identifier_format": "NOT FOO"
        }
        suite = TestSuite.from_config(config)
        runnable = suite.tests[0]
        self.assertEqual(
            runnable.config.get("runner.identifier_format"), "NOT FOO"
        )

Expected behavior
suite.tests[0].config.get("runner.identifier_format") should contain the configuration set at the suite level, that is, it should be NOT FOO.

Current behavior
suite.tests[0].config.get("runner.identifier_format") == None

System information (please complete the following information):

  • OS: LSB Version: :core-5.0-amd64:core-5.0-noarch:cxx-5.0-amd64:cxx-5.0-noarch:desktop-5.0-amd64:desktop-5.0-noarch:languages-5.0-amd64:languages-5.0-noarch:printing-5.0-amd64:printing-5.0-noarch Distributor ID: Fedora Description: Fedora release 40 (Forty) Release: 40 Codename: Forty
  • Avocado version: cd83d9a
  • Avocado installation method: GIT