Skip to content

Need support only name in test level require #4422

@HouMinXi

Description

@HouMinXi

This requirement come from slack link

Description: If a test e.g(/networking/openvswitch/topo) need another folder as a library(/networking/common). These two folder come from the same git-root.

Currently, relative path didn't work in test-level require option.
test level path as below

houminxi@houminxi:~/code/kernel/networking/openvswitch/topo$ pwd
/home/houminxi/code/kernel/networking/openvswitch/topo

# realpath ../../common
/home/houminxi/code/kernel/networking/common

But when I define a local library in openvswitch/topo/main.fmf.

require:
  - name: /common
    path: ../../
    type: library

TMT didn't find the correct path.

10:25:45         Detected library '{'path': Path('../..'), 'name': '/common', 'type': 'library'}'.
10:25:45         Fetch library '../common'.
10:25:45         Failed to find library ../common at ../..

dependencies = [DependencyFmfId(fmf_root=None, git_root=None, default_branch=None, url=None, ref=None, path=Path('../..'), name='/common', destination=None, nick=None, type='library')]
          error_message = 'After beakerlib processing, tests may have only simple requirements'
          logger = <Logger: name=tmt.run.logger0.prepare verbosity=2 debug=0 quiet=False topics={<Topic.CLI_INVOCATIONS: 'cli-invocations'>} apply_colors_output=False apply_colors_logging=False>
          non_simple_dependencies = [DependencyFmfId(fmf_root=None, git_root=None, default_branch=None, url=None, ref=None, path=Path('../..'), name='/common', destination=None, nick=None, type='library')]
          dependency = DependencyFmfId(fmf_root=None, git_root=None, default_branch=None, url=None, ref=None, path=Path('../..'), name='/common', destination=None, nick=None, type='library') 

Generally, we'll only encounter a few possibilities:

  1. From different git repositories. This is self-explanatory; use URL + name.
  2. From other directories within the same git repositories. #<----This is what we're discussing now.
  3. From a directory under an absolute path. I understand that this is currently supported very well.

tmt currently lacks a variable to point to an absolute path. So I hope require can support only pass name such as below:
require:

  • name: /networking/common
    type: library

When fmf == git root, using only name means starting the search for the folder specified by name from the current git root.

When fmf points to a subfolder of git, using only name means starting the search for the folder specified by name from within that subfolder.

Metadata

Metadata

Assignees

Labels

area | librariesIssues related to beakerlib libraries support

Projects

Status

done

Status

triaged

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions