lux is a test automation framework with Expect style execution of commands.
A good tutorial/introduce is this talk about Lux, presented at the Erlang User Conference 2019.
lux is very useful for creating tests that exercise interfaces, commands, APIs, etc.
The main motivation for this post is that I think more people (outside context where lux has been created) should be aware about lux and its features. lux is a very good tool to add into our skill set.
The main source of documentation is its own documentation page, there is a short tutorial here. And more examples lux/examples at master · hawk/lux · GitHub.
Outside lux project, I’ve found two projects using lux for testing:
And my own try using lux for systemic testing:
- meta-erlang/lib/oeqa/runtime/files/lux at master · meta-erlang/meta-erlang · GitHub Testing meta-erlang with LuX | meta-erlang
Some random ideas to improve lux usage would be:
-
swap rebar3 shelltests (rebar3/.github/workflows/shelltests.yml at main · erlang/rebar3 · GitHub) GitHub - tsloughter/rebar3_tests: Rebar3 ShellTestRunner tests, rewriting them using lux instead
-
create a plugin for running lux test using rebar3, like run lux scripts from test/**.lux files with
rebar3 lux -
improve lux documentation with exdoc
Thanks