... |
... |
@@ -359,3 +359,35 @@ def test_submodule_track_ignore_inconsistent(cli, tmpdir, datafiles): |
359
|
359
|
|
360
|
360
|
# Assert that we are just fine without it, and emit a warning to the user.
|
361
|
361
|
assert "Ignoring inconsistent submodule" in result.stderr
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+@pytest.mark.skipif(HAVE_GIT is False, reason="git is not available")
|
|
365
|
+@pytest.mark.datafiles(os.path.join(DATA_DIR, 'template'))
|
|
366
|
+def test_submodule_track_no_ref_or_track(cli, tmpdir, datafiles):
|
|
367
|
+ project = os.path.join(datafiles.dirname, datafiles.basename)
|
|
368
|
+
|
|
369
|
+ # Create the repo from 'repofiles' subdir
|
|
370
|
+ repo = create_repo('git', str(tmpdir))
|
|
371
|
+ ref = repo.create(os.path.join(project, 'repofiles'))
|
|
372
|
+
|
|
373
|
+ # Write out our test target
|
|
374
|
+ gitsource = repo.source_config(ref=None)
|
|
375
|
+ gitsource.pop('track')
|
|
376
|
+ element = {
|
|
377
|
+ 'kind': 'import',
|
|
378
|
+ 'sources': [
|
|
379
|
+ gitsource
|
|
380
|
+ ]
|
|
381
|
+ }
|
|
382
|
+
|
|
383
|
+ print('element', element)
|
|
384
|
+ _yaml.dump(element, os.path.join(project, 'target.bst'))
|
|
385
|
+
|
|
386
|
+ # Track will encounter an inconsistent submodule without any ref
|
|
387
|
+ result = cli.run(project=project, args=['track', 'target.bst'])
|
|
388
|
+ result.assert_success()
|
|
389
|
+
|
|
390
|
+ # Assert that we are just fine without it, and emit a warning to the user.
|
|
391
|
+ assert "WARNING git source at" in result.stderr
|
|
392
|
+ assert "Without a tracking branch ref can not be updated but with out a ref " + \
|
|
393
|
+ "then build can not fetch the repo and bst build will fail" in result.stderr
|