use NIM_TESTAMENT_BATCH for important_packages, improve formatting, code cleanups (#17301)

* use NIM_TESTAMENT_BATCH for important_packages, improve formatting, code cleanups
* workaround for nimcrypto not having `--path:.`; remove workaround "two are special snowflakes"
* add comment explaining why nimcrypto fails and what packages need to be testable
This commit is contained in:
Timothee Cour 2021-03-12 06:45:51 -08:00 • committed by GitHub
commit c6f9c38892
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 185 additions and 211 deletions

View file

@ -531,10 +531,9 @@ proc runCI(cmd: string) =
## build nimble early on to enable remainder to depend on it if needed
kochExecFold("Build Nimble", "nimble")
let batchParam = "--batch:$1" % "NIM_TESTAMENT_BATCH".getEnv("_")
if getEnv("NIM_TEST_PACKAGES", "0") == "1":
execFold("Test selected Nimble packages (1)", "nim c -r testament/testament cat nimble-packages-1")
elif getEnv("NIM_TEST_PACKAGES", "0") == "2":
execFold("Test selected Nimble packages (2)", "nim c -r testament/testament cat nimble-packages-2")
execFold("Test selected Nimble packages", "nim r testament/testament $# pcat nimble-packages" % batchParam)
else:
buildTools()
@ -551,11 +550,9 @@ proc runCI(cmd: string) =
execFold("Compile tester", "nim c -d:nimCoroutines --os:genode -d:posix --compileOnly testament/testament")
# main bottleneck here
# xxx: even though this is the main bottlneck, we could use same code to batch the other tests
#[
BUG: with initOptParser, `--batch:'' all` interprets `all` as the argument of --batch
]#
execFold("Run tester", "nim c -r -d:nimCoroutines --putenv:NIM_TESTAMENT_REMOTE_NETWORKING:1 -d:nimStrictMode testament/testament --batch:$1 all -d:nimCoroutines" % ["NIM_TESTAMENT_BATCH".getEnv("_")])
# xxx: even though this is the main bottleneck, we could speedup the rest via batching with `--batch`.
# BUG: with initOptParser, `--batch:'' all` interprets `all` as the argument of --batch, pending bug #14343
execFold("Run tester", "nim c -r -d:nimCoroutines --putenv:NIM_TESTAMENT_REMOTE_NETWORKING:1 -d:nimStrictMode testament/testament $# all -d:nimCoroutines" % batchParam)
block CT_FFI:
when defined(posix): # windows can be handled in future PR's