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

CI allows to use undeclared variables in Lua tests, defaulting them to nil #492

Open
Gerold103 opened this issue Oct 9, 2024 · 2 comments
Labels
bug Something isn't working qa

Comments

@Gerold103
Copy link
Collaborator

This isn't right. If a variable is undefined, it must not be treated as nil. It must be treated as an error. @Serpentian manages to catch such things locally while CI is totally green. Need to figure out what is the setting in CI that allows such behavior, and turn it off.

@Gerold103 Gerold103 added bug Something isn't working qa labels Oct 9, 2024
@Totktonada
Copy link
Member

Totktonada commented Oct 9, 2024

I guess CI works on tarantool releases built in the RelWithDebInfo mode, installed using the setup-tarantool action using the official Ubuntu packages. In this build mode, the strict module disables the check. It can be enabled using require('strict').on(). On the contrary, the Debug build mode enables the strict module. That's likely the reason why the problem was caught on a developer machine.

luatest automatically requires test/helper.lua file. You can use it to enable the strict mode.

We can also use TT_PRELOAD or an override module to achieve it for wider range of the tests.

@Gerold103
Copy link
Collaborator Author

Don't know if it solves the issue fully, probably not, but I did this: 19b4de4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working qa
Projects
None yet
Development

No branches or pull requests

2 participants