add update test count badges workflow
48
.github/workflows/update-badges.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Update test number badges
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- "tests/**"
|
||||
|
||||
jobs:
|
||||
update_badges:
|
||||
runs-on: ubuntu-latest
|
||||
container: python:3.8
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: add TIP pypi repo
|
||||
run: |
|
||||
mkdir -p ~/.pip
|
||||
echo "[global]" > ~/.pip/pip.conf
|
||||
echo "index-url = https://pypi.org/simple" >> ~/.pip/pip.conf
|
||||
echo "extra-index-url = https://tip-read:tip-read@tip.jfrog.io/artifactory/api/pypi/tip-wlan-python-pypi-local/simple" >> ~/.pip/pip.conf
|
||||
|
||||
- name: install dependencies
|
||||
run: pip install -r requirements.txt
|
||||
|
||||
- name: download badges
|
||||
working-directory: tests
|
||||
run: |
|
||||
mkdir -p ../.img
|
||||
wget https://img.shields.io/badge/total_tests-$(pytest --collect-only -q | tail -1 | cut -d ' ' -f 1)-green?style=flat-square -O ../.img/total-count.svg
|
||||
wget https://img.shields.io/badge/interop_tests-$(pytest --collect-only -m "interop" -q | tail -1 | cut -d '/' -f 1)-green?style=flat-square -O ../.img/interop-count.svg
|
||||
wget https://img.shields.io/badge/sanity_tests-$(pytest --collect-only -m "sanity and not interop" -q | tail -1 | cut -d '/' -f 1)-green?style=flat-square -O ../.img/sanity-count.svg
|
||||
wget https://img.shields.io/badge/performance_tests-$(pytest --collect-only -m "performance" -q | tail -1 | cut -d '/' -f 1)-green?style=flat-square -O ../.img/performance-count.svg
|
||||
|
||||
- name: commit changes
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
git add .
|
||||
git commit -m "Updating test count badges: $(date -u)"
|
||||
|
||||
- name: push changes
|
||||
uses: ad-m/github-push-action@v0.6.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: master
|
||||
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
1
.img/interop-count.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="102" height="20" role="img" aria-label="interop tests: 56"><title>interop tests: 56</title><g shape-rendering="crispEdges"><rect width="79" height="20" fill="#555"/><rect x="79" width="23" height="20" fill="#97ca00"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text x="405" y="140" transform="scale(.1)" fill="#fff" textLength="690">interop tests</text><text x="895" y="140" transform="scale(.1)" fill="#fff" textLength="130">56</text></g></svg>
|
||||
|
After Width: | Height: | Size: 636 B |
1
.img/performance-count.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="142" height="20" role="img" aria-label="performance tests: 241"><title>performance tests: 241</title><g shape-rendering="crispEdges"><rect width="111" height="20" fill="#555"/><rect x="111" width="31" height="20" fill="#97ca00"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text x="565" y="140" transform="scale(.1)" fill="#fff" textLength="1010">performance tests</text><text x="1255" y="140" transform="scale(.1)" fill="#fff" textLength="210">241</text></g></svg>
|
||||
|
After Width: | Height: | Size: 655 B |
1
.img/sanity-count.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="104" height="20" role="img" aria-label="sanity tests: 176"><title>sanity tests: 176</title><g shape-rendering="crispEdges"><rect width="73" height="20" fill="#555"/><rect x="73" width="31" height="20" fill="#97ca00"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text x="375" y="140" transform="scale(.1)" fill="#fff" textLength="630">sanity tests</text><text x="875" y="140" transform="scale(.1)" fill="#fff" textLength="210">176</text></g></svg>
|
||||
|
After Width: | Height: | Size: 636 B |
1
.img/total-count.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="96" height="20" role="img" aria-label="total tests: 519"><title>total tests: 519</title><g shape-rendering="crispEdges"><rect width="65" height="20" fill="#555"/><rect x="65" width="31" height="20" fill="#97ca00"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text x="335" y="140" transform="scale(.1)" fill="#fff" textLength="550">total tests</text><text x="795" y="140" transform="scale(.1)" fill="#fff" textLength="210">519</text></g></svg>
|
||||
|
After Width: | Height: | Size: 632 B |
59
README.md
@@ -5,13 +5,13 @@
|
||||
This repository contains the test automation framework and scripts for TIP Open WiFi.
|
||||
Test Framework is implemented in pytest
|
||||
|
||||

|
||||

|
||||
|
||||
The vision is to create an open test framework to ensure production grade Open Wifi Solution.
|
||||
|
||||
This test automation tied into our overall tooling at TIP as shown below:
|
||||
|
||||

|
||||

