Skip to content

Commit 9636fc5

Browse files
committed
Update SideBySide test instructions. Fixes #480
1 parent bd9ea72 commit 9636fc5

File tree

2 files changed

+40
-22
lines changed

2 files changed

+40
-22
lines changed

tests/README.md

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,38 @@
22

33
## Side-by-side Tests
44

5-
The `SideBySide` project is intended to verify that the new MySql.Data implementation
6-
is equivalent to the official ADO.NET connector in places where that is deemed important.
7-
8-
The tests require a MySQL server. Copy the file `SideBySide/config.json.example` to `SideBySide/config.json`.
9-
Then edit the `config.json` file in order to connect to your server:
10-
11-
Data.ConnectionString: The full MySql Connection String to your server. You should specify a database name.
12-
If the database does not exist, the test will attempt to create it.
13-
14-
Data.PasswordlessUser: Leave blank to disable passwordless user tests. Otherwise, this should be a user
15-
on your database with no Password and no Roles.
16-
17-
Data.SupportsJson: True if your MySql server supports JSON (5.7 and up), false otherwise.
5+
The `SideBySide` project is intended to verify that MySqlConnector doesn't break compatibility
6+
with Connector/NET and that [known bugs have been fixed](https://mysql-net.github.io/MySqlConnector/tutorials/migrating-from-connector-net/#fixed-bugs).
7+
8+
The tests require a MySQL server. The simplest way to run one is with [Docker](https://www.docker.com/community-edition):
9+
10+
docker run -d --rm --name mysqlconnector -e MYSQL_ROOT_PASSWORD=pass -p 3306:3306 mysql:5.7 --max-allowed-packet=96M --character-set-server=utf8mb4
11+
12+
Copy the file `SideBySide/config.json.example` to `SideBySide/config.json`, then edit
13+
the `config.json` file in order to connect to your server. If you are using the Docker
14+
command above, then the default options will work and do not need to be modified.
15+
Otherwise, set the following options appropriately:
16+
17+
* `Data.ConnectionString`: The full connection string to your server. You should specify a database name. If the database does not exist, the test will attempt to create it.
18+
* `Data.PasswordlessUser`: (Optional) A user account in your database with no password and no roles.
19+
* `Data.SecondaryDatabase`: (Optional) A second database on your server that the test user has permission to access.
20+
* `Data.CertificatesPath`: (Optional) The absolute path to the server and client certificates folder (i.e., the `.ci/server/certs` folder in this repo).
21+
* `Data.MySqlBulkLoaderLocalCsvFile`: (Optional) The path to a test CSV file.
22+
* `Data.MySqlBulkLoaderLocalTsvFile`: (Optional) The path to a test TSV file.
23+
* `Data.UnsupportedFeatures`: A comma-delimited list of `ServerFeature` enum values that your test database server does *not* support
24+
* `Json`: the `JSON` data type (MySQL 5.7 and later)
25+
* `StoredProcedures`: create and execute stored procedures
26+
* `Sha256Password`: a user named `sha256user` exists on your server and uses the `sha256_password` auth plugin
27+
* `RsaEncryption`: server supports RSA public key encryption (for `sha256_password` and `caching_sha2_password`)
28+
* `LargePackets`: large packets (over 4MB)
29+
* `CachingSha2Password`: a user named `caching-sha2-user` exists on your server and uses the `caching_sha2_password` auth plugin
30+
* `SessionTrack`: server supports `CLIENT_SESSION_TRACK` capability (MySQL 5.7 and later)
31+
* `Timeout`: server can cancel queries promptly (so timed tests don't time out)
32+
* `ErrorCodes`: server returns error codes in error packet (some MySQL proxies do not)
33+
* `Tls11`: server supports TLS 1.1
34+
* `Tls12`: server supports TLS 1.2
35+
36+
## Running Tests
1837

1938
There are two ways to run the tests: command line and Visual Studio.
2039

@@ -24,14 +43,16 @@ After building the solution, you should see a list of tests in the Test Explorer
2443

2544
### Command Line
2645

27-
To run the New tests against MySqlConnector:
46+
To run the tests against MySqlConnector:
2847

2948
```
30-
dotnet restore; dotnet test
49+
cd tests\SideBySide
50+
dotnet xunit -c Release
3151
```
3252

33-
To run the Baseline tests against MySql.Data:
53+
To run the tests against MySql.Data:
3454

3555
```
36-
dotnet restore /p:Configuration=Baseline; dotnet test -c Baseline
56+
cd tests\SideBySide
57+
dotnet restore /p:Configuration=Baseline && dotnet test -c Baseline
3758
```

tests/SideBySide/config.json.example

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
22
"Data": {
3-
"ConnectionString": "server=127.0.0.1;user id=mysqltest;password='test;key=\"val';port=3306;database=mysqltest;DefaultCommandTimeout=3600",
4-
"PasswordlessUser": "no_password",
5-
"SecondaryDatabase": "testdb2",
6-
"UnsupportedFeatures": "CachingSha2Password,RsaEncryption",
7-
"CertificatesPath": "C:/work/MySqlConnector/.ci/server/certs"
3+
"ConnectionString": "server=127.0.0.1;user id=root;password=pass;port=3306;database=mysqltest",
4+
"UnsupportedFeatures": "CachingSha2Password,RsaEncryption,Sha256Password"
85
}
96
}

0 commit comments

Comments
 (0)