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

Add coverage tooling, update test tooling and improve coverage #24

Merged
merged 3 commits into from
Nov 18, 2021

Conversation

DifferentialOrange
Copy link
Member

@DifferentialOrange DifferentialOrange commented Nov 12, 2021

Rework of #18 . No major changes were introduced: Tarantool bump in tests, using Makefile in tests and separation of lint and test stage in Makefile, minor syntax reworks. PR was separated to 3 commits with descriptions (where they are needed).

Commentary

"Ugly" trailing commas for one-liner tables in the first version of PR seems to be irrelevant to lunarmodules/luacov#52 issue: they considered covered even without extra commas:
image

@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/no1seman-coverage branch 2 times, most recently from fedcbf7 to 7a74b4c Compare November 15, 2021 09:44
@DifferentialOrange DifferentialOrange marked this pull request as ready for review November 15, 2021 09:52
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/no1seman-coverage branch from 7a74b4c to 5fd4155 Compare November 15, 2021 09:59

.PHONY: lint
lint:
if [ ! -d ".rocks" ]; then make .rocks; fi
Copy link
Member

Choose a reason for hiding this comment

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

That's a bit strange. You can make .rocks non-phony target to achieve the same behaviour. But, it seems, you don't want, because it may miss some dependencies (say, after manual tarantoolctl rocks make). That's minor, though.

Copy link
Member Author

Choose a reason for hiding this comment

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

I borrowed it from original PR, but I think the motivation was the same as your assumption.

Copy link
Member

Choose a reason for hiding this comment

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

I would do it so:

.rocks/bin/luacheck
        tarantoolctl rocks install luacheck <ver>

.rocks/bin/luatest
        tarantoolctl rocks install luatest <ver>

.rocks/bin/luacov
        tarantoolctl rocks install luacov <ver>

.PHONY: dependencies
dependencies:
        tarantoolctl rocks make

.PNOHY: dependencies-test
depdendencies-test: depdendencies .rocks/bin/luacheck .rocks/bin/luatest .rocks/bin/luacov
        true

But simpler is better and if everything typically works okay, I propose to don't make things more complex.

Makefile Outdated
Comment on lines 26 to 29
.PHONY: build
build:
if [ ! -d ".rocks" ]; then make .rocks; fi
tarantoolctl rocks make
tarantoolctl rocks pack graphql scm-1
Copy link
Member

Choose a reason for hiding this comment

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

Why we may need to create .all.rock for scm-1?

Copy link
Member Author

Choose a reason for hiding this comment

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

I borrowed it from original PR, but I also were in several situations when I have found a bug in a rock package with my application and after drafting a fix I wanted to ensure that issue with my application is resolved by installing scm-1 and running some tests (for me it was tarantool/metrics).

Copy link
Member

Choose a reason for hiding this comment

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

Okay, but why do you need to pack it for that? Do you use a rock tarball for deployment within an application?

Copy link
Member Author

@DifferentialOrange DifferentialOrange Nov 18, 2021

Choose a reason for hiding this comment

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

Well, to install myrock to app/.rocks, I move packed rock to app and use tarantoolctl rocks install ./myrock-scm-1.all.rock. I don't know how to transfer it another way.

Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

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

Strange tihng with commas, but okay.

I have a few comment (see above), but they are quite minor.

LGTM.

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
Last entries line in multiline table considered as non-covered by luacov
if it has no trailing comma. See more about the issue in luacov repo:
lunarmodules/luacov#52

Based on PR #18 by @no1seman
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOrange/no1seman-coverage branch from 5fd4155 to ba8857c Compare November 18, 2021 06:54
@Totktonada Totktonada merged commit b7eaca4 into master Nov 18, 2021
@Totktonada Totktonada deleted the DifferentialOrange/no1seman-coverage branch November 18, 2021 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants