From 1540e984279d25e5a83894216c3610990528b95c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 17 Apr 2019 22:41:20 +0300 Subject: Add override options to bdep-ci Namely the options are: --override, --overrides-file, --builds and --build-email. --- tests/ci.testscript | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) (limited to 'tests') diff --git a/tests/ci.testscript b/tests/ci.testscript index 7bd6172..986648f 100644 --- a/tests/ci.testscript +++ b/tests/ci.testscript @@ -138,6 +138,110 @@ windows = ($cxx.target.class == 'windows') error: remote git repository URL '$repository#frag' already has fragment EOE } + + : overrides + : + { + +$clone_root_prj + +$init -C @cfg &prj-cfg/*** + + : valid + : + : Here we only test that bdep-ci does not fail for valid overrides. It + : seems to be impossible to verify the submitted overrides manifest. + : + { + $clone_prj; + + cat <=overrides.manifest; + : 1 + builds: all + EOI + + $* --overrides-file overrides.manifest \ + --build-email 'foo@example.com' \ + --override 'build-error-email: error@example.com' \ + --override 'builds: &gcc' \ + --override 'build-include: linux*' \ + --override 'build-exclude: *' 2>>~"%EOE%" + submitting to $server + %.* + %.*CI request is queued.*% + %reference: .+% + EOE + } + + : invalid-option + : + { + +$clone_prj + + : overrides-file + : + { + +$clone_prj + + : reading + : + { + $clone_prj; + + $* --overrides-file overrides.manifest 2>>~%EOE% != 0 + %error: invalid value 'overrides.manifest' for option '--overrides-file': unable to read: .+% + EOE + } + + : parsing + : + { + $clone_prj; + + cat <=overrides.manifest; + builds: all + EOI + + $* --overrides-file overrides.manifest 2>>EOE != 0 + error: invalid value 'overrides.manifest' for option '--overrides-file': unable to parse: 1:1: error: format version pair expected + EOE + } + } + + : override + : + { + $clone_prj; + + $* --override 'all' 2>>EOE != 0 + error: invalid value 'all' for option '--override': missing ':' + EOE + } + + : override-pair + : + : Each override option is valid by its own, but the resulting overrides + : manifest is invalid. + : + { + $clone_prj; + + $* --override 'builds: all' --override 'builds: default : &gcc' 2>>EOE != 0 + error: invalid overrides: invalid package builds in 'default : &gcc': unexpected underlying class set + EOE + } + + : overrides + : + : This is a fake option (see ci.cli for details). + : + { + $clone_prj; + + $* --overrides 'all' 2>>EOE != 0 + error: unknown option '--overrides' + EOE + } + } + } } : multi-pkg -- cgit v1.1