Split testing important packages into two jobs (#14256)
* split testing packages in two separate jobs * speed-up the slowest tests * special treatment for two packages
This commit is contained in:
parent
0d8507cd3d
commit
5a9b3c27c1
4 changed files with 157 additions and 134 deletions
2
.github/workflows/ci_packages.yml
vendored
2
.github/workflows/ci_packages.yml
vendored
|
|
@ -8,7 +8,7 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-18.04, macos-10.15]
|
os: [ubuntu-18.04, macos-10.15]
|
||||||
cpu: [amd64]
|
cpu: [amd64]
|
||||||
pkg: [true]
|
pkg: [1, 2]
|
||||||
name: '${{ matrix.os }} (pkg: ${{ matrix.pkg }})'
|
name: '${{ matrix.os }} (pkg: ${{ matrix.pkg }})'
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
|
|
|
||||||
6
koch.nim
6
koch.nim
|
|
@ -526,8 +526,10 @@ proc runCI(cmd: string) =
|
||||||
## build nimble early on to enable remainder to depend on it if needed
|
## build nimble early on to enable remainder to depend on it if needed
|
||||||
kochExecFold("Build Nimble", "nimble")
|
kochExecFold("Build Nimble", "nimble")
|
||||||
|
|
||||||
if getEnv("NIM_TEST_PACKAGES", "false") == "true":
|
if getEnv("NIM_TEST_PACKAGES", "0") == "1":
|
||||||
execFold("Test selected Nimble packages", "nim c -r testament/testament cat nimble-packages")
|
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")
|
||||||
else:
|
else:
|
||||||
buildTools()
|
buildTools()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,8 @@ const
|
||||||
"lib",
|
"lib",
|
||||||
"longgc",
|
"longgc",
|
||||||
"manyloc",
|
"manyloc",
|
||||||
"nimble-packages",
|
"nimble-packages-1",
|
||||||
|
"nimble-packages-2",
|
||||||
"niminaction",
|
"niminaction",
|
||||||
"rodfiles",
|
"rodfiles",
|
||||||
"threads",
|
"threads",
|
||||||
|
|
@ -448,9 +449,18 @@ let
|
||||||
nimbleExe = findExe("nimble")
|
nimbleExe = findExe("nimble")
|
||||||
packageIndex = nimbleDir / "packages_official.json"
|
packageIndex = nimbleDir / "packages_official.json"
|
||||||
|
|
||||||
iterator listPackages(): tuple[name, url, cmd: string, hasDeps: bool] =
|
type
|
||||||
|
PkgPart = enum
|
||||||
|
ppOne
|
||||||
|
ppTwo
|
||||||
|
|
||||||
|
iterator listPackages(part: PkgPart): tuple[name, url, cmd: string, hasDeps: bool] =
|
||||||
let packageList = parseFile(packageIndex)
|
let packageList = parseFile(packageIndex)
|
||||||
for n, cmd, hasDeps, url in important_packages.packages.items:
|
let importantList =
|
||||||
|
case part
|
||||||
|
of ppOne: important_packages.packages1
|
||||||
|
of ppTwo: important_packages.packages2
|
||||||
|
for n, cmd, hasDeps, url in importantList.items:
|
||||||
if url.len != 0:
|
if url.len != 0:
|
||||||
yield (n, url, cmd, hasDeps)
|
yield (n, url, cmd, hasDeps)
|
||||||
else:
|
else:
|
||||||
|
|
@ -471,7 +481,7 @@ proc makeSupTest(test, options: string, cat: Category): TTest =
|
||||||
result.options = options
|
result.options = options
|
||||||
result.startTime = epochTime()
|
result.startTime = epochTime()
|
||||||
|
|
||||||
proc testNimblePackages(r: var TResults; cat: Category; packageFilter: string) =
|
proc testNimblePackages(r: var TResults; cat: Category; packageFilter: string, part: PkgPart) =
|
||||||
if nimbleExe == "":
|
if nimbleExe == "":
|
||||||
echo "[Warning] - Cannot run nimble tests: Nimble binary not found."
|
echo "[Warning] - Cannot run nimble tests: Nimble binary not found."
|
||||||
return
|
return
|
||||||
|
|
@ -483,7 +493,7 @@ proc testNimblePackages(r: var TResults; cat: Category; packageFilter: string) =
|
||||||
let packagesDir = "pkgstemp"
|
let packagesDir = "pkgstemp"
|
||||||
var errors = 0
|
var errors = 0
|
||||||
try:
|
try:
|
||||||
for name, url, cmd, hasDep in listPackages():
|
for name, url, cmd, hasDep in listPackages(part):
|
||||||
if packageFilter notin name:
|
if packageFilter notin name:
|
||||||
continue
|
continue
|
||||||
inc r.total
|
inc r.total
|
||||||
|
|
@ -700,8 +710,10 @@ proc processCategory(r: var TResults, cat: Category,
|
||||||
compileExample(r, "examples/*.nim", options, cat)
|
compileExample(r, "examples/*.nim", options, cat)
|
||||||
compileExample(r, "examples/gtk/*.nim", options, cat)
|
compileExample(r, "examples/gtk/*.nim", options, cat)
|
||||||
compileExample(r, "examples/talk/*.nim", options, cat)
|
compileExample(r, "examples/talk/*.nim", options, cat)
|
||||||
of "nimble-packages":
|
of "nimble-packages-1":
|
||||||
testNimblePackages(r, cat, options)
|
testNimblePackages(r, cat, options, ppOne)
|
||||||
|
of "nimble-packages-2":
|
||||||
|
testNimblePackages(r, cat, options, ppTwo)
|
||||||
of "niminaction":
|
of "niminaction":
|
||||||
testNimInAction(r, cat, options)
|
testNimInAction(r, cat, options)
|
||||||
of "untestable":
|
of "untestable":
|
||||||
|
|
|
||||||
|
|
@ -1,135 +1,144 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
template pkg(name: string; hasDeps = false; cmd = "nimble test"; url = ""): untyped =
|
template pkg1(name: string; hasDeps = false; cmd = "nimble test"; url = ""): untyped =
|
||||||
packages.add((name, cmd, hasDeps, url))
|
packages1.add((name, cmd, hasDeps, url))
|
||||||
|
|
||||||
var packages*: seq[tuple[name, cmd: string; hasDeps: bool; url: string]] = @[]
|
template pkg2(name: string; hasDeps = false; cmd = "nimble test"; url = ""): untyped =
|
||||||
|
packages2.add((name, cmd, hasDeps, url))
|
||||||
|
|
||||||
pkg "alea", true
|
var packages1*: seq[tuple[name, cmd: string; hasDeps: bool; url: string]] = @[]
|
||||||
pkg "argparse"
|
var packages2*: seq[tuple[name, cmd: string; hasDeps: bool; url: string]] = @[]
|
||||||
pkg "arraymancer", true, "nim c tests/tests_cpu.nim"
|
|
||||||
pkg "ast_pattern_matching", false, "nim c -r --oldgensym:on tests/test1.nim"
|
|
||||||
pkg "asyncmysql", true
|
# packages A-M
|
||||||
pkg "awk", true
|
pkg1 "alea", true
|
||||||
pkg "bigints"
|
pkg1 "argparse"
|
||||||
pkg "binaryheap", false, "nim c -r binaryheap.nim"
|
pkg1 "arraymancer", true, "nim c tests/tests_cpu.nim"
|
||||||
pkg "BipBuffer"
|
pkg1 "ast_pattern_matching", false, "nim c -r --oldgensym:on tests/test1.nim"
|
||||||
# pkg "blscurve", true # pending https://github.com/status-im/nim-blscurve/issues/39
|
pkg1 "asyncmysql", true
|
||||||
pkg "bncurve", true
|
pkg1 "awk", true
|
||||||
pkg "brainfuck", true
|
pkg1 "bigints"
|
||||||
pkg "bump", true, "nimble test", "https://github.com/disruptek/bump"
|
pkg1 "binaryheap", false, "nim c -r binaryheap.nim"
|
||||||
pkg "c2nim", false, "nim c testsuite/tester.nim"
|
pkg1 "BipBuffer"
|
||||||
pkg "cascade"
|
# pkg1 "blscurve", true # pending https://github.com/status-im/nim-blscurve/issues/39
|
||||||
pkg "cello", true
|
pkg1 "bncurve", true, "nim c -r tests/tvectors.nim"
|
||||||
pkg "chroma"
|
pkg1 "brainfuck", true, "nim c -r tests/compile.nim"
|
||||||
pkg "chronicles", true, "nim c -o:chr -r chronicles.nim"
|
pkg1 "bump", true, "nim c --gc:arc -r tests/tbump.nim", "https://github.com/disruptek/bump"
|
||||||
|
pkg1 "c2nim", false, "nim c testsuite/tester.nim"
|
||||||
|
pkg1 "cascade"
|
||||||
|
pkg1 "cello", true
|
||||||
|
pkg1 "chroma"
|
||||||
|
pkg1 "chronicles", true, "nim c -o:chr -r chronicles.nim"
|
||||||
when not defined(osx): # testdatagram.nim(560, 54): Check failed
|
when not defined(osx): # testdatagram.nim(560, 54): Check failed
|
||||||
pkg "chronos", true
|
pkg1 "chronos", true, "nim c -r -d:release tests/testall"
|
||||||
pkg "cligen", false, "nim c -o:cligenn -r cligen.nim"
|
pkg1 "cligen", false, "nim c -o:cligenn -r cligen.nim"
|
||||||
pkg "coco", true
|
pkg1 "coco", true
|
||||||
pkg "combparser"
|
pkg1 "combparser"
|
||||||
pkg "compactdict"
|
pkg1 "compactdict"
|
||||||
pkg "comprehension", false, "nimble test", "https://github.com/alehander42/comprehension"
|
pkg1 "comprehension", false, "nimble test", "https://github.com/alehander42/comprehension"
|
||||||
pkg "criterion"
|
pkg1 "criterion"
|
||||||
pkg "dashing", false, "nim c tests/functional.nim"
|
pkg1 "dashing", false, "nim c tests/functional.nim"
|
||||||
pkg "delaunay"
|
pkg1 "delaunay"
|
||||||
pkg "docopt"
|
pkg1 "docopt"
|
||||||
pkg "easygl", true, "nim c -o:egl -r src/easygl.nim", "https://github.com/jackmott/easygl"
|
pkg1 "easygl", true, "nim c -o:egl -r src/easygl.nim", "https://github.com/jackmott/easygl"
|
||||||
pkg "elvis"
|
pkg1 "elvis"
|
||||||
pkg "fidget", true, "nim c -r tests/runNative.nim"
|
pkg1 "fidget", true, "nim c -r tests/runNative.nim"
|
||||||
pkg "fragments", false, "nim c -r fragments/dsl.nim"
|
pkg1 "fragments", false, "nim c -r fragments/dsl.nim"
|
||||||
pkg "gara"
|
pkg1 "gara"
|
||||||
pkg "ggplotnim", true, "nimble testCI"
|
pkg1 "ggplotnim", true, "nim c -d:noCairo -r tests/tests.nim"
|
||||||
# pkg "gittyup", true, "nimble test", "https://github.com/disruptek/gittyup"
|
# pkg1 "gittyup", true, "nimble test", "https://github.com/disruptek/gittyup"
|
||||||
pkg "glob"
|
pkg1 "glob"
|
||||||
pkg "gnuplot"
|
pkg1 "gnuplot"
|
||||||
pkg "hts", false, "nim c -o:htss src/hts.nim"
|
pkg1 "hts", false, "nim c -o:htss src/hts.nim"
|
||||||
# pkg "httpauth", true
|
# pkg1 "httpauth", true
|
||||||
pkg "illwill", false, "nimble examples"
|
pkg1 "illwill", false, "nimble examples"
|
||||||
pkg "inim", true
|
pkg1 "inim", true # pending https://github.com/inim-repl/INim/issues/74
|
||||||
pkg "itertools", false, "nim doc src/itertools.nim"
|
pkg1 "itertools", false, "nim doc src/itertools.nim"
|
||||||
pkg "iterutils"
|
pkg1 "iterutils"
|
||||||
pkg "jstin"
|
pkg1 "jstin"
|
||||||
pkg "karax", false, "nim c -r tests/tester.nim"
|
pkg1 "karax", false, "nim c -r tests/tester.nim"
|
||||||
pkg "kdtree", false, "nimble test", "https://github.com/jblindsay/kdtree"
|
pkg1 "kdtree", false, "nimble test", "https://github.com/jblindsay/kdtree"
|
||||||
pkg "loopfusion"
|
pkg1 "loopfusion"
|
||||||
pkg "macroutils"
|
pkg1 "macroutils"
|
||||||
pkg "markdown"
|
pkg1 "markdown"
|
||||||
pkg "memo"
|
pkg1 "memo"
|
||||||
pkg "msgpack4nim"
|
pkg1 "msgpack4nim", false, "nim c -r tests/test_spec.nim"
|
||||||
pkg "nake", false, "nim c nakefile.nim"
|
|
||||||
pkg "neo", true, "nim c -d:blas=openblas tests/all.nim"
|
|
||||||
pkg "nesm"
|
|
||||||
# pkg "nico", true
|
|
||||||
pkg "nicy", false, "nim c -r src/nicy.nim"
|
|
||||||
|
|
||||||
|
# these two are special snowflakes
|
||||||
|
pkg1 "nimcrypto", false, "nim c -r tests/testall.nim"
|
||||||
|
pkg1 "stint", false, "nim c -o:stintt -r stint.nim"
|
||||||
|
|
||||||
|
|
||||||
|
# packages N-Z
|
||||||
|
pkg2 "nake", false, "nim c nakefile.nim"
|
||||||
|
pkg2 "neo", true, "nim c -d:blas=openblas tests/all.nim"
|
||||||
|
pkg2 "nesm"
|
||||||
|
# pkg2 "nico", true
|
||||||
|
pkg2 "nicy", false, "nim c -r src/nicy.nim"
|
||||||
when defined(osx):
|
when defined(osx):
|
||||||
# xxx: do this more generally by installing non-nim dependencies automatically
|
# xxx: do this more generally by installing non-nim dependencies automatically
|
||||||
# as specified in nimble file and calling `distros.foreignDepInstallCmd`, but
|
# as specified in nimble file and calling `distros.foreignDepInstallCmd`, but
|
||||||
# it currently would fail work if a package is already installed.
|
# it currently would fail work if a package is already installed.
|
||||||
doAssert execShellCmd("brew ls --versions gtk+3 || brew install gtk+3") == 0
|
doAssert execShellCmd("brew ls --versions gtk+3 || brew install gtk+3") == 0
|
||||||
pkg "nigui", false, "nim c -o:niguii -r src/nigui.nim"
|
pkg2 "nigui", false, "nim c -o:niguii -r src/nigui.nim"
|
||||||
|
pkg2 "NimData", true, "nim c -o:nimdataa src/nimdata.nim"
|
||||||
pkg "nimcrypto", false, "nim c -r tests/testall.nim"
|
pkg2 "nimes", true, "nim c src/nimes.nim"
|
||||||
pkg "NimData", true, "nim c -o:nimdataa src/nimdata.nim"
|
pkg2 "nimfp", true, "nim c -o:nfp -r src/fp.nim"
|
||||||
pkg "nimes", true, "nim c src/nimes.nim"
|
pkg2 "nimgame2", true, "nim c nimgame2/nimgame.nim"
|
||||||
pkg "nimfp", true, "nim c -o:nfp -r src/fp.nim"
|
pkg2 "nimgen", true, "nim c -o:nimgenn -r src/nimgen/runcfg.nim"
|
||||||
pkg "nimgame2", true, "nim c nimgame2/nimgame.nim"
|
pkg2 "nimlsp", true
|
||||||
pkg "nimgen", true, "nim c -o:nimgenn -r src/nimgen/runcfg.nim"
|
pkg2 "nimly", true, "nim c -r tests/test_readme_example.nim"
|
||||||
pkg "nimlsp", true
|
# pkg2 "nimongo", true, "nimble test_ci"
|
||||||
pkg "nimly", true
|
# pkg2 "nimph", true, "nimble test", "https://github.com/disruptek/nimph"
|
||||||
# pkg "nimongo", true, "nimble test_ci"
|
pkg2 "nimpy", false, "nim c -r tests/nimfrompy.nim"
|
||||||
# pkg "nimph", true, "nimble test", "https://github.com/disruptek/nimph"
|
pkg2 "nimquery"
|
||||||
pkg "nimpy", false, "nim c -r tests/nimfrompy.nim"
|
pkg2 "nimsl", true
|
||||||
pkg "nimquery"
|
pkg2 "nimsvg"
|
||||||
pkg "nimsl", true
|
# pkg2 "nimterop", true
|
||||||
pkg "nimsvg"
|
pkg2 "nimwc", true, "nim c nimwc.nim"
|
||||||
# pkg "nimterop", true
|
pkg2 "nimx", true, "nim c --threads:on test/main.nim"
|
||||||
pkg "nimwc", true, "nim c nimwc.nim"
|
pkg2 "nitter", true, "nim c src/nitter.nim", "https://github.com/zedeus/nitter"
|
||||||
pkg "nimx", true, "nim c --threads:on test/main.nim"
|
pkg2 "norm", true, "nim c -r tests/tsqlite.nim"
|
||||||
pkg "nitter", true, "nim c src/nitter.nim", "https://github.com/zedeus/nitter"
|
pkg2 "npeg", false, "nimble testarc"
|
||||||
pkg "norm", true, "nim c -r tests/tsqlite.nim"
|
pkg2 "numericalnim", true, "nim c -r tests/test_integrate.nim"
|
||||||
pkg "npeg"
|
pkg2 "optionsutils"
|
||||||
pkg "numericalnim", true
|
pkg2 "ormin", true, "nim c -o:orminn ormin.nim"
|
||||||
pkg "optionsutils"
|
pkg2 "parsetoml"
|
||||||
pkg "ormin", true, "nim c -o:orminn ormin.nim"
|
pkg2 "patty"
|
||||||
pkg "parsetoml"
|
pkg2 "plotly", true, "nim c --oldgensym:on examples/all.nim"
|
||||||
pkg "patty"
|
pkg2 "pnm"
|
||||||
pkg "plotly", true, "nim c --oldgensym:on examples/all.nim"
|
pkg2 "polypbren"
|
||||||
pkg "pnm"
|
pkg2 "prologue", true, "nim c -r tests/test_compile/test_compile.nim"
|
||||||
pkg "polypbren"
|
pkg2 "protobuf", true, "nim c -o:protobuff -r src/protobuf.nim"
|
||||||
pkg "prologue", true, "nim c -r tests/test_compile/test_compile.nim"
|
pkg2 "pylib"
|
||||||
pkg "protobuf", true, "nim c -o:protobuff -r src/protobuf.nim"
|
pkg2 "rbtree"
|
||||||
pkg "pylib"
|
pkg2 "react", false, "nimble example"
|
||||||
pkg "rbtree"
|
pkg2 "regex", true, "nim c src/regex"
|
||||||
pkg "react", false, "nimble example"
|
pkg2 "result", false, "nim c -r result.nim"
|
||||||
pkg "regex", true, "nim c src/regex"
|
pkg2 "RollingHash", false, "nim c -r tests/test_cyclichash.nim"
|
||||||
pkg "result", false, "nim c -r result.nim"
|
pkg2 "rosencrantz", false, "nim c -o:rsncntz -r rosencrantz.nim"
|
||||||
pkg "RollingHash"
|
pkg2 "sdl1", false, "nim c -r src/sdl.nim"
|
||||||
pkg "rosencrantz", false, "nim c -o:rsncntz -r rosencrantz.nim"
|
pkg2 "sdl2_nim", false, "nim c -r sdl2/sdl.nim"
|
||||||
pkg "sdl1", false, "nim c -r src/sdl.nim"
|
pkg2 "sigv4", true, "nim c --gc:arc -r sigv4.nim", "https://github.com/disruptek/sigv4"
|
||||||
pkg "sdl2_nim", false, "nim c -r sdl2/sdl.nim"
|
pkg2 "snip", false, "nimble test", "https://github.com/genotrance/snip"
|
||||||
pkg "sigv4", true, "nimble test", "https://github.com/disruptek/sigv4"
|
pkg2 "strslice"
|
||||||
pkg "snip", false, "nimble test", "https://github.com/genotrance/snip"
|
pkg2 "strunicode", true, "nim c -r src/strunicode.nim"
|
||||||
pkg "stint", false, "nim c -o:stintt -r stint.nim"
|
pkg2 "synthesis"
|
||||||
pkg "strslice"
|
pkg2 "telebot", true, "nim c -o:tbot -r src/telebot.nim"
|
||||||
pkg "strunicode", true, "nim c -r src/strunicode.nim"
|
pkg2 "tempdir"
|
||||||
pkg "synthesis"
|
pkg2 "templates"
|
||||||
pkg "telebot", true, "nim c -o:tbot -r src/telebot.nim"
|
pkg2 "tensordsl", false, "nim c -r tests/tests.nim", "https://krux02@bitbucket.org/krux02/tensordslnim.git"
|
||||||
pkg "tempdir"
|
pkg2 "terminaltables", false, "nim c src/terminaltables.nim"
|
||||||
pkg "templates"
|
pkg2 "termstyle"
|
||||||
pkg "tensordsl", false, "nim c -r tests/tests.nim", "https://krux02@bitbucket.org/krux02/tensordslnim.git"
|
pkg2 "timeit"
|
||||||
pkg "terminaltables", false, "nim c src/terminaltables.nim"
|
pkg2 "timezones"
|
||||||
pkg "termstyle"
|
pkg2 "tiny_sqlite"
|
||||||
pkg "timeit"
|
pkg2 "unicodedb"
|
||||||
pkg "timezones"
|
pkg2 "unicodeplus", true
|
||||||
pkg "tiny_sqlite"
|
pkg2 "unpack"
|
||||||
pkg "unicodedb"
|
pkg2 "websocket", false, "nim c websocket.nim"
|
||||||
pkg "unicodeplus", true
|
# pkg2 "winim", true
|
||||||
pkg "unpack"
|
pkg2 "with"
|
||||||
pkg "websocket", false, "nim c websocket.nim"
|
pkg2 "ws"
|
||||||
# pkg "winim", true
|
pkg2 "yaml"
|
||||||
pkg "with"
|
pkg2 "zero_functional", false, "nim c -r test.nim"
|
||||||
pkg "ws"
|
|
||||||
pkg "yaml"
|
|
||||||
pkg "zero_functional", false, "nim c -r test.nim"
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue