Skip to content

505/examples/cleanup - #506

Merged
rvirding merged 7 commits into
developfrom
505/examples/cleanup
Nov 13, 2025
Merged

rvirding merged 7 commits into
developfrom
505/examples/cleanup

Conversation

@oubiwann

@oubiwann oubiwann commented Oct 31, 2025 •

Copy link
Copy Markdown
Member

Fixes #505

This changeset represents a comprehensive effort to add automated test coverage to the 22 examples in the LFE examples directory, along with fixing some examples that had accumulated bitrot over time.

This change includes a new test/examples_SUITE.lfe file, which provides some good CT coverage for the examples, providing us with more confidence that changes in LFE will be maintained in the examples. The test suite includes both compilation tests (verifying that each example compiles without errors) and functional tests (verifying that examples actually execute correctly and produce expected results).

Following Lisp conventions, some files were renamed files from underscores to hyphens:

  • ets_demo.lfe → ets-demo.lfe
  • lfe_eval.lfe → lfe-eval.lfe
  • mnesia_demo.lfe → mnesia-demo.lfe
  • ping_pong.lfe → ping-pong.lfe

There were some new Erlang APIs, deprecations, formatting issues, etc., that were also addressed in this change.

Also fixed formatting.
Also added clean as a prereq for tests. I ran into a problem switching
between branches where .beam files from different branches had
accumulated in ./test and were causing all sorts of test failures.
@oubiwann
oubiwann force-pushed the 505/examples/cleanup branch from d3e39bc to 19ef223 Compare November 13, 2025 16:20
@oubiwann
oubiwann marked this pull request as ready for review November 13, 2025 16:20
@oubiwann

Copy link
Copy Markdown
Member Author

Note that in this branch I've also updated the Makefile:

 clean:
-       rm -rf $(EBINDIR)/*.beam erl_crash.dump comp_opts.mk
+       rm -rf $(EBINDIR)/*.beam erl_crash.dump comp_opts.mk test/*.beam
 
-tests:
+tests: clean
        @rebar3 as test do compile,eunit,eunit,proper -n 20, ct

The reason for this: I ran into a problem switching between branches where .beam files from different branches had accumulated in ./test and were causing all sorts of test failures.

@oubiwann

Copy link
Copy Markdown
Member Author

Tests are passing locally (macos) but not in CI/CD (linux); looking into this ...

@oubiwann

Copy link
Copy Markdown
Member Author

Okay, got tests for examples working in CI/CD -- this is ready for review!

@rvirding
rvirding merged commit 1d0de5e into develop Nov 13, 2025
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.

Add CT suite for examples and do some examples house cleaning

2 participants