Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made changes to facilitate HTML Reports on test execution #211

Merged
merged 3 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ lme_update.sh
/testing/configure/azure_scripts/config.ps1
/testing/configure.zip
/testing/*.output.log
/testing/tests/report.html
testing/tests/assets/style.css
23 changes: 22 additions & 1 deletion testing/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,25 @@ python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
pytest
```
```

## Generating Test HTML Reports
After the tests have been executed, run the following command to generate HTML report to view Test Results.

```
pytest --html=report.html
```

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.

```
pip install pytest-html
```

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.

```
chown 1000.1000 report.html
```

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.
1 change: 1 addition & 0 deletions testing/tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ requests>=2.31.0
rpds-py>=0.17.1
tomli>=2.0.1
urllib3>=2.1.0
pytest-html>=4.1.1
Loading