Commit Graph

61 Commits

Author SHA1 Message Date
Brian Wilkerson 45d8c7ee4b Stop using main in test code in more places, part 3
Change-Id: Ia35343f4d79037875fe154a38a3adcf8117d9369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243881
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-05-06 22:34:50 +00:00
Konstantin Shcheglov 20b560226e Rename newFile2() to newFile().
Change-Id: I1c2a4f15dee607a0a6241dfaf2d764a7d284389b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241510
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-19 02:59:57 +00:00
Konstantin Shcheglov 9ab676b6d0 Migrate analysis domain tests to PubPackageAnalysisServerTest.
Change-Id: I684d027906b118d2c0fddd8f64930ae291ed8827
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239365
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-30 17:01:00 +00:00
Konstantin Shcheglov 38a0305768 Inline 'testFilePathPlatform' as 'testFile.path'.
Change-Id: I6b27af152f91a639e1dfc09a2b1a4da286692a38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239124
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-29 05:55:45 +00:00
Konstantin Shcheglov 4247bcbbdc Extract PubPackageAnalysisServerTest.
Change-Id: Ib952f26c226f147221471af0366bf9c95c7bc5b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239201
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-28 21:48:20 +00:00
Konstantin Shcheglov 7f2350f386 Move some AbstractAnalysisTest based tests to PubPackageAnalysisServerTest.
Change-Id: I8d2fd9a2a6f01aaf0394069c9a0c3f7d72229d96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239011
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-28 15:46:30 +00:00
Konstantin Shcheglov 41b3e0abcc Make 'content' required in ResourceProviderMixin.newFile()
Change-Id: Id697b0736b95a913c31247a66425027852f1ddc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-14 17:31:48 +00:00
Danny Tuppeny 650b9627b7 [analysis_server] Rebuild analysis contexts if changes occur between creation and watchers being ready
See https://github.com/Dart-Code/Dart-Code/issues/3438.

Change-Id: I3ca038d8c878b118a465b6f230c62912d63990eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/222763
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-01-15 00:18:41 +00:00
Brian Wilkerson 02d50e7ebf Migrate several test classes
Change-Id: I7477d5c42a8c2f953c51aca7ab6fff8b6fc930f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195840
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-04-19 00:38:19 +00:00
Konstantin Shcheglov e97f1bdbf0 Switch analysis_server to language 2.12, so null safety, but opt-out files.
This should allow doing partial migration, specifically protocol files,
which are imported by other libraries, but are a small library cycle
that does not import much outside of it.

Change-Id: I904c05d6d5b444ee9a9dbd1f7ada12aabdcc5165
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 23:39:37 +00:00
Mike Fairhurst 1134a0f17c [analysis_server] Remove unused dart:async imports
Change-Id: I764ee78cb9e31bdb3abaa36ca4754e1fed180311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161447
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-02 17:29:52 +00:00
Brian Wilkerson 8969b1839c Enable omit_local_variable_types in analysis_server
Change-Id: I7e5c13d40fd276854601681fc84be321e6031b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141583
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-30 03:58:44 +00:00
Brian Wilkerson 8efdee06d6 Begin adding return types in analysis_server
Change-Id: Id0daa52236bdc90cba6bfd7cf81d1b4cf47603c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133544
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-28 21:18:30 +00:00
Brian Wilkerson 4043a6fce3 Remove unnecessary uses of new in analysis_server
Other than analysis_options.yaml, all of the changes were from running
dartfix.

Change-Id: I92411642f12a00fc6bd0bfd24dd60fe67f0fed16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128845
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-18 19:01:51 +00:00
Konstantin Shcheglov 6de1c478c3 Revert "Revert "Issue 34152. Verify file paths and report INVALID_FILE_PATH_FORMAT.""
This reverts commit 3f8ea3f508.

Change-Id: Ib034895f4cf29492e66dd07b7da1a99ba5e94bf6
Reviewed-on: https://dart-review.googlesource.com/c/90885
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-24 17:30:41 +00:00
Konstantin Shcheglov 3f8ea3f508 Revert "Issue 34152. Verify file paths and report INVALID_FILE_PATH_FORMAT."
This reverts commit 5dab28f27f.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Issue 34152. Verify file paths and report INVALID_FILE_PATH_FORMAT.
> 
> R=​brianwilkerson@google.com, paulberry@google.com
> 
> Bug: https://github.com/dart-lang/sdk/issues/34152
> Change-Id: I4a5f3634c342fbcfb3bf39c060cc658d87306312
> Reviewed-on: https://dart-review.googlesource.com/c/90840
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com

