Commit Graph

347 Commits

Author SHA1 Message Date
Anthony Dresser
d950b751d8 Coveralls + AppVeyor + Travis CI (#171)
* added build files

* changed build script

* revert dotnet version to older one

* added osx building

* added appveyor build

* added ruby upload code coverage

* added gulp cli to downloads

* added gulp util to deps

* added through2 to deps

* added cask install for dotnet

* added coveralls gem install to appveyor

* fixed ruby script

* change upload to be gulp

* updated call

* added test for nin

* testing

* testing

* testing

* added coveralls nuget

* echoed path

* added code coverage badge

* updated cmd

* fixed syntax error

* added dotnet to path

* added manual call to dotnet

* iterate

* change directory

* commit

* added start to dotnet core version

* changed appveyor

* updated dotnet versions

* updated readme

* removed unnec de

* customize for microsoft

* specified encrypted key in appveyor

* updated readme; added newlines

* added branches to ymls

* updated ymls
2016-12-13 11:30:30 -08:00
Karl Burtram
b99b01cae0 Peek definition for Azure DB objects (#179)
* Working...

* Call refresh on SmoObject to switch status from creating to existing.

* Add logging to exeception handlers
2016-12-13 09:27:07 -08:00
Karl Burtram
df9e207e5f Bump SMO to 140.1.12 to pickup Azure DB fixes (#183) 2016-12-12 22:55:26 -08:00
Leila Lali
68a83814d5 fixed the broken perf test (#180)
* fixed the broken perf test
2016-12-12 16:23:33 -08:00
Karl Burtram
5c2e6b74cf Catch exceptions raised sending telemetry events (#182) 2016-12-12 15:50:08 -08:00
Connor Quagliana
40c1434745 Fixed null ref exception in GetSignatureHelp (#175)
- Fixed a few places where ScriptParseInfo was being used before it was verified to be non-null
- Added 1 basic test for GetSignatureHelp scenario
2016-12-09 15:18:08 -08:00
Benjamin Russell
431dfa4156 Adding Milliseconds to DateTime fields (#173)
This is a slightly larger change than anticipated due the difference between `DATETIME`, `DATETIME2`, and `DateTime`. The `DATETIME` type always uses 3 decimal points of a second, while the `DATETIME2` type has 7 (although since `DATETIME2(7)` is default in SSMS suggesting that it is a variable precision type). Regardless of the db type, the engine returns `DateTime` C# type. The db types are only made visible via the column info, via the numeric precision and numeric scale. My findings were as such:
`DATETIME `: Precision = 23, Scale = 3
`DATETIME2`: Precision = 255, Scale = 7

The scale corresponds neatly with the number of second decimal points to show. The buffer file writer was modified to store both the scale and the number of ticks. Then the buffer file reader was modified to read in the precision and the number of ticks and generate the ToString version of the DateTime to add "f" as many times as there is scale, which corresponds to milliseconds.

* Code for writing milliseconds of datetime/datetime2 columns

* Adding unit tests

* Fixing potential bug with datetime2(0)
2016-12-09 12:46:17 -08:00
Leila Lali
9526b4dd49 changing the telemetry event name incase the other one is used by vs code 2016-12-08 15:23:21 -08:00
Leila Lali
7d37431c0d fixed connection service tests 2016-12-08 14:12:34 -08:00
Leila Lali
0b295e78c2 adding a new event for when definition is requested (#167)
* sending telemetry events for intellisense usage
2016-12-08 14:05:42 -08:00
Benjamin Russell
54f30887cc Batch Start Notification (#169)
This change is part of the progressive results code. It will submit a notification from the service layer to indicate when execution of a batch has completed. This notification will contain the selection for batch, execution start time, and its ID. This will enable the extension to produce a header for the batch before the batch completes, in order to make it more clear to the user that execution is going on.

* Adding new event for batch start

* Unit tests

* Fixing comments as per @kevcunnane
2016-12-08 11:23:08 -08:00
Sharon Ravindran
ab97948005 Fix/peek def mac (#170)
* Fix Integrated auth error and Uri for *nix/Mac

* Format code

* Add Logging and unit tests

* Modify tests for Windows:

* Workaround missing default schema on *nix and Mac

* Add unit tests

* Correct comments

* Change loop length

* Fix Log message
2016-12-07 16:52:35 -08:00
Kevin Cunnane
4c76b273ec Added mention-bot configuration settings (#172) 2016-12-07 16:32:39 -08:00
Leila Lali
379c6170b3 Intellisense for when the text starts with bracket (#164)
* Intellisense for when the text starts with bracket
2016-12-06 10:09:50 -08:00
Mitchell Sternke
439845eb0a Testing code coverage fix (#168) 2016-12-05 14:05:43 -08:00
Mitchell Sternke
b5efa69ffc Fixing code coverage to work properly (#165)
* Fixing code coverage to work properly

* Added comment to comment-out
2016-12-02 15:21:59 -08:00
Sharon Ravindran
82a7a01304 Peek definition support for tables, views and stored procedures (#160)
* Add support for peek/go to definition
Add unit tests for definition

Microsoft/vscode-mssql#253 and Microsoft/vscode-mssql#268

* Format Strings

* Add integration tests

* Refactor variable names

* Remove test file

* Remove LIVE_CONNECTION definition

* Change method name

* Write files to a separate directory

* Refactor GetDefinition

* Remove unnecessary whitespace and modify variable name

* Check intellisense settings

* Refactor code to be scalable and modify tests

* Refactor to facilitate CodeGen

* Reorder methods

* Modify method to strip bracket syntax

* Add one_second constant

* Add comments

* Modify null check

* Modify GetSchema code to account for spaces

* Alter variable names and modify null checks

* Remove timeout callback and refactor null check

* remove LIVE_CONNECTION_TEST definition
2016-12-02 12:16:21 -08:00
Mitchell Sternke
dd3592fe30 Disabling broken tests to try fix code coverage build (#163) 2016-12-01 16:24:31 -08:00
Mitchell Sternke
c95933b7e1 Implemented function signature help, and added tests (#153)
* Implemented function signature help, and added tests

* Incremental commit of changes from code review feedback

* Rename test

* Added check to make sure intellisense is enabled

* Use HoverTimeout instead of BindingTimeout
2016-11-30 14:22:48 -08:00
Leila Lali
453ff9de15 Perf Test fixing bugs and Update command (#155)
* Fixed some bugs caused by rafactoring

* Verifying a test db is created before running the tests
2016-11-30 12:56:48 -08:00
Mitchell Sternke
d1b791805a Fixed issue where no-op queries would never complete (#157)
* Fixed issue where no-op queries would never complete

* Changed approach to solving the race condition with no-op queries

* Addressing feedback
2016-11-28 14:28:05 -08:00
Karl Burtram
84eb164d87 Remove enabling MARS again. This merged down from master (#162) 2016-11-28 13:00:41 -08:00
Karl Burtram
e5d577dc81 Fix post merge break 2016-11-28 11:49:53 -08:00
Karl Burtram
39b79ae05b Merge branch 'master' into dev 2016-11-28 09:58:32 -08:00
Benjamin Russell
7de742bfab Fixing race condition in unit test (#161) 2016-11-23 13:34:48 -08:00
Benjamin Russell
d9efb95386 Progressive Results Part 2: Result Completion Event (#134)
The main change in this pull request is to add a new event that will be fired upon completion of a resultset but before the completion of a batch. This event will only fire if a resultset is available and generated.

Changes:
* ConnectionService - Slight changes to enable mocking, cleanup 
* Batch - Moving summary generation into ResultSet class, adding generation of ordinals for resultset and locking of result set list (which needs further refinement, but would be outside scope of this change)
* Adding new event and associated parameters for completion of a resultset. Params return the resultset summary
* Adding logic for assigning the event a handler in the query execution service
* Adding unit tests for testing the new event /making sure the existing tests work
* Refactoring some private properties into member variables

* Refactor to remove SectionData class in favor of BufferRange

* Adding callback for batch completion that will let the extension know that a batch has completed execution

* Refactoring to make progressive results work as per async query execution

* Allowing retrieval of batch results while query is in progress

* reverting global.json, whoops

* Adding a few missing comments, and fixing a couple code style bugs

* Using SelectionData everywhere again

* One more missing comment

* Adding new notification type for result set completion

* Plumbing event for result set completion

* Unit tests for result set events

This includes a fairly substantial change to create a mock of the
ConnectionService and to create separate memorystream storage arrays. It
preserves more correct behavior with a integration test, fixes an issue
where the test db reader will return n-1 rows because the Reliable
Connection Helper steals a record.

* Adding locking to ResultSets for thread safety

* Adding/fixing unit tests

* Adding batch ID to result set summary
2016-11-22 17:37:27 -08:00
Benjamin Russell
0841ad7cf4 Removing the FileStreamWrapper as it is unecessary (#156) 2016-11-22 17:21:41 -08:00
Mitchell Sternke
ba0f564126 Fixed Turkish I problem with autocomplete keyword suggestions (#158) 2016-11-22 17:05:03 -08:00
Mitchell Sternke
2e3bd3ae27 Feature/more tests (#154)
* First batch of new tests for increasing code coverage

* Fix for merge

* Added comments to tests
2016-11-22 09:55:15 -08:00
Benjamin Russell
db1e4ae351 Fix Code Coverage (#151)
This is another large code review. I want to make a few more changes, but since these changes will stand on their own, I'll hold back on making this change set any larger than it already is.
Changes in this request:
To address Microsoft/vscode-mssql#326, instead of doing taskkill on the service layer when WaitForExit is executed, we now make an educated guess at which service layer was spawned when the test starts and do a Process.Kill on it when we shut down the test.
All the perf tests have been moved into a new project. This was done to keep them easily separated from code coverage test runs. At the same time the perf tests were separated into separate classes for logical categorization. This process will likely be repeated on the stress tests. The tests can still easily be ran from Visual Studio Test Explorer
To address Microsoft/vscode-mssql#349, a new SelfCleaningFile class was created to allow for easy cleanup of temporary files generated for integration tests via using blocks.
Due to some of the refactoring done while moving the perf tests to a new project, the TestBase class had to be switched to more of a helper class style. As such, all tests that use inherit from TestBase now create a TestBase object on start via a using block. This also simplifies the cleanup at the end of the test.

* Solution for hanging code coverage runs

Code coverage runs would hang in certain scenarios if a test failed before
the service process could be spawned. The taskkill command would fail to
find the service process. The test would then wait for opencover to exit,
but it would not since the service process it had spawned would still be
running, causing the test run to hang indefinitely.

Solution was to capture the service process after it launched and
explicitly kill it when shutting down the test driver.

* Setting the test name in the propery in the class and removign the parameter from each method

* New project for perf tests

* Reworking integration tests to cleanup temp files

* Changes as per @llali review comments

* Adding copyright notices
* Renaming TestBase => TestHelper
* Renaming SelfCleaningFile => SelfCleaningTempFile
* Removing code that sets TestName property

* Fixing compilation error due to removed code
2016-11-18 17:46:56 -08:00
Karl Burtram
a54d081363 Avoid null reference exceptions in diagnostics parsing (#149)
* Avoid a couple possible null reference exceptions

* Switch syntax around a little bit.
2016-11-17 15:06:57 -08:00
Leila Lali
c2ffd4c2a5 Setting the test name in the property in the class (#147)
Using CallerMemberName attribute to get the test name for generating the test result instead of having a name passed as a parameter for each test method
2016-11-16 11:39:48 -08:00
Mitchell Sternke
32f6cbc304 Language service no longer binds on duplicate connections (#148) 2016-11-15 18:12:16 -08:00
Mitchell Sternke
5a5f197276 Removed unneeded broken test (#150) 2016-11-15 17:57:03 -08:00
Mitchell Sternke
2211bd0403 Added notification for when language service is done updating after connect (#146)
* Added notification for when language service is done updating after connect

* Addressing feedback

* Added unit test
2016-11-15 17:39:17 -08:00
Karl Burtram
f2b8a16d29 Update README.md 2016-11-15 13:17:49 -08:00
Karl Burtram
6501cb3b1b Add license.txt file 2016-11-14 15:45:25 -08:00
Leila Lali
0d111d9316 Fix/performancetests (#144)
* some bug fixes and improvements for perf tests. If the test name file cannot be found just use the settings.json
2016-11-14 10:10:23 -08:00
Mitchell Sternke
bffe5d590f Change comment for compliance (#145) 2016-11-11 14:46:51 -08:00
Mitchell Sternke
ee9e3d75bf Change comment for compliance (#145) 2016-11-11 14:39:18 -08:00
Leila Lali
80a847ff4f some bug fixes in pref tests 2016-11-11 10:07:55 -08:00
Benjamin Russell
189612ce57 Fixing derived exception issue in workspace test 2016-11-10 12:04:35 -08:00
Mitchell Sternke
66afdb5fc3 Added return code to test driver (#143) 2016-11-10 11:49:08 -08:00
Benjamin Russell
ec94d986a8 Unit Test Cleanup (#141)
This is a fairly large set of changes to the unit tests that help isolate the effectiveness of the unit tests.

* Unit tests for query execution have been split into separate files for different classes.
* Unit tests have been added for the ResultSet class which previously did not have tests
* The InMemoryStreamWrapper has been improved to share memory, creating a simulated filesystem
* Creating a mock ConnectionService to decrease noisy exceptions and prevent "row stealing". Unfortunately this lowers code coverage. However, since the tests that touched the connection service were not really testing it, this helps keep us honest. But it will require adding more unit tests for connection service.
* Standardizing the await mechanism for query execution
* Cleaning up the mechanism for getting WorkspaceService mocks and mock FileStreamFactories

* Refactor the query execution tests into their own files

* Removing tests from ExecuteTests.cs that were moved to separate files

* Adding tests for ResultSet class

* Adding test for the FOR XML/JSON component of the resultset class

* Setting up shared storage between file stream readers/writers

* Standardizing on Workspace mocking, awaiting execution completion

* Adding comment for ResultSet class
2016-11-10 11:42:31 -08:00
Benjamin Russell
9ff9a02932 Fixing derived exception issue in workspace test 2016-11-10 11:09:35 -08:00
Benjamin Russell
eba383e251 Fixing bad data issue w/closing/opening untitled doc (#142)
* Adding useful unit tests for this functionality
* Adding callback functionality for when a file is closed

* Fixing bad data issue w/closing/opening untitled doc

* Adding useful unit tests for this functionality
* Adding callback functionality for when a file is closed

* Moving from public to internal
2016-11-09 18:00:07 -08:00
Leila Lali
18bf76caed If the test name file cannot be found just use the settings.json 2016-11-09 16:12:11 -08:00
Benjamin Russell
ffe17e85fc Fixing bad data issue w/closing/opening untitled doc (#142)
* Adding useful unit tests for this functionality
* Adding callback functionality for when a file is closed

* Fixing bad data issue w/closing/opening untitled doc

* Adding useful unit tests for this functionality
* Adding callback functionality for when a file is closed

* Moving from public to internal
2016-11-09 15:36:42 -08:00
Leila Lali
92420e734f copy the sql script file to the output folder 2016-11-09 12:19:14 -08:00
Mitchell Sternke
2319de41e0 Added basic stress tests for the service (#140) 2016-11-09 12:02:19 -08:00