Skip to content

Commit 4438be6

Browse files
authored
.Net 5 support and release
1 parent 5ef4ef7 commit 4438be6

15 files changed

+227
-25
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: mihaj
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Additional context**
32+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: mihaj
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/codeql-analysis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ jobs:
3333
steps:
3434
- name: Checkout repository
3535
uses: actions/checkout@v2
36-
36+
- name: Setup .NET Core 3.1
37+
uses: actions/setup-dotnet@v1
38+
with:
39+
dotnet-version: '3.1.x'
40+
- name: Setup .NET Core 5.0
41+
uses: actions/setup-dotnet@v1
42+
with:
43+
dotnet-version: '5.0.x'
3744
# Initializes the CodeQL tools for scanning.
3845
- name: Initialize CodeQL
3946
uses: github/codeql-action/init@v1

.github/workflows/dotnet-core.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v2
21-
- name: Setup .NET Core
21+
- name: Setup .NET Core 3.1
2222
uses: actions/setup-dotnet@v1
2323
with:
24-
dotnet-version: 3.1.403
24+
dotnet-version: '3.1.x'
25+
- name: Setup .NET Core 5.0
26+
uses: actions/setup-dotnet@v1
27+
with:
28+
dotnet-version: '5.0.x'
2529
- name: Install dependencies
2630
run: dotnet restore
2731
- name: Build
@@ -42,6 +46,14 @@ jobs:
4246
runs-on: ubuntu-latest
4347
steps:
4448
- uses: actions/checkout@v2
49+
- name: Setup .NET Core 3.1
50+
uses: actions/setup-dotnet@v1
51+
with:
52+
dotnet-version: '3.1.x'
53+
- name: Setup .NET Core 5.0
54+
uses: actions/setup-dotnet@v1
55+
with:
56+
dotnet-version: '5.0.x'
4557
- name: Pack NuGet
4658
uses: brandedoutcast/publish-nuget@v2.5.5
4759
with:

.github/workflows/sonarqube-analysis.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@ jobs:
1313
with:
1414
# Disabling shallow clone is recommended for improving relevancy of reporting
1515
fetch-depth: 0
16+
- name: Setup .NET Core 3.1
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: '3.1.x'
20+
- name: Setup .NET Core 5.0
21+
uses: actions/setup-dotnet@v1
22+
with:
23+
dotnet-version: '5.0.x'
1624
- name: SonarScanner for .NET Core with pull request decoration support
17-
uses: highbyte/sonarscan-dotnet@1.0
25+
uses: highbyte/sonarscan-dotnet@2.0-beta
1826
with:
1927
sonarProjectKey: qatoolkit_qatoolkit-engine-bombardier-net
2028
sonarProjectName: qatoolkit_qatoolkit-engine-bombardier-net

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,4 +359,5 @@ MigrationBackup/
359359
.ionide/
360360