Change-Id: Ib34cb3497bc2935a27622b5f5b187e1e315c8e46
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/34152
Reviewed-on: https://dart-review.googlesource.com/c/90900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-24 01:01:45 +00:00
Konstantin Shcheglov 5dab28f27f Issue 34152. Verify file paths and report INVALID_FILE_PATH_FORMAT.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/34152
Change-Id: I4a5f3634c342fbcfb3bf39c060cc658d87306312
Reviewed-on: https://dart-review.googlesource.com/c/90840
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-23 22:11:17 +00:00
Brian Wilkerson 47e988b781 Clean up the remaining copyright notices in analysis_server
Change-Id: Iee3110f92ab0f24312ddd1eff407d2229f895321
Reviewed-on: https://dart-review.googlesource.com/c/89101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-11 15:38:56 +00:00
Konstantin Shcheglov e3c8774543 Add AnalysisSession.analysisContext, stop using AnalysisDriver's AnalysisResult outside the driver.
Change-Id: I63138e002d9e777f51d2d843f7ef2b1f32fed3e0
Reviewed-on: https://dart-review.googlesource.com/c/82529
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-02 14:16:31 +00:00
Konstantin Shcheglov 1f52372bfa Remove CFE integration from analyzer, analysis_server, and analyzer_cli.
AnalysisDriverResolutionTest is partially updated, about 30 failing
tests added. I will get back to it in a following CL, it is not
directly CFE integration, but updated understanding how we want to
resolve. For example we don't need types for non-expression identifiers.

Change-Id: I3daddbb6c66ffad7a726f3313a1199fd7387aa04
Reviewed-on: https://dart-review.googlesource.com/71883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-29 13:46:45 +00:00
Konstantin Shcheglov 6f9073bb9d Wait for Analysis Server errors only while waiting for a response.
Change-Id: Ifd07293322b69cc9bab98e3698d63249b62abdb0
Reviewed-on: https://dart-review.googlesource.com/69242
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-10 00:34:48 +00:00
Brian Wilkerson ef2f777625 Mark some analyzer tests as being flaky
Change-Id: I61838bd32427ea18000df33181cf908783607240
Reviewed-on: https://dart-review.googlesource.com/69180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-09 16:19:41 +00:00
Brian Wilkerson 95d1ebd9f0 Fix one cause of timeouts in tests
Change-Id: I8514c7a1e89c69bbbf11882fa734903cd7c7569c
Reviewed-on: https://dart-review.googlesource.com/68430
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-06 16:08:05 +00:00
Brian Wilkerson f169ebf418 Fork several server tests to run under CFE
Change-Id: I9ca4184dc5458304f3f1597681fc1c936972d8bd
Reviewed-on: https://dart-review.googlesource.com/67880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-01 20:18:40 +00:00
Danny Tuppeny 40d7fe87f1 Fix GetErrorsTest on Windows
Bug: https://github.com/dart-lang/sdk/issues/32226
Change-Id: I0636fb61ffdec435e5f84a6c85ae102151a5a609
Reviewed-on: https://dart-review.googlesource.com/43680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-26 15:27:37 +00:00
Danny Tuppeny 40e3f9addc Convert paths for mock SDK libraries to fix tests on Windows
The other lines on this method are calling `provider.convertPath` around their paths but these ones do not, which is causing almost all analysis server tests to fail on Windows (for me - I can't explain them not
failing builds). This causes the hard-coded paths like `/lib/core/core.dart` to be fixed up to `C:\lib\core\core.dart` which is what the server is looking for (because at the other end the paths *have* been fixed up).

See #32226.

Closes #32230
https://github.com/dart-lang/sdk/pull/32230

GitOrigin-RevId: 1adeee23f8ac8efc8acf61caf5f769e4ec44c030
Change-Id: Id9bf195967db0912c6f4b67bd79d504e627b8aab
Reviewed-on: https://dart-review.googlesource.com/42300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-20 18:55:38 +00:00
Brian Wilkerson 1d8a5d77c1 Convert more tests to use ResourceProviderMixin
Change-Id: Ia4cce51e33c79c82a989bfda9b8303dfaa72e103
Reviewed-on: https://dart-review.googlesource.com/31880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-02 00:47:34 +00:00
Konstantin Shcheglov 00d5012906 Format analyzer, analysis_server, analyzer_plugin, front_end and kernel with the latest dartfmt.
...instead of mixing formatting with actual changes in many CLs.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975253002 .
2017-07-13 16:28:18 -07:00
Brian Wilkerson a0d7d64f0b Convert more tests
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2936123002 .
2017-06-13 19:38:59 -07:00
Brian Wilkerson fb982f5476 Make server use the common protocol classes
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2879273002 .
2017-05-15 09:35:46 -07:00
Brian Wilkerson 27f9e5e4ce Reverse the sense of the flag to make it easier to find test that need to be converted
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2884593003 .
2017-05-15 08:40:40 -07:00
Brian Wilkerson e55812a3f2 Unify the server and plugin versions of the generators
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2844273003 .
2017-04-28 07:46:29 -07:00
Konstantin Shcheglov 05a86a7495 Remove 'initializeTestEnvironment' from 'analysis_server'.
Also fixes the server_options_test.dart:22 test broken in https://codereview.chromium.org/2394683006/

