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

cleanup(dslx): use model.UnderlyingNetwork for testing #1377

Merged
merged 4 commits into from
Oct 20, 2023

Conversation

bassosimone
Copy link
Contributor

@bassosimone bassosimone commented Oct 20, 2023

We want to use the DSL inside the oohelperd. We don't care about
collecting observations in the oohelperd. So, the plan is that of
abstracting the ConnPool, renaming it Runtime, and giving it the
power to create abstract Traces.

The oohelperd will use a MinimalRuntime (sketched out by this
commit) that will not collect any observation.

Measuring code, instead, will use a MeasurexRuntime that will
collect observations.

This commit is just the first step. We rename and introduce the
MinimalRuntime. No significant functional changes so far.
Rather than using custom fields for testing, we can configure in the
runtime a custom model.MeasuringNetwork.

We're not doing this just to simplify the codebase, rather the underlying
intent here is making sure we don't need to keep much state in each
function, so we can refactor them to be pure functions wrapped by an
adapter that produces the desired type.

In turn, by doing that, we will be able to factor complexity around
invoking functions and parsing their results.

In turn, by doing that, we will be able to modify the signature of the
functions and do the following:

1. allow the DSL model to include stages that take in input a Maybe
value rather than a value, so we can observe failures more easily than
we do now and we can write inline code to save into test keys;

2. allow the DSL model to much more easily be refactored to use
channels, which in turn enables us to compose operations more naturally
and increase the amount of overlapping (think, e.g., how this enables
the possibility of waiting additional time for a DNS-over-UDP resolver
to wait for late/duplicate replies).
This diff modifies dslx functions to always use the MeasuringNetwork
for testing rather than using specific func fields.

By doing this, we open up the possibility of simplifying the state of
each func, with the ultimate goal of making them pure functions.

By making them pure functions, we make the code more manageable and
easy to modify, which opens up for additional refactorings.
@bassosimone bassosimone changed the title Issue/2524 small2 cleanup(dslx): use model.UnderlyingNetwork for testing Oct 20, 2023
@bassosimone bassosimone marked this pull request as ready for review October 20, 2023 12:24
@bassosimone bassosimone requested a review from hellais as a code owner October 20, 2023 12:24
@bassosimone
Copy link
Contributor Author

Merging with red alltests, which is fine given that we're not close to a release and we're seen some backend issues that probably are transient and caused by ongoing -test deployment of which I am aware.

@bassosimone bassosimone merged commit 18cef86 into master Oct 20, 2023
7 of 8 checks passed
@bassosimone bassosimone deleted the issue/2524-small2 branch October 20, 2023 12:35
Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this pull request Feb 13, 2024
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.

dslx: use model.UnderlyingNetwork for testing
1 participant