361361
# Fody - auto-generated XML schema
362-
FodyWeavers.xsd
362+
FodyWeavers.xsd
363+
/src/QAToolKit.Engine.Bombardier.Test/global.json

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>0.2.1</Version>
3+
<Version>0.3.0</Version>
44
</PropertyGroup>
55
</Project>

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# QAToolKit.Engine.Bombardier
2-
![.NET Core](https://github.com/qatoolkit/qatoolkit-engine-bombardier-net/workflows/.NET%20Core/badge.svg?branch=main)
3-
![CodeQL Analyze](https://github.com/qatoolkit/qatoolkit-engine-bombardier-net/workflows/CodeQL%20Analyze/badge.svg)
4-
![Sonarqube Analyze](https://github.com/qatoolkit/qatoolkit-engine-bombardier-net/workflows/Sonarqube%20Analyze/badge.svg)
5-
![](https://img.shields.io/nuget/v/QAToolKit.Engine.Bombardier?label=QAToolKit.Engine.Bombardier)
2+
![https://github.com/qatoolkit/qatoolkit-engine-bombardier-net/actions](https://github.com/qatoolkit/qatoolkit-engine-bombardier-net/workflows/.NET%20Core/badge.svg?branch=main)
3+
![https://github.com/qatoolkit/qatoolkit-engine-bombardier-net/security/code-scanning](https://github.com/qatoolkit/qatoolkit-engine-bombardier-net/workflows/CodeQL%20Analyze/badge.svg)
4+
![https://sonarcloud.io/dashboard?id=qatoolkit_qatoolkit-engine-bombardier-net](https://github.com/qatoolkit/qatoolkit-engine-bombardier-net/workflows/Sonarqube%20Analyze/badge.svg)
5+
![https://www.nuget.org/packages/QAToolKit.Engine.Bombardier/](https://img.shields.io/nuget/v/QAToolKit.Engine.Bombardier?label=QAToolKit.Engine.Bombardier)
66

77
## Description
88
`QAToolKit.Engine.Bombardier` is a .NET standard library, which takes `IEnumerable<HttpTestRequest>` object and runs load tests with tool called [Bombardier](https://github.com/codesenberg/bombardier).
99

10+
Supported .NET frameworks and standards: `netstandard2.0`, `netstandard2.1`, `netcoreapp3.1`, `net5.0`
11+
1012
Library is a thin wrapper, that generates requests and parses results to JSON. You can process or import that JSON in other tools. We plan to release an exporter to CSV, HTML and maybe other formats.
1113

1214
Major features:

qatoolkit-64x64.png

2.11 KB
Loading

src/QAToolKit.Engine.Bombardier.Test/BombardierTestsGeneratorTests.cs

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,5 +573,95 @@ public async Task GenerateBombardierTestGetSupportNoIdTest_Successfull()
573573
Assert.Equal(HttpMethod.Get, bombardierTests.FirstOrDefault().Method);
574574
Assert.Equal("https://petstore3.swagger.io/sales/support/v2/SupportTicket?CaseId={CaseId}", bombardierTests.FirstOrDefault().Url.ToString());
575575
}
576+
577+
[Fact]
578+
public async Task GenerateBombardierTestGetBikesInsecureTest_Successfull()
579+
{
580+
var bombardierTestsGenerator = new BombardierTestsGenerator(options =>
581+
{
582+
options.BombardierNumberOfTotalRequests = 10;
583+
options.BombardierInsecure = true;
584+
options.BombardierUseHttp2 = false;
585+
});
586+
587+
var content = File.ReadAllText("Assets/GetAllBikes.json");
588+
var httpRequest = JsonConvert.DeserializeObject<IEnumerable<HttpRequest>>(content);
589+
590+
var bombardierTests = await bombardierTestsGenerator.Generate(httpRequest);
591+
592+
Assert.NotNull(bombardierTests);
593+
Assert.Single(bombardierTests);
594+
Assert.Contains($@" -m GET https://qatoolkitapi.azurewebsites.net/api/bicycles?api-version=1 -c 3 --http1 --timeout=30s --duration=5s --insecure --requests=10", bombardierTests.FirstOrDefault().Command);
595+
Assert.Equal(HttpMethod.Get, bombardierTests.FirstOrDefault().Method);
596+
Assert.Equal("https://qatoolkitapi.azurewebsites.net/api/bicycles?api-version=1", bombardierTests.FirstOrDefault().Url.ToString());
597+
}
598+
599+
[Fact]
600+
public async Task GenerateBombardierTestAddBikeInsecureTest_Successfull()
601+
{
602+
var bombardierTestsGenerator = new BombardierTestsGenerator(options =>
603+
{
604+
options.BombardierNumberOfTotalRequests = 10;
605+
options.BombardierInsecure = true;
606+
options.BombardierUseHttp2 = false;
607+
});
608+
609+
var content = File.ReadAllText("Assets/AddBike.json");
610+
var httpRequest = JsonConvert.DeserializeObject<IEnumerable<HttpRequest>>(content);
611+
612+
var bombardierTests = await bombardierTestsGenerator.Generate(httpRequest);
613+
614+
Assert.NotNull(bombardierTests);
615+
Assert.Single(bombardierTests);
616+
Assert.Contains($@" -m POST https://qatoolkitapi.azurewebsites.net/api/bicycles?api-version=1 -c 3 -H ""Content-Type: application/json"" -b ""{{\""id\"":1,\""name\"":\""Foil\"",\""brand\"":\""Cannondale\""}}"" --http1 --timeout=30s --duration=5s --insecure --requests=10", bombardierTests.FirstOrDefault().Command);
617+
Assert.Equal(HttpMethod.Post, bombardierTests.FirstOrDefault().Method);
618+
Assert.Equal("https://qatoolkitapi.azurewebsites.net/api/bicycles?api-version=1", bombardierTests.FirstOrDefault().Url.ToString());
619+
}
620+
621+
[Fact]
622+
public async Task GenerateBombardierTestDoesNotEndWithNewLineTest1_Successfull()
623+
{
624+
var bombardierTestsGenerator = new BombardierTestsGenerator(options =>
625+
{
626+
options.BombardierNumberOfTotalRequests = 10;
627+
options.BombardierInsecure = true;
628+
options.BombardierUseHttp2 = false;
629+
});
630+
631+
var content = File.ReadAllText("Assets/AddBike.json");
632+
var httpRequest = JsonConvert.DeserializeObject<IEnumerable<HttpRequest>>(content);
633+
634+
var bombardierTests = await bombardierTestsGenerator.Generate(httpRequest);
635+
636+
Assert.NotNull(bombardierTests);
637+
Assert.Single(bombardierTests);
638+
Assert.Contains($@" -m POST https://qatoolkitapi.azurewebsites.net/api/bicycles?api-version=1 -c 3 -H ""Content-Type: application/json"" -b ""{{\""id\"":1,\""name\"":\""Foil\"",\""brand\"":\""Cannondale\""}}"" --http1 --timeout=30s --duration=5s --insecure --requests=10", bombardierTests.FirstOrDefault().Command);
639+
Assert.Equal(HttpMethod.Post, bombardierTests.FirstOrDefault().Method);
640+
Assert.Equal("https://qatoolkitapi.azurewebsites.net/api/bicycles?api-version=1", bombardierTests.FirstOrDefault().Url.ToString());
641+
Assert.DoesNotContain(Environment.NewLine, bombardierTests.FirstOrDefault().Command);
642+
}
643+
644+
[Fact]
645+
public async Task GenerateBombardierTestDoesNotEndWithNewLineTest2_Successfull()
646+
{
647+
var bombardierTestsGenerator = new BombardierTestsGenerator(options =>
648+
{
649+
options.BombardierNumberOfTotalRequests = 10;
650+
options.BombardierInsecure = true;
651+
options.BombardierUseHttp2 = false;
652+
});
653+
654+
var content = File.ReadAllText("Assets/AddBike.json");
655+
var httpRequest = JsonConvert.DeserializeObject<IEnumerable<HttpRequest>>(content);
656+
657+
var bombardierTests = await bombardierTestsGenerator.Generate(httpRequest);
658+
659+
Assert.NotNull(bombardierTests);
660+
Assert.Single(bombardierTests);
661+
Assert.Contains($@" -m POST https://qatoolkitapi.azurewebsites.net/api/bicycles?api-version=1 -c 3 -H ""Content-Type: application/json"" -b ""{{\""id\"":1,\""name\"":\""Foil\"",\""brand\"":\""Cannondale\""}}"" --http1 --timeout=30s --duration=5s --insecure --requests=10", bombardierTests.FirstOrDefault().Command);
662+
Assert.Equal(HttpMethod.Post, bombardierTests.FirstOrDefault().Method);
663+
Assert.Equal("https://qatoolkitapi.azurewebsites.net/api/bicycles?api-version=1", bombardierTests.FirstOrDefault().Url.ToString());
664+
Assert.DoesNotContain(Environment.NewLine, bombardierTests.FirstOrDefault().Command);
665+
}
576666
}
577667
}

0 commit comments

Comments
 (0)