R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2402483002 .
2016-10-06 10:26:17 -07:00
Konstantin Shcheglov de4d8b3a78 Switch analysis_server to use 'package:test'.
I'm changing DEPS in the corresponding analyzer CL.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2394683006 .
2016-10-06 08:47:15 -07:00
Konstantin Shcheglov c302b65584 Use async/await in all analysis domain tests.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1478513002 .
2015-11-24 14:18:37 -08:00
Konstantin Shcheglov cfb7d61a9c Issue 25034. Record only the target source's errors.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25034

Review URL: https://codereview.chromium.org/1477553002 .
2015-11-24 14:00:00 -08:00
Konstantin Shcheglov abe8d87e0e Implement AnalysisServer.getContainingContext() using ContextManager.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1455163005 .
2015-11-18 14:10:35 -08:00
Brian Wilkerson 9ad256cf18 Move the wire protocol support into the public API
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1398293002 .
2015-10-11 07:34:28 -07:00
Brian Wilkerson 908708d655 More fixes for failures on the Windows bot
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1266923004 .
2015-08-05 08:13:28 -07:00
Paul Berry 128dec84b5 Separate the API's used by ContextManager.
Previously, ContextManager had two API's: one used by analysis server
to tell the ContextManager what to do, and one used by the
ContextManager to make callbacks to analysis server in response to its
requests.  The first API was implemented in the class
AbstractContextManager, which derived from ContextManager, and the
second API was implemented in ServerContextManager, which derived from
AbstractContextManager.

In addition to causing confusion, this made it impossible to provide
an alternate implementation of ContextManager as a plug-in, since the
plug in would have had to re-implement the second API, and that would
have required accessing private implementation details of the
ContextManager.

This CL separates the API's: the first API is specified in
ContextManager and implemented in ContextManagerImpl, and the second
API is specified in ContextManagerCallbacks and implemented in
ServerContextManagerCallbacks.

In the long run I hope to eliminate the ContextManagerCallbacks class
entirely, by having the ContextManager tell its client what to do
using return values rather than callbacks.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1243893002 .
2015-07-21 10:40:57 -07:00
Brian Wilkerson 0c6872acef Hook for overriding the ContextManager and some code clean-up (with more to follow)
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1223413003 .
2015-07-13 10:20:13 -07:00
scheglov@google.com 9efb25fa50 Use package:test_reflective_loader instead of reflective_tests.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1101003002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45365 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 20:54:29 +00:00
brianwilkerson@google.com cd58e290c4 Reformat
R=paulberry@google.com

Review URL: https://codereview.chromium.org//969113002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44151 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 22:43:12 +00:00
danrubel@google.com b35d83dbad Revert 43227
BUG=

Review URL: https://codereview.chromium.org//878353002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43228 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 04:48:18 +00:00
danrubel@google.com 5a7c80ab80 (TBR) fix the build
BUG=dartbug.com/22180

Review URL: https://codereview.chromium.org//882913003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43227 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 04:30:36 +00:00
scheglov@google.com a38a503d86 Replace @ReflectiveTestCase() with @reflectiveTest.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//849863002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42821 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 17:11:24 +00:00
scheglov@google.com c7a131a7d5 Churn only: move analysis notification tests.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//563373003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40396 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-17 20:16:29 +00:00
paulberry@google.com 9279b9fe81 Fix error handling in analysis.getError.
Analysis.getError now has the following behaviors:

- If the file in question does not exist, or is not subject to
  analysis, a new error called GET_ERRORS_INVALID_FILE is generated.

- If the server's internal state (the set of active analysis contexts)
  changes while the query is in process, the query is transparently
  restarted; the client no longer receives a GET_ERRORS_ERROR error.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//532403002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39871 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-04 14:34:43 +00:00
paulberry@google.com 8d8ee25cff Merge analysis_testing package into analysis_server.
Note that analysis_server already contains a file test/mocks.dart, so
the mocks.dart file from analysis_testing has been imported as
test/mocks2.dart.  I will merge these two into a single file in a
future CL.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//533243002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39814 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 18:11:42 +00:00
paulberry@google.com d092a96981 Clarify type names in analysis server API.
The following types are renamed:

- ErrorFixes -> AnalysisErrorFixes
- ErrorSeverity -> AnalysisErrorSeverity
- ErrorType -> AnalysisErrorType

This clarifies that the types have to do with the
errors/warnings/hints generated by the analysis of user code, as
opposed to analysis server protocol errors.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//531153002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39770 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 19:54:03 +00:00