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

Regression test for sandboxed evaluation #176

Merged
merged 3 commits into from
Jun 17, 2024

Conversation

countvajhula
Copy link
Collaborator

Summary of Changes

Supersedes #173

Public Domain Dedication

  • In contributing, I relinquish any copyright claims on my contribution and freely release it into the public domain in the simple hope that it will provide value.

(Why: The freely released, copyright-free work in this repository represents an investment in a better way of doing things called attribution-based economics. Attribution-based economics is based on the simple idea that we gain more by giving more, not by holding on to things that, truly, we could only create because we, in our turn, received from others. As it turns out, an economic system based on attribution -- where those who give more are more empowered -- is significantly more efficient than capitalism while also being stable and fair (unlike capitalism, on both counts), giving it transformative power to elevate the human condition and address the problems that face us today along with a host of others that have been intractable since the beginning. You can help make this a reality by releasing your work in the same way -- freely into the public domain in the simple hope of providing value. Learn more about attribution-based economics at drym.org, tell your friends, do your part.)

This adds a regression test for the recent issue [1] where building docs
for packages depending on Qi was failing due to the use of macro
introspection functionality in the macro-debugger library inside a
sandboxed evaluator. This was recently fixed by handling the runtime
error resulting from requiring the macro debugger library (which is due
to the sandboxed evaluator disallowing macro introspection).

This regression test validates the bug and the fix.

The coverage checker was still showing the lambda used in "monkey
patching" the macro debugger utility as uncovered by tests. My guess is
that this is because the coverage tool only counts code as covered if
the evaluator used in the test runner evaluates those lines, whereas in
the present case, the code is "covered" by a sandboxed evaluator we
construct in the test rather than the test runner itself.

Assuming this is the right explanation, I've placed the original fix
inside a submodule---by default, the coverage checker ignores all
submodules [2] for the purposes of coverage. So in cases where we are
sure some code needn't be covered (or which we know is covered but isn't
detected, as in this case), we can use this recipe as a standard way to
add an exclusion to coverage.

[1]: https://github.com/drym-org/qi/wiki/Qi-Meeting-Mar-29-2024
[2]: https://docs.racket-lang.org/cover/api.html#%28def._%28%28lib._cover%2Fmain..rkt%29._irrelevant-submodules%29%29
@countvajhula countvajhula changed the title Regression test for sandboxed evaluatio Regression test for sandboxed evaluation Jun 17, 2024
@countvajhula countvajhula merged commit f5d3d2e into drym-org:main Jun 17, 2024
5 of 6 checks passed
@benknoble benknoble deleted the test-sandboxed-eval branch June 17, 2024 19:34
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.

1 participant