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

coverage #1

Merged
merged 7 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 6 additions & 9 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: test
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sudo apt-get install -y luarocks
sudo luarocks install luacov-coveralls
docker-compose up --exit-code-from sut
sudo docker cp mtt_sut_1:/root/.minetest /root/
sudo docker cp mtt_sut_1:/var/lib/minetest/luacov.stats.out .
sudo chmod 755 /root -R
ls -lha /root/.minetest .
luacov-coveralls -v
docker cp mtt_sut_1:/var/lib/minetest/luacov.report.out .
sed -i 's#/root/.minetest/worlds/world/worldmods/test_mod/#test/mod/#g' luacov.report.out
- name: Coveralls
uses: coverallsapp/github-action@v1
with:
path-to-lcov: "luacov.report.out"
1 change: 1 addition & 0 deletions execute.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local function shutdown()
minetest.request_shutdown("success")
if mtt.luacov_runner then
mtt.luacov_runner.save_stats()
mtt.luacov_runner.run_report()
end
end

Expand Down
3 changes: 2 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ if mtt.enabled then
end

mtt.luacov_runner.init({
include = include_paths
include = include_paths,
reporter = "lcov"
})
end
end
Expand Down
3 changes: 2 additions & 1 deletion test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM registry.gitlab.com/minetest/minetest/server:${ENGINE_VERSION}
USER root

RUN apk add --no-cache lua-dev luarocks &&\
luarocks-5.1 install luacov
luarocks-5.1 install luacov &&\
luarocks-5.1 install luacov-reporter-lcov

ENTRYPOINT minetestserver --config /minetest.conf