Skip to content

Encode testcase name to base64 when name contains forbidden symbols #244

@ligurio

Description

@ligurio

luatest has a parametrization feature. Test parameters also used by luatest for building testcase name.
However, parameters can contain symbols not allowed by luatest:

sergeyb@pony:~/sources/MRG/tarantool$ luatest -v test/app-luatest/uri_unit_test.lua                                                         ...ces/MRG/tarantool/test-run/lib/luatest/luatest/group.lua:61: Group name must not contain `/`: uri_url_encode.url:"/".url_encoded:"%2F"   
stack traceback:                                                                                                                            
        ...s/MRG/tarantool/test-run/lib/luatest/luatest/capture.lua:144: in function <...s/MRG/tarantool/test-run/lib/luatest/luatest/captur
e.lua:138>                                                            
        [C]: in function 'error'                                                                                                            
        ...ces/MRG/tarantool/test-run/lib/luatest/luatest/group.lua:61: in function 'initialize'
        ...ces/MRG/tarantool/test-run/lib/luatest/luatest/class.lua:40: in function 'new'                      
        .../tarantool/test-run/lib/luatest/luatest/parametrizer.lua:78: in function 'parametrize'                                           
        ...rces/MRG/tarantool/test-run/lib/luatest/luatest/init.lua:49: in function 'group'
        ...sources/MRG/tarantool/test/app-luatest/uri_unit_test.lua:95: in main chunk
        [C]: in function 'require'

<stripped>

There are at least two workarounds:

I suggest encoding a problem part of testcase name to base641 to avoid such issues.

Footnotes

  1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/digest/

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions