Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lua5.1 compatibility #89

Merged
merged 9 commits into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aggregate/convert_to_json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ when 'java'
),
infile
)
when 'lua', 'nim'
when 'lua5.1', 'lua5.2', 'lua5.3', 'nim'
add_kst_adoption(
JUnitXMLParser.new("#{infile}/report.xml").to_h,
infile
Expand Down
34 changes: 26 additions & 8 deletions ci-lua
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
#!/bin/sh
#!/bin/bash
smarek marked this conversation as resolved.
Show resolved Hide resolved

. ./config

rm -rf "$TEST_OUT_DIR/lua"
mkdir -p "$TEST_OUT_DIR/lua"
ALLOWED_LUA_VERSIONS=("5.1" "5.2" "5.3")
CURRENT_LUA_VERSION=""

# try to use $VARIETY from env
for allowed_version in "${ALLOWED_LUA_VERSIONS[@]}"; do
if [[ "${allowed_version}" = "${VARIETY}" ]]; then
CURRENT_LUA_VERSION="${VARIETY}"
fi
done
smarek marked this conversation as resolved.
Show resolved Hide resolved

if [ -z "${CURRENT_LUA_VERSION}" ]; then
# fallback to version 5.1
CURRENT_LUA_VERSION="5.1"
fi

LUA_OUT_DIR="${TEST_OUT_DIR}/lua${CURRENT_LUA_VERSION}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that different Lua versions should have separate directories. The current approach is that one language goes only into one directory, the language version doesn't matter. Using a special branch for every target in the ci_artifacts repo ensures that there are no conflicts.

See branches python/2.7 and python/3.4 for instance, all test artifacts go to directory test_out/python in both cases, not test_out/python2 or something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, maybe I'm confused by ci-python, ci-python3, ci-python3 scripts, that use different directories. However it seems those are not run in Travis CI, only the ci-python one in differently configured environment.
I've reverted, and hopefuly the kaitai-io/kaitai_ci_ui#8 will suffice to differentiate test targets


rm -rf "${LUA_OUT_DIR}"
mkdir -p "${LUA_OUT_DIR}"

export LUA_PATH="$LUA_PATH;$LUA_RUNTIME_DIR/?.lua;spec/lua/?.lua;spec/lua/extra/?.lua;compiled/lua/?.lua;;"

# Add `lua_install` dir to PATH, as this is where hererocks installs Lua at CI
export PATH=$PATH:$PWD/../lua_install/bin

# Detect lua executable
if lua5.3 -v; then
LUA_BIN=lua5.3
if lua${CURRENT_LUA_VERSION} -v; then
LUA_BIN=lua${CURRENT_LUA_VERSION}
elif lua -v; then
LUA_BIN=lua
else
echo "Unable to detect lua executable, bailing out :("
exit 1
fi

"$LUA_BIN" spec/lua/run_test_suite.lua -v -o junit -n "$TEST_OUT_DIR/lua/report"
"$LUA_BIN" spec/lua/run_test_suite.lua --output junit --name "${LUA_OUT_DIR}/report"

./kst-adoption-report lua
aggregate/convert_to_json lua "$TEST_OUT_DIR/lua" "$TEST_OUT_DIR/lua/ci.json"
./kst-adoption-report "lua${CURRENT_LUA_VERSION}"
aggregate/convert_to_json "lua${CURRENT_LUA_VERSION}" "${LUA_OUT_DIR}" "${LUA_OUT_DIR}/ci.json"
4 changes: 2 additions & 2 deletions kst-adoption-report
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def glob_spec_files(lang)
Dir.glob('spec/java/src/**/Test*.java')
when 'javascript'
Dir.glob('spec/javascript/test_*.js')
when 'lua'
Dir.glob('spec/lua/test_*.lua')
when 'lua5.1', 'lua5.2', 'lua5.3'
Dir.glob("spec/#{lang}/test_*.lua")
when 'nim'
Dir.glob('spec/nim/tests/t*.nim')
when 'perl'
Expand Down
2 changes: 1 addition & 1 deletion run-lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

export LUA_PATH="$LUA_PATH;$LUA_RUNTIME_DIR/?.lua;spec/lua/?.lua;spec/lua/extra/?.lua;compiled/lua/?.lua;;"

lua5.3 spec/lua/run_test_suite.lua -v
lua spec/lua/run_test_suite.lua -v
2 changes: 1 addition & 1 deletion spec/lua/run_test_suite.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.