Commit 3c97ec20 authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

Adaptar CI/CD para executar teste automatizado.

[SOMA-7020][SOMA-6957]
parent 2b8d088e
test/lua_runtime
test/node_modules
test/package-lock.json
......@@ -66,18 +66,32 @@ versioning_tag:
#-------------------------
# Test Job
#-------------------------
static_check:
lint:
stage: test
image: repo.tecgraf.puc-rio.br:18089/soma/ubuntu:16.04-sga-posix
image: repo.tecgraf.puc-rio.br:18082/node:14.15-stretch
cache:
paths:
- test/node_modules
script:
- mkdir sgarest-daemon
- curl -L https://git.tecgraf.puc-rio.br/csbase-dev/sgarest-daemon/-/archive/${CI_COMMIT_REF_NAME}/sgarest-daemon-${CI_COMMIT_REF_NAME}.tar.gz | tar xzf - -C sgarest-daemon --strip-components 1
- cd sgarest-daemon
- export errors=$(luac5.3 -p sgad | find . -regex ".*\.lua" | awk '{print "luac5.3 -p "$1}' | sh -)
- ([ -z "$errors" ] && exit 0 || exit 1)
only:
- master
- tags
- cd test
- npm install
- npx eslint --ext js .
test:
stage: test
image: repo.tecgraf.puc-rio.br:18082/node:14.15-stretch
cache:
paths:
- test/lua_runtime
- test/node_modules
script:
- bash install.sh --force --posix --pbs --slurm $(pwd)/test/lua_runtime
- for rockspec in *.rockspec; do
- test/lua_runtime/bin/luarocks --force remove ${rockspec%-*-*.rockspec}
- done
- cd test
- npm install
- npm run test
#-------------------------
# Docker Jobs
......
......@@ -3,9 +3,11 @@
usage() {
echo "usage: $0 [options] path"
echo "Available options are:"
echo " --posix Install the POSIX driver."
echo " --pbs Install the PBS driver (experimental)."
echo " --slurm Install the Slurm driver (experimental)."
echo " --force Just show warnings, but don't stop execution."
echo " --rocks <repoUrl> Use rocks from the provided LuaRocks repository."
echo " --posix Install the POSIX driver."
echo " --pbs Install the PBS driver (experimental)."
echo " --slurm Install the Slurm driver (experimental)."
}
WARNING=no
......@@ -112,21 +114,21 @@ case "$(uname -s)" in
;;
esac
${SGA_HOME}/bin/luarocks make sga-daemon-scm-1.rockspec
${SGA_HOME}/bin/luarocks make sga-daemon-*.rockspec
for driver in ${SGA_DRIVERS}
do
case ${driver} in
posix)
${SGA_HOME}/bin/luarocks make sga-driver-posix-scm-1.rockspec
${SGA_HOME}/bin/luarocks make sga-driver-posix-*.rockspec
;;
pbs)
${SGA_HOME}/bin/luarocks make sga-exec-scm-1.rockspec
${SGA_HOME}/bin/luarocks make sga-driver-pbs-scm-1.rockspec
${SGA_HOME}/bin/luarocks make sga-exec-*.rockspec
${SGA_HOME}/bin/luarocks make sga-driver-pbs-*.rockspec
;;
slurm)
${SGA_HOME}/bin/luarocks make sga-exec-scm-1.rockspec
${SGA_HOME}/bin/luarocks make sga-driver-slurm-scm-1.rockspec
${SGA_HOME}/bin/luarocks make sga-exec-*.rockspec
${SGA_HOME}/bin/luarocks make sga-driver-slurm-*.rockspec
;;
esac
done
......
package = "lua-schema"
version = "scm-1"
source = {
url = "git://github.com/hishamhm/lua-schema",
branch = "features",
}
description = {
summary = "A simple package to check Lua-data against schemata.",
detailed = [[
A simple package to check Lua-data against schemata. The package is written
entirely in Lua (5.2) and has no further dependencies. It is designed to be
easily extensible.
]],
homepage = "http://github.com/sschoener/lua-schema",
license = "MIT/X11"
}
dependencies = {
"lua >= 5.2",
}
build = {
type = "builtin",
modules = {
schema = "schema.lua"
}
}
......@@ -2,9 +2,10 @@
"name": "sga-test",
"version": "0.1.0",
"description": "SGA Daemon Test Suite",
"main": "sga_test_spec.js",
"main": "spec/rest_spec.js",
"scripts": {
"test": "jasmine"
"test": "jasmine",
"lint": "eslint --fix --ext js ."
},
"repository": {
"type": "git",
......
......@@ -105,18 +105,17 @@ class SgaDaemon {
});
await events.once(sgaOutput, "open");
// TODO: find a better way to find the SGA deploy to be tested.
const sgaHome = "/home/maia/.luaenv/versions/sga";
const sgaLuaVer = "5.2";
const sgaLuaBin = `${sgaHome}/bin/lua`;
const sgaLuaPath = `${sgaHome}/share/lua/${sgaLuaVer}/?.lua;${sgaHome}/share/lua/${sgaLuaVer}/?/init.lua`;
const sgaCPath = `${sgaHome}/lib/lua/${sgaLuaVer}/?.so`;
const sgaRocksSetup = `package.path = '../?.lua;${sgaLuaPath};'..package.path
package.cpath = '${sgaCPath};'..package.cpath`;
const luaHome = "./lua_runtime";
const luaVer = "5.2";
const luaBin = `${luaHome}/bin/lua`;
const luaLPath = `${luaHome}/share/lua/${luaVer}/?.lua;${luaHome}/share/lua/${luaVer}/?/init.lua`;
const luaCPath = `${luaHome}/lib/lua/${luaVer}/?.so`;
const luaSetup = `package.path='./lua_custom/?.lua;../?.lua;${luaLPath}'
package.cpath='${luaCPath}'`;
this.process = child_process.spawn(
sgaLuaBin,
["-e", sgaRocksSetup, "../sgad.lua", configPath],
luaBin,
["-e", luaSetup, "../sgad.lua", configPath],
{ stdio: ["ignore", sgaOutput, sgaOutput] }
);
this.process.on("exit", (exitVal, signalName) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment