-
Notifications
You must be signed in to change notification settings - Fork 323
dil file is being created when I run a test #4243
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
Comments
I can repro outside of VS Code by running from the terminal:
It does not seem to occur if you don't pass I'll take a look. |
@christopherfujino I've had a look at this and now understand the issue, but I'm not sure how best to fix. The issue is that in flutter/flutter#113481 I made a change that results in the test file being compiled for unit tests where it was not previously:
I can easily fix this and avoid that code running for unit tests (because it's unnecessary) and the problem will go away. However, the same problem exists for integration tests, because in order to initialize the compiler we're still running the code above for those. For unit tests, the thing we compile to set up the expression compiler is a "listener" file in the temporary directory (so the dill is created alongside that). But for integration tests, there's no such file (at least not in One fix would be to write an empty/dummy temporary file and compile that, but it feels like a hack. I'm not familiar enough with this code to know if there's a better way. |
chatted offline with Danny, and from reading the code it's not obvious to me why we're creating dill next to the source file, as it looks like we should be compiling to a temp file that gets cleaned up afterwards. I believe Danny will investigate further. |
@christopherfujino so, I figured out it was this line causing the copy: I don't really know what the purpose of this copy is, since it's just a copy of another file. I tried removing the copy here: However lots of tests broke with non-obvious reasons:
With the original code, in the case of running tests here the file we compiled as a temporary file so dumping the dill next to it was fine. After my changes, I was compiling the test file which meant a dill was produced there. So, I'm trying to use an empty temporary file instead (for integration tests - with unit tests reverting to their original behaviour of compiling the "dart listener file"): This change is mostly just reverting the original change, but now produces an empty
I don't think this is a good solution, but it will be good to understand if it works. There's actually a slight change in behaviour here as (I'll do some more digging after lunch when bots on flutter/flutter#114887 will hopefully have completed) |
@christopherfujino I may require some assistance 😄. All of the things I tried were unsuccessful..
Perhaps part of the problem is that I don't understand why there are so many files in this code here:
Many of these files are just copies of others, and some of them don't even seem to be used directly (for example |
When I run a test from VS Code (by selecting the "Debug" option that floats above the tests main method), VS code creates a dil file with the same name as the test. I have to manually delete these files from source control before committing.
The text was updated successfully, but these errors were encountered: