Skip to content

Commit 7e02e61

Browse files
authored
Made changes to facilitate HTML Reports on test execution (#211)
* Made changes to requirements.txt, ReadMe and gitignore to facilitate HTML reporting * Fixed Typos on Readme * Fixed Typos on Readme
1 parent 34b2ff9 commit 7e02e61

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ lme_update.sh
2323
/testing/configure/azure_scripts/config.ps1
2424
/testing/configure.zip
2525
/testing/*.output.log
26+
/testing/tests/report.html
27+
testing/tests/assets/style.css

testing/tests/README.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,25 @@ python3 -m venv venv
111111
. venv/bin/activate
112112
pip install -r requirements.txt
113113
pytest
114-
```
114+
```
115+
116+
## Generating Test HTML Reports
117+
After the tests have been executed, run the following command to generate HTML report to view Test Results.
118+
119+
```
120+
pytest --html=report.html
121+
```
122+
123+
Note: pytest-html has been added to requirements.txt. If for any reason pytest-html is not installed on your virtual environment; you may first need to install it with the following command.
124+
125+
```
126+
pip install pytest-html
127+
```
128+
129+
After html report is generated, run the following command outside virtual environment to attribute appropriate ownership on the html file so that you can open the file with the browser of choice. Google Chrome browser seems to provide a better display than Firefox.
130+
131+
```
132+
chown 1000.1000 report.html
133+
```
134+
135+
When a test fails, the test result details on the report provide appropriate information on the error message as you would expect to see on console.

testing/tests/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ requests>=2.31.0
1616
rpds-py>=0.17.1
1717
tomli>=2.0.1
1818
urllib3>=2.1.0
19+
pytest-html>=4.1.1

0 commit comments

Comments
 (0)