Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Roll dwds to
24.0.0
and unified_analytics6.1.0
#147250Roll dwds to
24.0.0
and unified_analytics6.1.0
#147250Changes from 2 commits
65635f1
03bc61e
138a2dc
a8f52d5
931601a
97e7438
c350891
a5128e8
e588d98
b58f013
515d695
45f6e14
bc59013
28ebeed
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you make this change? It looks like this changes the semantics of this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With 6.1.0, the
Analytics.fake
constructor will only take aMemoryFileSystem
, before it was aFileSystem
which led to some bugs while i was migrating devtools because i didn't catch it was using my real filesystem.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it turns out that globals.fs is not always a MemoryFileSystem for this test file which is why i swapped it out for a MemoryFileSystem... this works for the test because we don't touch the filesystem within the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I will have to think about this. This code seems non-ideal because we now have multiple file systems in a single test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is globals.fs a MemoryFileSystem? If so, maybe we should just do a cast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit where the two testbed test libraries were re-written to just not use
FakeAnalytics
from package:unified_analytics: bc59013There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More generally (and outside the scope of this PR), it might be advantageous in the tool if we just stopped importing
FakeAnalytics
from package:unified_analytics, if breaking changes to that class is going to necessitate these kinds of refactors.Even more generally, we should try at all costs to avoid having duplicate instances of globals within a single test run (in this case
FileSystem
), as that leads to very difficult to reason about correctness bugs. This is especially easy to do with theTestBed
, which is one of the reasons we stopped using it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM, this makes sense for those files since we aren't actually testing if an event was sent using the built in logic in package:unified_analytics
I also agree with this, the change I had pushed most recently was using only one FileSystem, it was just a bit more work to get the delegate if we used the
ThrowingForwardingFileSystem
in that one testI think there is value in using the exported
FakeAnalytics
because there may be tests that rely on the logic for package:unified_analytics to be correct. I do agree though that we don't really need to be usingFakeAnalytics
for tests that don't check for events sent, we could probably swap those with theNoOpAnalytics
since we usually just add it to the class constructor being testedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give concrete examples?
If we want to know which events were sent, we can use the fake implementation I have here, right? Or is there additional behavior we want to test for that we would not want to re-implement here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me just file a separate issue where we can discuss independent of this roll :)