-
Notifications
You must be signed in to change notification settings - Fork 81
Update tests that are incompatible with 3.0.0
#1817
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
Merged
Merged
Changes from 25 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
80f0130
Fix first test
elliette 3b78175
Fix another test
elliette 78ddf72
Tried to fix third test
elliette 106fb39
Trying to fix test again
elliette a2e26f8
Trying to fix more tests
elliette c18a336
More fixes
elliette 35f440e
Fix another test - skipping in null-safety due to https://github.com/…
elliette d344798
Format
elliette 225fe4c
Fix another test
elliette c82d501
Frontend server and sound null-safety are incompatible
elliette 056d882
Format
elliette 8f60853
Fix analyze error
elliette a956aa3
Fix a few more tests
elliette 1d75011
fix analyzer errors
elliette 3785481
Update more tests
elliette 6936bdf
fix analyzer errors
elliette 3728c10
Fix ternary
elliette 034d2bb
Fix more tests
elliette 56b2c46
Fix analyze error
elliette db6b25f
Fix more tests
elliette e57b549
Format
elliette 2ff8ca0
Fix debug extension tests
elliette 66246b7
More fixes to debug extension test
elliette 33c98d5
More test fixes
elliette ead3aa6
Remove unused import
elliette 7f3b9ba
Update build_daemon_callstack_test
elliette 69acf60
Update build_daemon_circular_evaluate_test
elliette 169598c
Update frontend_server_breakpoint_test
elliette 93160fc
Update build_daemon_evaluate_test
elliette bcd2882
Update frontend_server_callstack_test
elliette dc66516
Update frontend_server_circular_evaluation_test
elliette fe1b09b
Update frontend_server_evaluate_test
elliette 7343cac
Remove all version compatibility helpers except for supportedMode
elliette c61d524
Revert changes to devfs
elliette 3a5a6c4
Reference issues in chrome proxy service tests
elliette 8012a27
Update more tests
elliette File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ import 'package:dwds/src/services/chrome_proxy_service.dart'; | |
import 'package:dwds/src/utilities/dart_uri.dart'; | ||
import 'package:http/http.dart' as http; | ||
import 'package:path/path.dart' as path; | ||
import 'package:pub_semver/pub_semver.dart' as semver; | ||
import 'package:test/test.dart'; | ||
import 'package:vm_service/vm_service.dart'; | ||
import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; | ||
|
@@ -126,7 +125,7 @@ void main() { | |
|
||
test('addBreakpointWithScriptUri absolute file URI', () async { | ||
final current = context.workingDirectory; | ||
final test = path.join(path.dirname(current), '_test'); | ||
final test = path.join(path.dirname(current), '_testSound'); | ||
final scriptPath = Uri.parse(mainScript.uri!).path.substring(1); | ||
final fullPath = path.join(test, scriptPath); | ||
final fileUri = Uri.file(fullPath); | ||
|
@@ -464,56 +463,47 @@ void main() { | |
expect(library1, equals(library2)); | ||
}); | ||
|
||
test( | ||
'Classes', | ||
() async { | ||
final testClass = await service.getObject( | ||
isolate.id!, rootLibrary!.classes!.first.id!) as Class; | ||
expect( | ||
testClass.functions, | ||
unorderedEquals([ | ||
predicate( | ||
(FuncRef f) => f.name == 'staticHello' && f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'message' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'notFinal' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'hello' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == '_equals' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'hashCode' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'toString' && !f.isStatic!), | ||
predicate( | ||
(FuncRef f) => f.name == 'noSuchMethod' && !f.isStatic!), | ||
predicate( | ||
(FuncRef f) => f.name == 'runtimeType' && !f.isStatic!), | ||
])); | ||
expect( | ||
testClass.fields, | ||
unorderedEquals([ | ||
predicate((FieldRef f) => | ||
f.name == 'message' && | ||
f.declaredType != null && | ||
!f.isStatic! && | ||
!f.isConst! && | ||
f.isFinal!), | ||
predicate((FieldRef f) => | ||
f.name == 'notFinal' && | ||
f.declaredType != null && | ||
!f.isStatic! && | ||
!f.isConst! && | ||
!f.isFinal!), | ||
predicate((FieldRef f) => | ||
f.name == 'staticMessage' && | ||
f.declaredType != null && | ||
f.isStatic! && | ||
!f.isConst! && | ||
!f.isFinal!), | ||
])); | ||
}, | ||
// TODO(elliette): Remove once 2.15.0 is the stable release. | ||
skip: semver.Version.parse(Platform.version.split(' ').first) >= | ||
semver.Version.parse('2.15.0-268.18.beta') | ||
? null | ||
: 'SDK does not expose static member information.', | ||
); | ||
test('Classes', () async { | ||
final testClass = await service.getObject( | ||
isolate.id!, rootLibrary!.classes!.first.id!) as Class; | ||
expect( | ||
testClass.functions, | ||
unorderedEquals([ | ||
predicate((FuncRef f) => f.name == 'staticHello' && f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'message' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'notFinal' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'hello' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == '_equals' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'hashCode' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'toString' && !f.isStatic!), | ||
predicate( | ||
(FuncRef f) => f.name == 'noSuchMethod' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'runtimeType' && !f.isStatic!), | ||
])); | ||
expect( | ||
testClass.fields, | ||
unorderedEquals([ | ||
predicate((FieldRef f) => | ||
f.name == 'message' && | ||
f.declaredType != null && | ||
!f.isStatic! && | ||
!f.isConst! && | ||
f.isFinal!), | ||
predicate((FieldRef f) => | ||
f.name == 'notFinal' && | ||
f.declaredType != null && | ||
!f.isStatic! && | ||
!f.isConst! && | ||
!f.isFinal!), | ||
predicate((FieldRef f) => | ||
f.name == 'staticMessage' && | ||
f.declaredType != null && | ||
f.isStatic! && | ||
!f.isConst! && | ||
!f.isFinal!), | ||
])); | ||
// TODO(https://github.com/dart-lang/webdev/issues/1818) Re-enable. | ||
}, skip: true); | ||
|
||
test('Runtime classes', () async { | ||
final testClass = await service.getObject( | ||
|
@@ -612,15 +602,6 @@ void main() { | |
expect(obj.valueAsString, '42'); | ||
}); | ||
|
||
test('null', () async { | ||
final ref = await service.evaluate( | ||
isolate.id!, bootstrap!.id!, 'helloNum(null)') as InstanceRef; | ||
final obj = await service.getObject(isolate.id!, ref.id!) as Instance; | ||
expect(obj.kind, InstanceKind.kNull); | ||
expect(obj.classRef!.name, 'Null'); | ||
expect(obj.valueAsString, 'null'); | ||
}); | ||
|
||
test('Scripts', () async { | ||
final scripts = await service.getScripts(isolate.id!); | ||
assert(scripts.scripts!.isNotEmpty); | ||
|
@@ -740,63 +721,53 @@ void main() { | |
expect(world.offset, 3); | ||
}); | ||
|
||
test( | ||
'offset/count parameters are ignored for Classes', | ||
() async { | ||
final testClass = await service.getObject( | ||
isolate.id!, | ||
rootLibrary!.classes!.first.id!, | ||
offset: 100, | ||
count: 100, | ||
) as Class; | ||
expect( | ||
testClass.functions, | ||
unorderedEquals([ | ||
predicate( | ||
(FuncRef f) => f.name == 'staticHello' && f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'message' && !f.isStatic!), | ||
predicate( | ||
(FuncRef f) => f.name == 'notFinal' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'hello' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == '_equals' && !f.isStatic!), | ||
predicate( | ||
(FuncRef f) => f.name == 'hashCode' && !f.isStatic!), | ||
predicate( | ||
(FuncRef f) => f.name == 'toString' && !f.isStatic!), | ||
predicate( | ||
(FuncRef f) => f.name == 'noSuchMethod' && !f.isStatic!), | ||
predicate( | ||
(FuncRef f) => f.name == 'runtimeType' && !f.isStatic!), | ||
])); | ||
expect( | ||
testClass.fields, | ||
unorderedEquals([ | ||
predicate((FieldRef f) => | ||
f.name == 'message' && | ||
f.declaredType != null && | ||
!f.isStatic! && | ||
!f.isConst! && | ||
f.isFinal!), | ||
predicate((FieldRef f) => | ||
f.name == 'notFinal' && | ||
f.declaredType != null && | ||
!f.isStatic! && | ||
!f.isConst! && | ||
!f.isFinal!), | ||
predicate((FieldRef f) => | ||
f.name == 'staticMessage' && | ||
f.declaredType != null && | ||
f.isStatic! && | ||
!f.isConst! && | ||
!f.isFinal!), | ||
])); | ||
}, | ||
// TODO(elliette): Remove once 2.15.0 is the stable release. | ||
skip: semver.Version.parse(Platform.version.split(' ').first) >= | ||
semver.Version.parse('2.15.0-268.18.beta') | ||
? null | ||
: 'SDK does not expose static member information.', | ||
); | ||
test('offset/count parameters are ignored for Classes', () async { | ||
final testClass = await service.getObject( | ||
isolate.id!, | ||
rootLibrary!.classes!.first.id!, | ||
offset: 100, | ||
count: 100, | ||
) as Class; | ||
expect( | ||
testClass.functions, | ||
unorderedEquals([ | ||
predicate( | ||
(FuncRef f) => f.name == 'staticHello' && f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'message' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'notFinal' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'hello' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == '_equals' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'hashCode' && !f.isStatic!), | ||
predicate((FuncRef f) => f.name == 'toString' && !f.isStatic!), | ||
predicate( | ||
(FuncRef f) => f.name == 'noSuchMethod' && !f.isStatic!), | ||
predicate( | ||
(FuncRef f) => f.name == 'runtimeType' && !f.isStatic!), | ||
])); | ||
expect( | ||
testClass.fields, | ||
unorderedEquals([ | ||
predicate((FieldRef f) => | ||
f.name == 'message' && | ||
f.declaredType != null && | ||
!f.isStatic! && | ||
!f.isConst! && | ||
f.isFinal!), | ||
predicate((FieldRef f) => | ||
f.name == 'notFinal' && | ||
f.declaredType != null && | ||
!f.isStatic! && | ||
!f.isConst! && | ||
!f.isFinal!), | ||
predicate((FieldRef f) => | ||
f.name == 'staticMessage' && | ||
f.declaredType != null && | ||
f.isStatic! && | ||
!f.isConst! && | ||
!f.isFinal!), | ||
])); | ||
// TODO(https://github.com/dart-lang/webdev/issues/1818) Re-enable. | ||
}, skip: true); | ||
|
||
test('offset/count parameters are ignored for bools', () async { | ||
final ref = await service.evaluate( | ||
|
@@ -838,7 +809,7 @@ void main() { | |
expect(obj.kind, InstanceKind.kNull); | ||
expect(obj.classRef!.name, 'Null'); | ||
expect(obj.valueAsString, 'null'); | ||
}); | ||
}, skip: true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add issue reference? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, done! |
||
}); | ||
}); | ||
|
||
|
@@ -860,8 +831,8 @@ void main() { | |
|
||
// Containts part files as well. | ||
expect(scriptUris, contains(endsWith('part.dart'))); | ||
expect(scriptUris, | ||
contains('package:intl/src/intl/date_format_helpers.dart')); | ||
expect( | ||
scriptUris, contains('package:intl/src/date_format_internal.dart')); | ||
}); | ||
|
||
group('getSourceReport', () { | ||
|
@@ -1368,7 +1339,7 @@ void main() { | |
expect( | ||
resolvedUris.uris, | ||
containsAll([ | ||
contains('/_test/example/hello_world/main.dart'), | ||
contains('/_testSound/example/hello_world/main.dart'), | ||
contains('/lib/path.dart'), | ||
contains('/lib/src/path_set.dart'), | ||
])); | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
We should be able to run with weak null safety and 3.0.0 for a while (maybe a special flag is needed for the frontend?) so I suggest to run for all modes and skip the ones that are not working currently with a reference to an issue.
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.
Switched to using
NullSafety.values
(here and elsewhere) and skipping with a TODO