|
||||
|
||||
### General guidelines
|
||||
|
||||
@@ -41,7 +41,6 @@ pylint --fail-under=7 *py
|
||||
|
||||
the command above would produce a non-zero exit code if the score drops below 7.
|
||||
|
||||
|
||||
### TIP Controller Integration
|
||||
|
||||
Using Swagger Autogenerated CloudSDK Library pypi package (implemented with [swagger codegen](https://github.com/swagger-api/swagger-codegen)).
|
||||
@@ -50,7 +49,7 @@ Using Swagger Autogenerated CloudSDK Library pypi package (implemented with [swa
|
||||
|
||||
Currently the plan is to use pytest integrated with [allure](https://docs.qameta.io/allure/#_pytest) to create visual reports for the test outcomes
|
||||
|
||||
### Miscelanneous
|
||||
### Miscellaneous
|
||||
|
||||
1. Do not use old style string formatting: `"Hello %s" % var`; use `f"Hello {var}` instead
|
||||
2. use `"""` in Docstrings
|
||||
@@ -62,9 +61,17 @@ https://docs.pytest.org/en/latest/usage.html
|
||||
http://pythontesting.net/framework/pytest/pytest-introduction/
|
||||
|
||||
### Test status
|
||||
|
||||

|
||||
|
||||
[](https://github.com/Telecominfraproject/wlan-testing/actions/workflows/sanity.yml)
|
||||

|
||||
|
||||
[](https://github.com/Telecominfraproject/wlan-testing/actions/workflows/interop.yml)
|
||||

|
||||
|
||||
[](https://github.com/Telecominfraproject/wlan-testing/actions/workflows/performance.yml)
|
||||

|
||||
|
||||
### Best Practice
|
||||
|
||||
@@ -75,11 +82,11 @@ http://pythontesting.net/framework/pytest/pytest-introduction/
|
||||
|
||||
All code must be written in python 3 and conform to PEP 8 style guide. The test framework is built using pytest.
|
||||
|
||||
[](https://www.python.org/)
|
||||
[](https://www.python.org/)
|
||||
[](https://www.python.org/dev/peps/pep-0008/)
|
||||
|
||||
|
||||
### Directory Structure
|
||||
|
||||
```bash
|
||||
├── lanforge - /* to be migrated */
|
||||
├── libs
|
||||
@@ -101,6 +108,7 @@ All code must be written in python 3 and conform to PEP 8 style guide. The test
|
||||
|── scale
|
||||
|── README.md -/* Pytest framework and testcases information */
|
||||
```
|
||||
|
||||
### Setup Instructions
|
||||
|
||||
#### Step 1
|
||||
@@ -124,6 +132,19 @@ cd wlan-testing
|
||||
|
||||
#### Step 2
|
||||
|
||||
Please ensure you follow the steps outlined in [here](./libs/controller/README.md)
|
||||
|
||||
```shell
|
||||
Lets add the TIP pypi repository by following the below steps:
|
||||
|
||||
mkdir ~/.pip
|
||||
echo "[global]" > ~/.pip/pip.conf
|
||||
echo "index-url = https://pypi.org/simple" >> ~/.pip/pip.conf
|
||||
echo "extra-index-url = https://tip-read:tip-read@tip.jfrog.io/artifactory/api/pypi/tip-wlan-python-pypi-local/simple" >> ~/.pip/pip.conf
|
||||
```
|
||||
|
||||
#### Step 3
|
||||
|
||||
Please ensure you have python version >= 3 is required. Double check this by running "python --version" command.
|
||||
|
||||
```shell
|
||||
@@ -131,31 +152,7 @@ User this to check "python --version"
|
||||
|
||||
Lets Install the Python Packages needed
|
||||
|
||||
pip3 install pytest==6.2.2
|
||||
pip3 install bs4
|
||||
pip3 install paramiko
|
||||
pip3 install xlsxwriter
|
||||
pip3 install influxdb_client
|
||||
pip3 install allure-pytest
|
||||
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
#### Step 3
|
||||
|
||||
Please ensure you follow the steps outlined in [here](./libs/controller/README.md)
|
||||
|
||||
```shell
|
||||
Lets Install Controller Libraries, follow below steps:
|
||||
|
||||
mkdir ~/.pip
|
||||
echo "[global]" > ~/.pip/pip.conf
|
||||
echo "index-url = https://pypi.org/simple" >> ~/.pip/pip.conf
|
||||
echo "extra-index-url = https://tip-read:tip-read@tip.jfrog.io/artifactory/api/pypi/tip-wlan-python-pypi-local/simple" >> ~/.pip/pip.conf
|
||||
echo "tip-wlan-cloud" > ~/.pip/requirements.txt
|
||||
pip3 install -r ~/.pip/requirements.txt
|
||||
pip3 install -r requirements.txt
|
||||
```
|
||||
|
||||
#### Step 4
|
||||
|
||||
@@ -3,7 +3,8 @@ RUN mkdir ~/.pip
|
||||
RUN echo "[global]" > ~/.pip/pip.conf
|
||||
RUN echo "index-url = https://pypi.org/simple" >> ~/.pip/pip.conf
|
||||
RUN echo "extra-index-url = https://tip-read:tip-read@tip.jfrog.io/artifactory/api/pypi/tip-wlan-python-pypi-local/simple" >> ~/.pip/pip.conf
|
||||
RUN pip3 install pytest==6.2.2 bs4 paramiko xlsxwriter requests pandas influxdb influxdb-client scp allure-pytest tip-wlan-cloud selenium perfecto-py37 Appium-Python-Client
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip3 install -r requirements.txt
|
||||
COPY lanforge /wlan-testing/lanforge
|
||||
COPY tests /wlan-testing/tests
|
||||
COPY libs /wlan-testing/libs
|
||||
|
||||
14
requirements.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
allure-pytest
|
||||
Appium-Python-Client
|
||||
bs4
|
||||
influxdb
|
||||
influxdb-client
|
||||
pandas
|
||||
paramiko
|
||||
perfecto-py37
|
||||
pytest==6.2.2
|
||||
requests
|
||||
scp
|
||||
selenium
|
||||
tip-wlan-cloud
|
||||
xlsxwriter
|
||||