test: shell, lang: core: embedded: provisioner: Check it compiles
Add a test to guarantee we continue to keep compiling, in case something in the language changes.
This commit is contained in:
@@ -166,6 +166,10 @@ type localArgs struct {
|
|||||||
// to the user to make sure they exist and don't conflict with each
|
// to the user to make sure they exist and don't conflict with each
|
||||||
// other or the base installation packages.
|
// other or the base installation packages.
|
||||||
Packages []string `arg:"--packages" help:"list of additional distro packages to install (comma separated)" func:"cli_packages"`
|
Packages []string `arg:"--packages" help:"list of additional distro packages to install (comma separated)" func:"cli_packages"`
|
||||||
|
|
||||||
|
// OnlyUnify tells the compiler to stop after type unification. This is
|
||||||
|
// used for testing.
|
||||||
|
OnlyUnify bool `arg:"--only-unify" help:"stop after type unification"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// provisioner is our cli parser translator and general frontend object.
|
// provisioner is our cli parser translator and general frontend object.
|
||||||
@@ -384,6 +388,12 @@ func (obj *provisioner) Customize(a interface{}) (*cli.RunArgs, error) {
|
|||||||
|
|
||||||
// Make any changes here that we want to...
|
// Make any changes here that we want to...
|
||||||
runArgs.RunLang.SkipUnify = true // speed things up for known good code
|
runArgs.RunLang.SkipUnify = true // speed things up for known good code
|
||||||
|
if obj.localArgs.OnlyUnify {
|
||||||
|
obj.init.Logf("stopping after type unification...")
|
||||||
|
runArgs.RunLang.OnlyUnify = true
|
||||||
|
runArgs.RunLang.SkipUnify = false // can't skip if we only unify
|
||||||
|
}
|
||||||
|
|
||||||
name := simplesolver.Name
|
name := simplesolver.Name
|
||||||
// TODO: Remove these optimizations when the solver is faster overall.
|
// TODO: Remove these optimizations when the solver is faster overall.
|
||||||
runArgs.RunLang.UnifySolver = &name
|
runArgs.RunLang.UnifySolver = &name
|
||||||
|
|||||||
19
test/shell/embedded-provisioner.sh
Executable file
19
test/shell/embedded-provisioner.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
. "$(dirname "$0")/../util.sh"
|
||||||
|
|
||||||
|
# misc bash functions, eg: repeat "#" 42
|
||||||
|
function repeat() {
|
||||||
|
for ((i=0; i<$2; ++i)); do echo -n "$1"; done
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# run unification with a dummy password
|
||||||
|
$TIMEOUT "$MGMT" provisioner --only-unify --password $(repeat "#" 106) &
|
||||||
|
pid=$!
|
||||||
|
wait $pid # get exit status
|
||||||
|
e=$?
|
||||||
|
|
||||||
|
exit $e
|
||||||
Reference in New Issue
Block a user