tests: Add failing test with repository includes
Add a new test to test_commands.py which: * Has an incomplete definition of externalrepo * Defines a local repository, subrepo * Includes a file from subrepo * The included file completes the definition of externalrepo * It also attempts to include a file from externalrepo This test previously failed with the error message "No such file or directory: '.../test_commands/tests/test_layers/test.yml'" Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
34983c13ee
commit
7647d7ad3e
@ -58,3 +58,11 @@ def test_checkout(changedir, tmpdir):
|
|||||||
assert(not glob.glob('build/tmp*'))
|
assert(not glob.glob('build/tmp*'))
|
||||||
assert(not os.path.exists('build/downloads'))
|
assert(not os.path.exists('build/downloads'))
|
||||||
assert(not os.path.exists('build/sstate-cache'))
|
assert(not os.path.exists('build/sstate-cache'))
|
||||||
|
|
||||||
|
|
||||||
|
def test_repo_includes(changedir, tmpdir):
|
||||||
|
tdir = str(tmpdir.mkdir('test_commands'))
|
||||||
|
shutil.rmtree(tdir, ignore_errors=True)
|
||||||
|
shutil.copytree('tests/test_repo_includes', tdir)
|
||||||
|
os.chdir(tdir)
|
||||||
|
kas.kas(['checkout', 'test.yml'])
|
||||||
|
3
tests/test_repo_includes/oe-init-build-env
Executable file
3
tests/test_repo_includes/oe-init-build-env
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
true
|
10
tests/test_repo_includes/subrepo/test.yml
Normal file
10
tests/test_repo_includes/subrepo/test.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
header:
|
||||||
|
version: 11
|
||||||
|
includes:
|
||||||
|
- repo: externalrepo
|
||||||
|
file: tests/test_layers/test.yml
|
||||||
|
|
||||||
|
repos:
|
||||||
|
externalrepo:
|
||||||
|
url: https://github.com/siemens/kas.git
|
||||||
|
path: externalrepo
|
14
tests/test_repo_includes/test.yml
Normal file
14
tests/test_repo_includes/test.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
header:
|
||||||
|
version: 11
|
||||||
|
includes:
|
||||||
|
- repo: subrepo
|
||||||
|
file: test.yml
|
||||||
|
|
||||||
|
repos:
|
||||||
|
this:
|
||||||
|
|
||||||
|
subrepo:
|
||||||
|
path: subrepo
|
||||||
|
|
||||||
|
externalrepo:
|
||||||
|
refspec: master
|
Loading…
x
Reference in New Issue
Block a user