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

tests: various /lib/test-agent improvements #4157

Merged
merged 3 commits into from
Nov 12, 2024
Merged

Conversation

Fang-
Copy link
Member

@Fang- Fang- commented Nov 7, 2024

Most importantly, failing to initialize/set the agent core prior to running your tests could've resulted in false successes. Here we make sure that there's always a crashing skeleton core there, and that crashes with empty traces still result in failing tests.

Additionally, we add a +do-as helper for temporarily changing the src.bowl. Very convenient for tests that simulate multiple parties interacting with the same agent.

Previously, if you forgot to initialize the agent core to test against,
we would run with the bunt of $agent:gall, which is a core that just
silently succeeds.

Here, we put a skeleton agent into the continuation state, so that any
invocations crash (and show a high-priority printf warning you of this
fact).
In rare cases, the "mare" being evaluated may produce failure, but only
provide the empty tang. /ted/test works only with tangs, and considers
an empty tang to be success.

So, here, we catch that case, and produce a non-empty tang instead.
For certain tests it's common to switch back and forth between different
simulated callers frequently. Being able to wrap calls with (do-as ~pel)
or similar makes doing so much more ergonomic.
Copy link
Member

@arthyn arthyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -327,6 +347,17 @@
|= s=state
&+[~ s(scry f)]
::
++ do-as :: temporary src.bowl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@Fang- Fang- merged commit b12ca08 into develop Nov 12, 2024
1 check passed
@Fang- Fang- deleted the m/test-agent-fail-certainty branch November 12, 2024 15:35
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.

2 participants