You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/running-verification-tests.md
+16-4Lines changed: 16 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,19 @@
1
1
# Running Verification Tests On Your Local Machine
2
2
Verification tests are used to confirm that no detectors are lost when changes are made to the project. The tests are run on every PR build. They work by comparing the detection results from the main branch to detection results from the new changes on your PR. You can follow the steps below to run them locally.
3
3
4
-
## Step 1 : Run Detection on the main branch
4
+
An automation script is created to setup the test artifact and execute the verification test. Ensure that your local changes builds and execute following powershell script **from repository root**.
The automation script above will output variables that needs to be replaced in `ComponentDetectionIntegrationTests.cs` file. Then, verification test can be debugged through Test Explorer by opening `\test\Microsoft.ComponentDetection.VerificationTests\Microsoft.DependencyDetective.VerificationTests.csproj` in visual studio.
12
+
13
+
14
+
## Manual setup
15
+
16
+
### Step 1 : Run Detection on the main branch
5
17
6
18
- Checkout the main branch in your local repo
7
19
- Create a folder to store detection results (e.g C:\old-output-folder)
@@ -14,7 +26,7 @@ For Example:
14
26
```dotnet run scan --Verbosity Verbose --SourceDirectory C:\componentdetection --Output C:\old-output-folder```
15
27
16
28
17
-
## Step 2 : Run Detection on your new branch
29
+
###Step 2 : Run Detection on your new branch
18
30
19
31
- Checkout the branch with the new changes you are trying to merge
20
32
- Create a folder to store detection results. This folder should be seperate from the one you used in Step 1 (e.g C:\new-output-folder)
@@ -26,7 +38,7 @@ For Example:
26
38
27
39
```dotnet run scan --Verbosity Verbose --SourceDirectory C:\componentdetection --Output C:\new-output-folder```
28
40
29
-
## Step 3 : Update variables in the test
41
+
###Step 3 : Update variables in the test
30
42
31
43
- Open the Microsoft.ComponentDetection.VerificationTests project in VS Studio
32
44
- Navigate to `GatherResources()` in `ComponentDetectionIntegrationTests.cs`
@@ -36,7 +48,7 @@ For Example:
36
48
-`allowedTimeDriftRatioString`: This should be ".75"
37
49
38
50
39
-
## Step 4: Run The tests
51
+
###Step 4: Run The tests
40
52
You can run the tests in two ways:
41
53
- Run or Debug the tests in test explorer.
42
54
- Use the command line to navigate to the Microsoft.ComponentDetection.VerificationTests folder, and run `dotnet test`.
Write-Host"Verification tests were completed. The generated testdata can be found at $testDataDir`n To debug test with visual studio, replace values for following variables in ComponentDetectionIntegrationTests.cs"-ForegroundColor red -BackgroundColor white
59
+
Write-Host"oldGithubArtifactsDir = @`"$releaseOutput`""-ForegroundColor red -BackgroundColor white
60
+
Write-Host"newGithubArtifactsDir = @`"$output`""-ForegroundColor red -BackgroundColor white
61
+
Write-Host"allowedTimeDriftRatioString = "`"0.75`"-ForegroundColor red -BackgroundColor white
0 commit comments