sdk
sdk copied to clipboard
Some analysis_server tests produce invalid analysis_options.yaml files due to passing an empty list for experiments instead of null.
While working on 352220, I came a cross a case where an invalid analysis_options.yaml was produced from some tests (namely: remove_break_test.dart).
It seems that the setUp function is passing an empty list for experiments instead of null to createAnalysisOptionsFile producing an invalid format for the analysis_options.yaml (i.e. a label without value):
https://github.com/dart-lang/sdk/blob/c3a626f729524ac8859ef8f7f06ebf4e98a43719/pkg/analysis_server/test/abstract_context.dart#L121-L138
Maybe the method above should check for both null and isNotEmpty for all the arguments if that wasn't intentional.
Great catch!
Maybe the method above should check for both null and isNotEmpty for all the arguments if that wasn't intentional.
Seems reasonable to me.
@scheglov?
It seems to me that it would be cleaner to give default const [], and check for .isNotEmpty instead of != null.
👍 I like that.
Hi @pq
I pushed a quick fix for this one as suggested by @scheglov at:
- https://dart-review.googlesource.com/c/sdk/+/352866
Side questions:
- what does the yellow color mean for those 9 tests?
- Also, I've been running the tests using
dart run test/test_all.dart-- is that sufficient for local testing?
These are @SkippedTest that we were not able to make reliable.
Thank you!
Also, I've been running the tests using dart run test/test_all.dart -- is that sufficient for local testing?
Should be, yes.