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

fix(TAP-output): error if no test files #731

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

notomo
Copy link
Contributor

@notomo notomo commented Oct 22, 2023

This pr will fix the following error that if no test files:

busted --output=TAP
not ok 1 - 
/home/linuxbrew/.linuxbrew/opt/lua/bin/lua5.4: ...w/.linuxbrew/share/lua/5.4/busted/outputHandlers/TAP.lua:44: attempt to concatenate a nil value (field 'currentline')
stack traceback:
        ...w/.linuxbrew/share/lua/5.4/busted/outputHandlers/TAP.lua:44: in upvalue 'showFailure'
        ...w/.linuxbrew/share/lua/5.4/busted/outputHandlers/TAP.lua:87: in field 'fn'
        /home/linuxbrew/.linuxbrew/share/lua/5.4/mediator.lua:103: in function </home/linuxbrew/.linuxbrew/share/lua/5.4/mediator.lua:96>
        (...tail calls...)
        ...uxbrew/share/lua/5.4/busted/modules/test_file_loader.lua:46: in upvalue 'getTestFiles'
        ...uxbrew/share/lua/5.4/busted/modules/test_file_loader.lua:57: in upvalue 'getAllTestFiles'
        ...uxbrew/share/lua/5.4/busted/modules/test_file_loader.lua:72: in local 'testFileLoader'
        /home/linuxbrew/.linuxbrew/share/lua/5.4/busted/runner.lua:173: in function 'busted.runner'
        ...linuxbrew/lib/luarocks/rocks-5.4/busted/scm-1/bin/busted:3: in main chunk
        [C]: in ?

📝 after fix

This behavior is the same with others output handlers.

busted --output=TAP
not ok 1 - 
# Failure message: Cannot find file or directory: spec
not ok 2 - 
# Failure message: No test files found matching Lua pattern: _spec
1..2

@Tieske Tieske merged commit 95a7b9e into lunarmodules:master Oct 24, 2023
26 checks passed
@notomo notomo deleted the fix-tap-no-test-error branch October 24, 2023 12:03
@alerque
Copy link
Member

alerque commented Oct 24, 2023

Thanks for taking the time to contribute @notomo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants