-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Running SDK tests through VS Code fails with Top-level main() function takes arguments
#60437
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
The test package does not support running tests that require command line arguments. It should however support this case... it is supposed to allow functions which have an optional arguments parameter. Maybe that isn't working correctly? |
Oh, it looks like the main function for that test actually looks like this |
It looks like this test hangs if ran through the test runner still. I noticed its trying to read from stdin so that might be the issue. |
Oh, I don't know where I quoted that code from above, because it doesn't seem to match what's in the file I also quoted.
😬 Is there an easy way to confirm if that test is running on the bots? |
The bots don't use the test runner - and it works fine if ran manually - so would assume the bots can run it just fine today. The issue seems to be that it is actually returning the value of I tried just not returning the result of that function call but then I get other issues. |
This whole test just needs some work to be runnable with the test runner. The specific issue is actually here - all this code should be in a That still doesn't get the tests passing with the test runner, but it is closer. I get an issue connecting to the VM service though. |
The one that reads from stdin? How do the bots satisfy that? It's not clear to me if many of these tests are expected to work with the test runner, but I'll have a run through all the ones in the common packages I open and see if I can get them working (otherwise, we might need to reconsider defaulting to using the test runner in the SDK, which would be a shame). |
Is there some difference between how tests (produced by calling |
I think the code path I saw there was actually for a subprocess of the test itself, or some code path that this specific test isn't hitting at all, it was a red herring.
Previously they couldn't even try, so it isn't surprising they did things that don't work. But ideally we would get them all running that way.
Yes, lots of differences. Usually they don't matter but sometimes they do. |
@jakemac53 could you tag this with appropriate |
The original report here was slightly bogus, because the code I quoted wasn't the code causing the error. There's still an issue here, but it spans multiple SDK packages - the issue is really "the SDK packages have many tests that do not work through We could rename this issue, or we could try splitting it up for the different packages. I'm working through some of the tests (in packages I'm familiar with) but I don't know how many will be simple fixes (eg. don't use |
Originally posted by @DanTup in #56220
The text was updated successfully, but these errors were encountered: