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

fix(qatool): reduce generated test cases churn #1505

Merged
merged 6 commits into from
Feb 12, 2024
Merged

Conversation

bassosimone
Copy link
Contributor

@bassosimone bassosimone commented Feb 12, 2024

We add dns.nextdns.io to the QA suite, such that we don't get a wrong NXDOMAIN when trying to use it as the resolver.

We optionally sort the test keys to ensure there's less churn in diffs produced when regenerating minipipeline test data.

We fix ./script/updateminipipeline.bash to use ./script/go.bash for building as opposed to using go.

Also, include endpoint information in tls_handshake_{start,stop} and http_transaction_{start,stop} events such that they are sorted correctly when we sort events to reduce churn. This is necessary because we're using the endpoint information to sort the network events.

Part of ooni/probe#2677; the churn is still too high, and I need more changes.

We add dns.nextdns.io to the QA suite, such that we don't get a
wrong NXDOMAIN when trying to use it as the resolver.

We optionally sort the test keys to ensure there's less churn in
diffs produced when regnerating minipipeline test data.

We fix ./script/updateminipipeline.bash to use ./script/go.bash
for building as opposed to using go.

Closes ooni/probe#2677
@bassosimone bassosimone requested a review from hellais as a code owner February 12, 2024 12:59
tk.ClientResolver = value
tk.mu.Unlock()
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't need this function because we set the field after all measurements have completed.

@@ -59,13 +59,15 @@ func NewLinearWebAnalysis(input *WebObservationsContainer) (output []*WebObserva
// TagDepth sort at the end of the generated list.
if left.TagDepth.UnwrapOr(-1) > right.TagDepth.UnwrapOr(-1) {
return true
} else if left.TagDepth.UnwrapOr(-1) < right.TagDepth.UnwrapOr(-1) {
}
if left.TagDepth.UnwrapOr(-1) < right.TagDepth.UnwrapOr(-1) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We prefer a coding style without else if when there's a previous return.

"tags": [
"depth=0",
"fetch_body=true"
]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's another bug here: we're not adding the endpoint to tls_handshake_xxx and http_transaction_xxx events, which means that they do not sort correctly within the generated JSON.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will fix this bug as a separate pull request because it seems this one is already huge 😞

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, and maybe instead I can just fix it here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, so, compromise: doing here for LTE, doing in the future for the DSLs.

0,
nil,
started,
trace.Tags()...,
))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is such that we have the endpoints in this event (because... why not? It helps with sorting and I don't see why omitting a piece of information we know would ever be wrong).

0,
nil,
finished,
trace.Tags()...,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is such that we have the endpoints in this event (because... why not? It helps with sorting and I don't see why omitting a piece of information we know would ever be wrong).

0,
nil,
started,
trace.Tags()...,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is such that we have the endpoints in this event (because... why not? It helps with sorting and I don't see why omitting a piece of information we know would ever be wrong).

0,
nil,
finished,
trace.Tags()...,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is such that we have the endpoints in this event (because... why not? It helps with sorting and I don't see why omitting a piece of information we know would ever be wrong).

nil,
t,
tx.tags...,
):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is such that we have the endpoints in this event (because... why not? It helps with sorting and I don't see why omitting a piece of information we know would ever be wrong).

nil,
t,
tx.tags...,
):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is such that we have the endpoints in this event (because... why not? It helps with sorting and I don't see why omitting a piece of information we know would ever be wrong).

@bassosimone bassosimone merged commit 55586ad into master Feb 12, 2024
25 checks passed
@bassosimone bassosimone deleted the issue/2677 branch February 12, 2024 16:35
Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this pull request Feb 13, 2024
We add dns.nextdns.io to the QA suite, such that we don't get a wrong
NXDOMAIN when trying to use it as the resolver.

We optionally sort the test keys to ensure there's less churn in diffs
produced when regenerating minipipeline test data.

We fix ./script/updateminipipeline.bash to use ./script/go.bash for
building as opposed to using go.

Also, include endpoint information in `tls_handshake_{start,stop}` and
`http_transaction_{start,stop}` events such that they are sorted
correctly when we sort events to reduce churn. This is necessary because
we're using the endpoint information to sort the network events.

Part of ooni/probe#2677; the churn is still
too high, and I need more changes.
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