Skip to content

Commit cd375d0

Browse files
DifferentialOrangeTotktonada
authored andcommitted
Measure test coverage
Add Makefile for convenient local run. Use Makefile in test CI. Add luacov dependency and run luatest with coverage. Keep /tmp for luacov reports. Based on PR #18 by @no1seman
1 parent 965bb6c commit cd375d0

File tree

5 files changed

+41
-7
lines changed

5 files changed

+41
-7
lines changed

.github/workflows/test_on_push.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ jobs:
2121
tarantool-version: ${{ matrix.tarantool-version }}
2222

2323
- name: Install dependencies
24-
run: |
25-
tarantoolctl rocks install luatest 0.5.5
26-
tarantoolctl rocks install luacheck 0.26.0
27-
tarantoolctl rocks make
24+
run: make .rocks
2825

2926
- name: Run linter
30-
run: .rocks/bin/luacheck .
27+
run: make lint
3128

3229
- name: Run tests
33-
run: .rocks/bin/luatest -v
30+
run: make test

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
.doctrees
77
__pycache__
88
/dev
9-
/tmp
9+
/tmp/*
10+
!/tmp/.keep
1011
doc
1112
release
1213
release-doc
@@ -28,3 +29,4 @@ luacov.*.out*
2829
*.mo
2930
.history
3031
.vscode
32+
*.rock

.luacov

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
statsfile = 'tmp/luacov.stats.out'
2+
reportfile = 'tmp/luacov.report.out'
3+
exclude = {
4+
'/test/',
5+
'/tmp/',
6+
}

Makefile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
SHELL := /bin/bash
2+
3+
.PHONY: .rocks
4+
.rocks: graphql-scm-1.rockspec Makefile
5+
tarantoolctl rocks make
6+
tarantoolctl rocks install luatest 0.5.5
7+
tarantoolctl rocks install luacov 0.13.0
8+
tarantoolctl rocks install luacheck 0.26.0
9+
10+
.PHONY: lint
11+
lint:
12+
if [ ! -d ".rocks" ]; then make .rocks; fi
13+
.rocks/bin/luacheck .
14+
15+
.PHONY: test
16+
test:
17+
if [ ! -d ".rocks" ]; then make .rocks; fi
18+
rm -f tmp/luacov*
19+
.rocks/bin/luatest --verbose --coverage --shuffle group
20+
.rocks/bin/luacov . && grep -A999 '^Summary' tmp/luacov.report.out
21+
22+
.PHONY: clean
23+
clean:
24+
rm -rf .rocks
25+
26+
.PHONY: build
27+
build:
28+
if [ ! -d ".rocks" ]; then make .rocks; fi
29+
tarantoolctl rocks pack graphql scm-1

tmp/.keep

Whitespace-only changes.

0 commit comments

Comments
 (0)