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: CONTRIBUTING.md
+24-3Lines changed: 24 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,12 @@ be done manually.
32
32
33
33
$ black tests
34
34
35
+
In Powershell on Windows you can use
36
+
37
+
$ .\scripts\run_formatters.ps1
38
+
39
+
to invoke both formatters.
40
+
35
41
## Running Tests
36
42
37
43
$ make test
@@ -40,6 +46,21 @@ Creates a python virtualenv, and runs all the tests through `pytest`.
40
46
41
47
To run our `HTTP` proxy tests, one must add `127.0.0.1 sentry.native.test` to the `hosts` file. This is required since some transports bypass the proxy otherwise (for [example on Windows](https://learn.microsoft.com/en-us/windows/win32/wininet/enabling-internet-functionality#listing-the-proxy-bypass)).
42
48
49
+
**Running tests on Windows**:
50
+
51
+
The `make` scripts are not written with Windows in mind, since most Windows users use Visual Studio (Code) or CLion,
52
+
which all have elaborate build- and run-configuration capabilities that rarely require to fall back to CLI.
53
+
54
+
However, if you want to run the tests from Powershell we added a convenience script
55
+
56
+
$ .\scripts\run_tests.ps1
57
+
58
+
that provides the ease of the `make`-based build with a couple of parameters which you can query with
59
+
60
+
$ Get-Help .\scripts\run_tests.ps1 -detailed
61
+
62
+
It depends on `.\scripts\update_test_discovery.ps1` which updates the unit-test index like the `make` target of the same
63
+
name.
43
64
44
65
**Running integration tests manually**:
45
66
@@ -160,12 +181,12 @@ The example currently supports the following commands:
160
181
-`before-transaction`: Installs a `before_transaction()` callback that updates the transaction title.
161
182
-`discarding-before-transaction`: Installs a `before_transaction()` callback that discards the transaction.
162
183
-`traces-sampler`: Installs a traces sampler callback function when used alongside `capture-transaction`.
163
-
-`attach-view-hierarchy`: Adds a `view-hierarchy.json` attachment file, giving it the proper `attachment_type` and `content_type`.
184
+
-`attach-view-hierarchy`: Adds a `view-hierarchy.json` attachment file, giving it the proper `attachment_type` and `content_type`.
164
185
This file can be found in `./tests/fixtures/view-hierachy.json`.
165
186
-`set-trace`: Sets the scope `propagation_context`'s trace data to the given `trace_id="aaaabbbbccccddddeeeeffff00001111"` and `parent_span_id=""f0f0f0f0f0f0f0f0"`.
166
-
187
+
167
188
Only on Linux using crashpad:
168
-
-`crashpad-wait-for-upload`: Couples application shutdown to complete the upload in the `crashpad_handler`.
189
+
-`crashpad-wait-for-upload`: Couples application shutdown to complete the upload in the `crashpad_handler`.
169
190
170
191
Only on Windows using crashpad with its WER handler module:
Copy file name to clipboardExpand all lines: scripts/run_tests.ps1
+27-3Lines changed: 27 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,26 @@
1
+
<#
2
+
.SYNOPSIS
3
+
A helper script to execute Native SDK tests in Windows PowerShell.
4
+
.DESCRIPTION
5
+
Maintains the venv, wraps pytest for execution, and invokes update_test_discovery.ps1 to collect newly added unit tests.
6
+
#>
1
7
param (
8
+
## Lets you run only the unit tests (default: false)
2
9
[switch]$Unit=$false,
10
+
## Cleanly reinstalls packages into the venv (default: false)
3
11
[switch]$Clean=$false,
12
+
## Lets you limit the test discovery to part of a name (default: all)
4
13
[string]$Keyword="",
14
+
## Defines the number of parallel runners via pytest-xdist. This is highly experimental since tests remove database paths. (default: 1)
5
15
[int]$Parallelism=1,
16
+
## Disables tests that require the crashpad WER module. (default: false)
6
17
[switch]$WithoutCrashpadWer=$false,
7
-
[switch]$DisableCapture=$false
18
+
## Disables stdout/stderr capture through pytest (default: false)
19
+
[switch]$DisableCapture=$false,
20
+
## Defines the maximum number of failing tests before the test session is stopped. 0 means infinite. Will not do what you expect, together with Parallelism > 1 (default: 0)
21
+
[int]$MaxFail=0,
22
+
## Repeatedly runs the test suite (default: false)
0 commit comments