Commit Graph

28 Commits

Author SHA1 Message Date
Karl Burtram
f288bee294 Make nullable warnings a per file opt-in (#1842)
* Make nullable warnings a per file opt-in

* Remove unneeded compiler directives

* Remove compiler directive for User Data
2023-02-03 18:10:07 -08:00
David Shiflet
839acf67cd Convert most tools service tests to nunit (#1037)
* Remove xunit dependency from testdriver

* swap expected/actual as needed

* Convert Test.Common to nunit

* port hosting unit tests to nunit

* port batchparser integration tests to nunit

* port testdriver.tests to nunit

* fix target to copy dependency

* port servicelayer unittests to nunit

* more unit test fixes

* port integration tests to nunit

* fix test method type

* try using latest windows build for PRs

* reduce test memory use
2020-08-05 13:43:14 -04:00
Charles Gagnon
de1bab9f1e Fix Intellisense not working for saved files (#867)
* Fix tools service to store the corrected file path

* Use ClientFilePath for key

* Further fixes

* Undo spacing changes

* Fix tests

* Trigger CI rebuild
2019-09-19 11:28:40 -07:00
ranasaria
09652cccd1 Enhanced Logging for sqltoolsservice (#695)
This change modifies the logging framework within sqltoolservice.
Moves away from custom Logger object to start using .Net tracing framework. It supports for the static Trace and TraceSource way of logging. For all new code it is recommend that we log the log messages using the existing static Logger class, while the code changes will continue to route the older Trace.Write* calls from the process to same log listeners (and thus the log targets) as used by the Logger class. Thus tracing in SMO code that uses Trace.Write* methods gets routed to the same file as the messages from rest of SQLTools Service code.
Make changes to start using .Net Frameworks codebase for all logging to unify our logging story.
Allows parameter to set tracingLevel filters that controls what kinds of message make it to the log file.
Allows a parameter to set a specific log file name so if these gets set by external code (the UI code using the tools service for example) then the external code is aware of the current log file in use.
Adding unittests to test out the existing and improved logging capabilities.


Sequences of checkins in development branch:
* Saving v1 of logging to prepare for code review. Minor cleanup and some end to end testing still remains
* Removing local launchSettings.json files
* added support for lazy listener to sqltoolsloglistener and removed incorrect changes to comments across files in previous checkin
* Converting time to local time when writing entries to the log
* move the hosting.v2 to new .net based logging code
* removing *.dgml files and addding them to .gitignore
* fixing typo of defaultTraceSource
* Addressing pull request feedback
* Adding a test to verify logging from SMO codebase
* propogating changes to v1 sqltools.hosting commandoptions.cs to the v2 version
* Fixing comments on start and stop callstack methods and whitespaces
* Commenting a test that got uncommented by mistake
* addding .gitattributes file as .sql file was observed to be misconstrued as a binary file
2018-09-24 23:55:59 -07:00
Aditya Bist
bc8aef6a15 fixed sproc failing peek definition (#550)
* fixed sproc failing peek definition

* changed commented out tests for peek definition
2017-11-27 15:08:22 -08:00
Aditya Bist
49f0221dc8 updated smo nuget package with latest bits (#508)
* updated smo nuget package with latest bits

* added new nupkg

* fixed peek definition test

* fixed batch parser wrapper tests
2017-10-19 18:02:47 -07:00
Kevin Cunnane
4b66203dfc Fix tools service crash + improve server edition naming (#506)
* Fix https://github.com/Microsoft/vscode-mssql/issues/986 and add better server edition naming
- Fixed a number of issues related to the binding queue, specifically the fact that it didn't capture exceptions that occurred on the binding thread. This caused the thread to crash the service.
  - The root cause of the error was when you get a connection error during init of the SmoMetadataProvider which threw an exception. Because of this no Binder was created, and the code would null ref later during processing
  - Added logic to handle null ref issue and other related code
  - Added a unit test for the new error handling path, and supported still returning some value in this case
- Separately, have a fix for an issue where the edition is shown as "SQL Azure" for all Azure connections. Fixing to be "Azure SQL DB" for this case and handle when the database reports as DW or Stretch instead. This maps better to users concept of what the edition should be and avoids returning what is an outdated term.

* Messed up the test - fixing this by returning the expected return object
2017-10-19 10:42:26 -07:00
Aditya Bist
05702182ab Task/script refactor (#476)
* scripting working with race conditions

* new service works with no race conditions

* use new scripting service and commented out tests

* refactored peek definition to use mssql-scripter

* fixed peek definition tests

* removed auto gen comment

* fixed peek definition highlighting bug

* made scripting async and fixed event handlers

* fixed tests (without cancel and plan notifs)

* removed dead code

* added nuget package

* CR comments + select script service implementation

* minor fixes and added test

* CR comments and script select

* added unit tests

* code review comments and cleanup

* fixed failing scripting tests
2017-10-03 14:41:18 -07:00
Aditya Bist
e7756b0bf1 Task/script refactor (#446)
* scripting working with race conditions

* new service works with no race conditions

* use new scripting service and commented out tests

* refactored peek definition to use mssql-scripter

* fixed peek definition tests

* removed auto gen comment

* fixed peek definition highlighting bug

* made scripting async and fixed event handlers

* fixed tests (without cancel and plan notifs)

* removed dead code

* added nuget package

* CR comments + select script service implementation

* minor fixes and added test

* CR comments and script select

* added unit tests

* code review comments and cleanup
2017-10-02 12:02:43 -07:00
Leila Lali
c28a97e6fa Fix/integrationtests (#391)
* fixed the problem with parsing sql2017 version
2017-06-22 09:20:58 -07:00
Karl Burtram
dc3cd9ea59 Create DB work in-progress (#350)
* Stage changes to other machine

* Stage changes

* Update SMO to fix SMO missing Login bug on macOS
2017-05-15 18:48:04 -07:00
Leila Lali
0b39408eae added handler for oe refresh and close session requests (#332)
* added handler for oe refresh and close session requests
2017-05-01 15:20:02 -07:00
Aditya Bist
c4227c2e24 fix peek definition integration tests (#330)
* removed race condition in peek definition test

* temporarily disabled peek definition tests

* fixed peek definition connection race condition

* commented out flaky test

* reenabled peek definition tests by removing race condition
2017-04-26 15:50:00 -07:00
Aditya Bist
850cf8c3e4 Bug/fix peek definition integration test (#324)
* removed race condition in peek definition test

* temporarily disabled peek definition tests

* fixed peek definition connection race condition

* commented out flaky test
2017-04-19 14:59:58 -07:00
Aditya Bist
6daadcf8cc Bug/fix peek definition integration test (#313)
* removed race condition in peek definition test

* temporarily disabled peek definition tests

* fixed peek definition connection race condition
2017-04-13 16:03:44 -07:00
Aditya Bist
1a384d93b4 Bug/fix peek definition integration test (#306)
* removed race condition in peek definition test

* temporarily disabled peek definition tests
2017-04-05 16:03:58 -07:00
Aditya Bist
f9138b27df removed race condition in peek definition test (#305) 2017-04-04 17:57:37 -07:00
Aditya Bist
9e8e1df95e fixed peek definition tokenizing (#281)
* fixed peek definition tokenizing

* fixed signature help test

* added new heuristic for PeekDefinition behaviour

* added tests for new heuristic

* fixed code according to Kevin's CR

* fixed failing test due to shared connection

* changed uri for procedure test
2017-03-23 13:19:59 -07:00
Karl Burtram
addad29b7c Add Scripter class and use it in the ScriptingService (#286)
* Initial scripting commit

* Fix the script CREATE integration test

* Use language service binding queue for scripting

* Update scripting service to have methods for each operation

* Add scripter class

* Fix build break.

* Fix a few bugs

* Use scripter class instead of PeekDefinition class.

* Fix scripting test break

* Fix header incorrectly saying file is generated.

* Add localization tests to address a large block of code not covered by automation.

* Moving system usings to top of using list
2017-03-21 13:18:52 -07:00
Benjamin Russell
1166778249 Isolate Shared Test Code (#252)
The goal of this make sure that test code is correctly organized to ensure that test suites aren't dependent on each other.
* UnitTests get their own project now (renaming Microsoft.SqlTools.ServiceLayer.Test to Microsoft.SqlTools.ServiceLayer.UnitTests) which is about 90% of the changes to the files.
* IntegrationTests no longer depends on UnitTests, only Test.Common
* Any shared components from TestObjects that spins up a "live" connection has been moved to IntegrationTests Utility/LiveConnectionHelper.cs
* The dictionary-based mock file stream factory has been moved to Test.Common since it is used by UnitTests and IntegrationTests
    * Added a overload that doesn't take a dictionary for when we don't care about monitoring the storage (about 90% of the time)
* The RunIf* wrapper methods have been moved to Test.Common
* OwnerUri and StandardQuery constants have been moved to Test.Common Constants file

* Updating to latest SDK version available at https://www.microsoft.com/net/core#windowscmd

* Moving unit tests to unit test folder

* Changing namespaces to UnitTests

* Moving some constants and shared functionality into common project, making the UnitTests reference it

* Unit tests are working!

* Integration tests are working

* Updating automated test runs

* Fixing one last broken unit test

* Exposing internals for other projects

* Moving edit data tests to UnitTest project

* Applying refactor fixes to unit tests

* Fixing flaky test that wasn't awaiting completion
2017-03-02 13:00:31 -08:00
Sharon Ravindran
9cc9a76ba8 Fix peek definition test (#242)
* Fix UpdateLanguageService in test

* Use separate language service instance

* Remoce commented code

* Refactor test

* Fix typo
2017-02-17 17:59:27 -08:00
Sharon Ravindran
b10d6bdfdc Check database case sensitivity for peek definition token matching (#227)
* Check database case sensitivity before peek definition token matching

* Add sr gen

* add tests for ignore case

* remove sr.Designer
2017-02-08 12:34:01 -08:00
Sharon Ravindran
50195faced Fix to get the current database context for peek definition (#220)
* Get db name from query connection

* Add comments

* Correct typos

* revert changes to .sln

* Add unit tests

* Fix typo

* Fix error due to a mistyped comment
2017-02-03 17:50:55 -08:00
Leila Lali
41d38b2107 fixed the problem in peekdefinition tests 2017-01-25 17:09:10 -08:00
Leila Lali
dcff5dd915 New tool to store SQL connection configs locally (#218)
* added a new tool to store SQL connections locally. Modified the peek definition tests to create test database before running test


* fixed failing test QueryExecutionPlanInvalidParamsTest

* Fixes based on code review comments

* fixed failing test GetSignatureHelpReturnsNotNullIfParseInfoInitialized
2017-01-25 16:19:27 -08:00
Sharon Ravindran
5464e4e63a Feature/peek def code gen (#215)
* Add codeGen for existing types

* Modify code gen logic to match current code

* Extend logic for new smo objects

* Add logic to retrieve token type from QuickInfo

* Remove duplicate types

* Add tests for new types

* Modify GetScript logic to use suggestions first

* Add more tests

* Modify codeGen to include quickInfo logic

* Cake build changes to run CodeGen

* CodeGen replace indentation

* Refactor GetScript and add more tests

* Refactor Resolver calls

* Fix TestDriver test for Definition

* Change quickInfo string case

* Revert change sto .sln file

* Fix typos in comments

* change String to string

* Rename test sql objects
2017-01-19 13:24:58 -08:00
Leila Lali
b353b2137e New test common project for database connections using the settings.json (#210)
* moved test driver tests and test common classes to separate projects
2017-01-11 13:47:56 -08:00
Connor Quagliana
3ad7cc1a8b Move Integration Tests to dedicated project (#201)
Add IntegrationTests project. Move all tests ifdef'd with LIVE_CONNECTION_TESTS to IntegrationTests project. Delete files that have no remaining code. Update codecoverage.bat to run integration tests
2017-01-04 11:37:57 -08:00