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

Missing search_paths when using topology executable or the pytest plugin #61

Open
carlos-jenkins opened this issue Aug 2, 2017 · 0 comments
Assignees
Labels

Comments

@carlos-jenkins
Copy link
Contributor

carlos-jenkins commented Aug 2, 2017

pytest plugin

Relevant lines are:

search_paths = [

# Get a list of all testing directories
search_paths = [
    abspath(arg) for arg in config.args if isdir(arg)
]

injected_attr = parse_attribute_injection(
    injection_file,
    search_paths=search_paths
)

In this case only arguments that are directory are considered for the search path. But if we pass a single test as an argument pytest ... test/test_my.py then it will never be injected. In this case, we could also do:

search_paths = [
    abspath(arg) for arg in config.args
    if isdir(arg) else abspath(dirname(arg))
]

Executable

Relevant lines are:

injection_spec = parse_attribute_injection(args.inject)

if args.inject is not None:
    injection_spec = parse_attribute_injection(args.inject)

In this case injection is basically broken unless we call the topology executable from where do we expect the root be, as the default search_paths is used (cwd).

In this case too, we could get the search path from the input:

if args.inject is not None:
    injection_spec = parse_attribute_injection(
        args.inject,
        search_paths=dirname(args.topology)
    )

What do you think?

@carlos-jenkins carlos-jenkins self-assigned this Aug 2, 2017
@carlos-jenkins carlos-jenkins added this to To Do in Topology 2.0 Nov 14, 2019
carlos-jenkins pushed a commit that referenced this issue Nov 15, 2019
chg: usr: Allow to pass extra kwargs to create_host_config() and create_container()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Topology 2.0
  
To Do
Development

No branches or pull requests

1 participant