Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
clebergnu opened this issue Jun 18, 2024 · 0 comments
Assignees
Labels
bug customer:Passt Requirements/issues raised by the Passt project

Comments

@clebergnu
Copy link
Contributor

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
@clebergnu clebergnu added bug customer:Passt Requirements/issues raised by the Passt project labels Jun 18, 2024
@clebergnu clebergnu added this to the #106 - Codename TBD milestone Jun 18, 2024
clebergnu added a commit to clebergnu/avocado that referenced this issue Jun 25, 2024
The setting of configuration into runnables is currently being done at
the time where a runnable will be run (at the "nrunner" suite runner
plugin).

But, there are situations, such as when using the Job API, that this
is too late or not effective.

This change moves the setting of the configuration to the suite, which
is based on the job configuration, and thus already has all the
information needed to set the final version of the configuration.

Fixes: avocado-framework#5963
Signed-off-by: Cleber Rosa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug customer:Passt Requirements/issues raised by the Passt project
Projects
Archived in project
Development

No branches or pull requests

1 participant