mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-22 20:58:22 +00:00
test/py: Always use the current dir as the source tree
The logic in get_details() retrieves the default source directory from
the Labgrid settings. This is convenient for interactive use, since it
allows pytests to be run from any directory and still find the source
tree.
However, it is not actually correct.
Gitlab sets the current directory to the source tree and expects that to
be used. At present it is ignored. The result is that Gitlab builds
whatever happens to be in the default source directory, ignoring the
tree it is supposed to be building.
Fix this by using the directory of the source tree, always. This is
obtained by looking at the grandparent of the conftest.py file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Tom Rini <trini@konsulko.com>
Fixes: bf89a8f1fc
("test: Introduce the concept of a role")
Tested-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
429d4846ea
commit
a8f09d6282
1 changed files with 5 additions and 4 deletions
|
@ -144,6 +144,9 @@ def get_details(config):
|
||||||
# Get a few provided parameters
|
# Get a few provided parameters
|
||||||
build_dir = config.getoption('build_dir')
|
build_dir = config.getoption('build_dir')
|
||||||
build_dir_extra = config.getoption('build_dir_extra')
|
build_dir_extra = config.getoption('build_dir_extra')
|
||||||
|
|
||||||
|
# The source tree must be the current directory
|
||||||
|
source_dir = os.path.dirname(os.path.dirname(TEST_PY_DIR))
|
||||||
if role:
|
if role:
|
||||||
# When using a role, build_dir and build_dir_extra are normally not set,
|
# When using a role, build_dir and build_dir_extra are normally not set,
|
||||||
# since they are picked up from Labgrid-sjg via the u-boot-test-getrole
|
# since they are picked up from Labgrid-sjg via the u-boot-test-getrole
|
||||||
|
@ -172,15 +175,13 @@ def get_details(config):
|
||||||
# Read the build directories here, in case none were provided in the
|
# Read the build directories here, in case none were provided in the
|
||||||
# command-line arguments
|
# command-line arguments
|
||||||
(board_type, board_type_extra, default_build_dir,
|
(board_type, board_type_extra, default_build_dir,
|
||||||
default_build_dir_extra, source_dir) = (vals['board'],
|
default_build_dir_extra) = (vals['board'],
|
||||||
vals['board_extra'], vals['build_dir'], vals['build_dir_extra'],
|
vals['board_extra'], vals['build_dir'], vals['build_dir_extra'])
|
||||||
vals['source_dir'])
|
|
||||||
else:
|
else:
|
||||||
board_type = config.getoption('board_type')
|
board_type = config.getoption('board_type')
|
||||||
board_type_extra = config.getoption('board_type_extra')
|
board_type_extra = config.getoption('board_type_extra')
|
||||||
board_identity = config.getoption('board_identity')
|
board_identity = config.getoption('board_identity')
|
||||||
|
|
||||||
source_dir = os.path.dirname(os.path.dirname(TEST_PY_DIR))
|
|
||||||
default_build_dir = source_dir + '/build-' + board_type
|
default_build_dir = source_dir + '/build-' + board_type
|
||||||
default_build_dir_extra = source_dir + '/build-' + board_type_extra
|
default_build_dir_extra = source_dir + '/build-' + board_type_extra
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue