Add test_async_returnvalue to test_other.py. NFC#26092
Add test_async_returnvalue to test_other.py. NFC#26092sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
Conversation
This test I believe is the only one where we have custom JS library function that user asyncify. Its useful to be able to this these tests outside the browser too.
| 'nothing': (['-DBAD'],), # noqa | ||
| 'empty_list': (['-DBAD', '-sASYNCIFY_IMPORTS=[]'],), # noqa | ||
| 'em_js_bad': (['-DBAD', '-DUSE_EM_JS'],), # noqa | ||
| }) |
There was a problem hiding this comment.
This is a bunch of duplicated code with test_browser. Maybe we can just test this outside of the browser in the other file? That is, right after self.btest there, we can add self.do_runf?
Or, perhaps we can find a nice way to share such logic between browser and non-browser?
There was a problem hiding this comment.
(Specifically, I worry that we update one test over time, improving it, but forget to update the other version in the other file)
There was a problem hiding this comment.
I share this concern, but also this is not a new things. We have many quite a few tests that are run both in browserpy and in other.py or core.py.
I agree it would be nice to have better way to express this duplication.
Also, how do we decide which tests should run in the browser at all? This test, for example, is not testing anything browser specific? Does that mean we should not run it under the browser?
Perhaps we should allow certain tests in test_other.py and test_core.py to be tagged as "@also_run_in_browser" ? Or perhaps we should run all other.py or core.py tests in the browser in certain CI configs.
All of this sounds quick complicated though...
My general feeling is if a test can run outside the browser then there should be a way to run it outside the browser. We have have a way to run browser tests using --browser=node.. maybe we should push more on that option?
I'll leave this PR as a draft for now.
There was a problem hiding this comment.
I like the idea to lean on --browser=node more. maybe a decorator could make a browser test also run in that mode, something like that - hopefully that is simple?
This test I believe is the only one where we have custom JS library function that user asyncify. Its useful to be able to this these tests outside the browser too.