[ve] Also check for interaction in e2e tests [devtools/devtools-frontend : main]

0 views
Skip to first unread message

Danil Somsikov (Gerrit)

unread,
Jul 2, 2024, 7:03:38 AM (22 hours ago) Jul 2
to Ergün Erdoğmuş, Simon Zünd, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
Attention needed from Ergün Erdoğmuş and Simon Zünd

Danil Somsikov voted

Auto-Submit+1
Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Ergün Erdoğmuş
  • Simon Zünd
Submit Requirements:
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: devtools/devtools-frontend
Gerrit-Branch: main
Gerrit-Change-Id: Iaa4cc979aef7ae2f01355c0a27ce161c730de773
Gerrit-Change-Number: 5666693
Gerrit-PatchSet: 3
Gerrit-Owner: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Ergün Erdoğmuş <erg...@chromium.org>
Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Attention: Simon Zünd <szu...@chromium.org>
Gerrit-Attention: Ergün Erdoğmuş <erg...@chromium.org>
Gerrit-Comment-Date: Tue, 02 Jul 2024 11:03:34 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Simon Zünd (Gerrit)

unread,
Jul 2, 2024, 7:11:28 AM (22 hours ago) Jul 2
to Danil Somsikov, Ergün Erdoğmuş, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
Attention needed from Danil Somsikov and Ergün Erdoğmuş

Simon Zünd added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Simon Zünd . resolved

I'll have a look tomorrow. This CL is adding a lot of non-trivial logic I wanna grok.

Open in Gerrit

Related details

Attention is currently required from:
  • Danil Somsikov
  • Ergün Erdoğmuş
Submit Requirements:
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: devtools/devtools-frontend
Gerrit-Branch: main
Gerrit-Change-Id: Iaa4cc979aef7ae2f01355c0a27ce161c730de773
Gerrit-Change-Number: 5666693
Gerrit-PatchSet: 3
Gerrit-Owner: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Ergün Erdoğmuş <erg...@chromium.org>
Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Attention: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Ergün Erdoğmuş <erg...@chromium.org>
Gerrit-Comment-Date: Tue, 02 Jul 2024 11:11:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Simon Zünd (Gerrit)

unread,
2:05 AM (3 hours ago) 2:05 AM
to Danil Somsikov, Ergün Erdoğmuş, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
Attention needed from Danil Somsikov and Ergün Erdoğmuş

Simon Zünd voted and added 5 comments

Votes added by Simon Zünd

Code-Review+1

5 comments

Patchset-level comments
Simon Zünd . resolved

lgtm with comments

File test/e2e/helpers/visual-logging-helpers.ts
Line 30, Patchset 3 (Latest):function compareVeEvents(actual: TestLogEntry, expected: TestLogEntry): {difference: number, description?: string} {
Simon Zünd . unresolved

Even though we don't export this function we should maybe add a doc comment that explains that `difference` is a value between [0, 1]. At least thats what I figured from the code?

Line 54, Patchset 3 (Latest): return {difference: 1};
Simon Zünd . unresolved

Would it be helpful here to have a description in this case that we expected an `interaction` but got `impressions` instead (or the other way around)?

Line 174, Patchset 3 (Latest):export async function expectVeEvents(expectedEvents: TestLogEntry[]) {
Simon Zünd . unresolved

We should also add a JSDoc comment here explicitly explaining the behavior. The code is somewhat hard to grok if anyone wanted to confirm what it's doing. Specifically:

1) It acts like a `contains`. It verifies only that the expected events are among all the logged events. It's not a "deep strict equal". (This might be obvious but better to document it explicitly).

2) Ordering is important. It verifies that the expected events show up in the specified order in the event stream.

Line 227, Patchset 3 (Latest):function editDistance(a: string, b: string) {
Simon Zünd . unresolved

Please add a comment which algorithm exactly this implements, ala `@returns the xyz distance". Googling for "edit distance" brings up a couple of algorithms.

Open in Gerrit

Related details

Attention is currently required from:
  • Danil Somsikov
  • Ergün Erdoğmuş
Submit Requirements:
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: devtools/devtools-frontend
Gerrit-Branch: main
Gerrit-Change-Id: Iaa4cc979aef7ae2f01355c0a27ce161c730de773
Gerrit-Change-Number: 5666693
Gerrit-PatchSet: 3
Gerrit-Owner: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Ergün Erdoğmuş <erg...@chromium.org>
Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Attention: Danil Somsikov <d...@chromium.org>
Gerrit-Attention: Ergün Erdoğmuş <erg...@chromium.org>
Gerrit-Comment-Date: Wed, 03 Jul 2024 06:05:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Danil Somsikov (Gerrit)

unread,
2:34 AM (3 hours ago) 2:34 AM
to Simon Zünd, Ergün Erdoğmuş, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
Attention needed from Ergün Erdoğmuş

Danil Somsikov voted and added 4 comments

Votes added by Danil Somsikov

Auto-Submit+1

4 comments

File test/e2e/helpers/visual-logging-helpers.ts
Line 30, Patchset 3:function compareVeEvents(actual: TestLogEntry, expected: TestLogEntry): {difference: number, description?: string} {
Simon Zünd . resolved

Even though we don't export this function we should maybe add a doc comment that explains that `difference` is a value between [0, 1]. At least thats what I figured from the code?

Danil Somsikov

Done

Line 54, Patchset 3: return {difference: 1};
Simon Zünd . resolved

Would it be helpful here to have a description in this case that we expected an `interaction` but got `impressions` instead (or the other way around)?

Danil Somsikov

This is unlikely to appear, but sure. Done.

Line 174, Patchset 3:export async function expectVeEvents(expectedEvents: TestLogEntry[]) {
Simon Zünd . resolved

We should also add a JSDoc comment here explicitly explaining the behavior. The code is somewhat hard to grok if anyone wanted to confirm what it's doing. Specifically:

1) It acts like a `contains`. It verifies only that the expected events are among all the logged events. It's not a "deep strict equal". (This might be obvious but better to document it explicitly).

2) Ordering is important. It verifies that the expected events show up in the specified order in the event stream.

Danil Somsikov

Done

Line 227, Patchset 3:function editDistance(a: string, b: string) {
Simon Zünd . resolved

Please add a comment which algorithm exactly this implements, ala `@returns the xyz distance". Googling for "edit distance" brings up a couple of algorithms.

Danil Somsikov

Done. It's Levenshtein, the usual one.

Open in Gerrit

Related details

Attention is currently required from:
  • Ergün Erdoğmuş
Submit Requirements:
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: devtools/devtools-frontend
Gerrit-Branch: main
Gerrit-Change-Id: Iaa4cc979aef7ae2f01355c0a27ce161c730de773
Gerrit-Change-Number: 5666693
Gerrit-PatchSet: 4
Gerrit-Owner: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Ergün Erdoğmuş <erg...@chromium.org>
Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Attention: Ergün Erdoğmuş <erg...@chromium.org>
Gerrit-Comment-Date: Wed, 03 Jul 2024 06:34:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Simon Zünd <szu...@chromium.org>
satisfied_requirement
open
diffy

Danil Somsikov (Gerrit)

unread,
2:34 AM (3 hours ago) 2:34 AM
to Simon Zünd, Ergün Erdoğmuş, Devtools-frontend LUCI CQ, devtools-rev...@chromium.org
Attention needed from Ergün Erdoğmuş

Danil Somsikov voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention is currently required from:
  • Ergün Erdoğmuş
Submit Requirements:
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: devtools/devtools-frontend
Gerrit-Branch: main
Gerrit-Change-Id: Iaa4cc979aef7ae2f01355c0a27ce161c730de773
Gerrit-Change-Number: 5666693
Gerrit-PatchSet: 4
Gerrit-Owner: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Ergün Erdoğmuş <erg...@chromium.org>
Gerrit-Reviewer: Simon Zünd <szu...@chromium.org>
Gerrit-CC: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Attention: Ergün Erdoğmuş <erg...@chromium.org>
Gerrit-Comment-Date: Wed, 03 Jul 2024 06:34:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Devtools-frontend LUCI CQ (Gerrit)

unread,
3:10 AM (2 hours ago) 3:10 AM
to Danil Somsikov, Simon Zünd, Ergün Erdoğmuş, devtools-rev...@chromium.org

Devtools-frontend LUCI CQ submitted the change with unreviewed changes

Unreviewed changes

3 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: test/e2e/helpers/visual-logging-helpers.ts
Insertions: 15, Deletions: 2.

@@ -27,6 +27,12 @@
return result.join('\n');
}

+// Compares the 'actual' log entry against the 'expected'. The difference of 0
+// indicates that events match. Positive values, maximum 1.0, means no match,
+// higher values represent larger difference.
+// For impressions events to match, all expected impressions need to be present
+// in the actual event. Unexected impressions in the actual event are ignored.
+// Interaction events need to match exactly.

function compareVeEvents(actual: TestLogEntry, expected: TestLogEntry): {difference: number, description?: string} {
   if ('interaction' in expected && 'interaction' in actual) {
if (expected.interaction !== actual.interaction) {
@@ -46,12 +52,16 @@
if (missing.length) {
return {
difference: missing.length / expected.impressions.length,
- description: 'Missing VE events:\n' + formatImpressions(missing),
+ description: 'Missing VE impressions:\n' + formatImpressions(missing),
};
}
return {difference: 0};
}
- return {difference: 1};
+ return {
+ difference: 1,
+ description: 'interaction' in expected ? 'Missing VE interaction:\n' + expected.interaction :
+ 'Missing VE impressions:\n' + formatImpressions(expected.impressions),
+ };
}

export function veImpressionsUnder(key: string, children: TestImpressionLogEntry[]) {
@@ -171,6 +181,8 @@
]);
}

+// Verifies that VE events contains all the expected events in given order.
+// Unexpected VE events are ignored.

export async function expectVeEvents(expectedEvents: TestLogEntry[]) {
   collapseConsecutiveImpressions(expectedEvents);

@@ -224,6 +236,7 @@
}
}

+// Computes the Levenshtein edit distance between two strings.

function editDistance(a: string, b: string) {
   const v0: number[] = [];
const v1: number[] = [];
```

Change information

Commit message:
[ve] Also check for interaction in e2e tests
Bug: 348173254
Change-Id: Iaa4cc979aef7ae2f01355c0a27ce161c730de773
Auto-Submit: Danil Somsikov <d...@chromium.org>
Commit-Queue: Danil Somsikov <d...@chromium.org>
Reviewed-by: Simon Zünd <szu...@chromium.org>
Files:
  • M test/e2e/helpers/animations-helpers.ts
  • M test/e2e/helpers/application-helpers.ts
  • M test/e2e/helpers/cross-tool-helper.ts
  • M test/e2e/helpers/visual-logging-helpers.ts
Change size: M
Delta: 4 files changed, 142 insertions(+), 44 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Simon Zünd
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: devtools/devtools-frontend
Gerrit-Branch: main
Gerrit-Change-Id: Iaa4cc979aef7ae2f01355c0a27ce161c730de773
Gerrit-Change-Number: 5666693
Gerrit-PatchSet: 5
Gerrit-Owner: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Danil Somsikov <d...@chromium.org>
Gerrit-Reviewer: Devtools-frontend LUCI CQ <devtools-fro...@luci-project-accounts.iam.gserviceaccount.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages