Skip to content

Commit

Permalink
FunctionalTests -> IntegrationTests; UpstreamFunctionalTests -> Funct…
Browse files Browse the repository at this point in the history
…ionalTests
  • Loading branch information
caleblloyd committed May 28, 2018
1 parent b78befc commit ccff8a8
Show file tree
Hide file tree
Showing 147 changed files with 64 additions and 64 deletions.
3 changes: 0 additions & 3 deletions test/EFCore.MySql.FunctionalTests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
/config.json
/Migrations/*.cs
/scripts/vegeta/results.bin
/.vscode
/Scaffold
47 changes: 2 additions & 45 deletions test/EFCore.MySql.FunctionalTests/README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,12 @@
Functional and Performance Tests
Upstream Functional Tests
================================

**Configuring the Database**

You first must configure your MySql Database. Open the `config.json.example` file, configure the connection string, and save it as `config.json`.

Next, you must rebuild migrations. Run the `scripts/rebuild.sh` script on Linux or the `scripts/rebuild.ps1` script on Windows. Any time you make changes to database models, run the rebuild script.

**Running Functional Tests**

1. Configure the Databse
2. Run `dotnet test`
3. This will run through all of the tests in the Test/ directory.

**Running Performance Tests**

1. Configure the Databse
2. Run `dotnet run`
3. This will start a .NET Core MVC API application running on http://localhost:5000

Methods:

`GET /api/async` and `GET /api/sync` return the most recent 10 posts.

`POST /api/async` and `POST /api/sync` create a new post. The request body should be `Content-Type: application/json` in the form:

```json
{
"Title": "Test Blog",
"Posts": [
{
"Title": "Post 1",
"Content": "A great blog post"
},
{
"Title": "Post 2",
"Content": "An even better blog post"
}
]
}
```

The `scripts` directory contains load testing scripts. These scripts require that the [Vegeta](https://github.com/tsenart/vegeta/releases) binary is installed and accessible in your PATH. Here are examples of how to call the load testing scripts:
```
# by default, runs 50 async queries per second for 5 seconds
./stress.sh # bash for linux
./stress.ps1 # powershell for windows
# runs 100 async queries per second for 10 seconds on linux
./stress.sh 100 10s async
# run 50 sync queries per second for 1 minute on windows
./stress.ps1 50 1m sync
```
3. This will run through all of the tests in the current directory.
2 changes: 1 addition & 1 deletion test/EFCore.MySql.FunctionalTests/config.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Data": {
"ConnectionString": "server=127.0.0.1;user id=root;password=Password12!;port=3306;database=pomelo_test;",
"ConnectionString": "server=127.0.0.1;user id=root;password=Password12!;port=3306;",
"ServerVersion": "8.0.0-mysql"
}
}
5 changes: 5 additions & 0 deletions test/EFCore.MySql.IntegrationTests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/config.json
/Migrations/*.cs
/scripts/vegeta/results.bin
/.vscode
/Scaffold
File renamed without changes.
55 changes: 55 additions & 0 deletions test/EFCore.MySql.IntegrationTests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Functional and Performance Tests
================================

**Configuring the Database**

You first must configure your MySql Database. Open the `config.json.example` file, configure the connection string, and save it as `config.json`.

Next, you must rebuild migrations. Run the `scripts/rebuild.sh` script on Linux or the `scripts/rebuild.ps1` script on Windows. Any time you make changes to database models, run the rebuild script.

**Running Functional Tests**

1. Configure the Databse
2. Run `dotnet test`
3. This will run through all of the tests in the Test/ directory.

**Running Performance Tests**

1. Configure the Databse
2. Run `dotnet run`
3. This will start a .NET Core MVC API application running on http://localhost:5000

Methods:

`GET /api/async` and `GET /api/sync` return the most recent 10 posts.

`POST /api/async` and `POST /api/sync` create a new post. The request body should be `Content-Type: application/json` in the form:

```json
{
"Title": "Test Blog",
"Posts": [
{
"Title": "Post 1",
"Content": "A great blog post"
},
{
"Title": "Post 2",
"Content": "An even better blog post"
}
]
}
```

The `scripts` directory contains load testing scripts. These scripts require that the [Vegeta](https://github.com/tsenart/vegeta/releases) binary is installed and accessible in your PATH. Here are examples of how to call the load testing scripts:
```
# by default, runs 50 async queries per second for 5 seconds
./stress.sh # bash for linux
./stress.ps1 # powershell for windows
# runs 100 async queries per second for 10 seconds on linux
./stress.sh 100 10s async
# run 50 sync queries per second for 1 minute on windows
./stress.ps1 50 1m sync
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Data": {
"ConnectionString": "server=127.0.0.1;user id=root;password=Password12!;port=3306;",
"ConnectionString": "server=127.0.0.1;user id=root;password=Password12!;port=3306;database=pomelo_test;",
"ServerVersion": "8.0.0-mysql"
}
}
2 changes: 0 additions & 2 deletions test/EFCore.MySql.UpstreamFunctionalTests/.gitignore

This file was deleted.

12 changes: 0 additions & 12 deletions test/EFCore.MySql.UpstreamFunctionalTests/README.md

This file was deleted.

0 comments on commit ccff8a8

Please sign in to comment.