Skip to content

Commit

Permalink
[qalab] update tox+CIs
Browse files Browse the repository at this point in the history
  • Loading branch information
josue.garcia committed Nov 28, 2019
1 parent 7cdceab commit 6909b6f
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 277 deletions.
18 changes: 3 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ env:
- secure: Q3yIlvsQ2Ten33rNGcL5+5UglAWmri0ga6Z2FQKq4SXUMyKJhfQsP96TyTgDjWupgrtVag1q/cNecwyJHNQKW6p2HUg9FKeSk+v8qxXpgm58NGm4R1WJY6OaFaxX8vE6RXShzrT55jeEGCj+wPbpSotOsAArtodUqGKnqCQHS5AKaCsFkmthMped3lM1Rw+qR/ToQLrrrfoPN4V/c8g5j0x4II+6XSSLoNLlovN8MF8pJzQ2ZpHfaus7U147ErG5Xyjxt7RQXwyXCjOJbjZ5u8UOwLd5dGp37z081ZG/HpilDi/G1JEAz5vGo2cwVSxhCnJ9qCuqyzd2VNBlBpKEZwIlGp+CxBON2En9c3Vc3HzWTS6fofTOyJe04hZOND/k0r8eDWTSultIIkgmrdTr4iVkeoCw/GRvxbP33qFkUBexmhykhhcXGwDC0JUxU/XkFUdpaR5hIDfcbiduhBGNM/Z53rcktt0O/Ug8wXp+PmQ7MBrKYh4ZesytLa3CIfJkJr+hr9+L9YP7VooJDNbz4q78IucfYmqhuLS3f+JdfHbpYAcnt42ueYYZjibL3QoSprb61IWVFikt4Pt01uD1V//F5cysm8qVGzfg8L5KlZJcF/DUYqJnaazkasKztKR8pdMMcMSa3tAeOkH1jxGf9fUhXuHXD1D9KqokA4zqhYo=
#GITHUB_TOKEN
- secure: F0st01LnybnS75tBmlQSdM9Ydb38HUTuddRecUwRDfb3s6nbI+LPRgrFtdpDMh1PdSMUG3hiDhpCe1OQpRq9VPvCdYoGrd0PZi0wUYWrd8F8eOEV5UcX6NvL3uZxwDjIo6M3Bkkl4HVfhbSmLgtkdXhIg0K9LWMOLqamh5/OXY1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9j3HxiTlMXSopMtMCRLQZoiu3ipCnIsyGROgeBbBg0Xq67qECD9k8hqrwlgnbjxlAgbGi3yMTb1nkh6AhCs59NwcUeGQoW/7k6UgA4p9rSHwEupbzmXKvn7brjca5Ih5wmlRne10qnFS+dLvMg=
language: python
matrix:
include:
Expand All @@ -31,7 +24,6 @@ matrix:
python: 3.6
env: TOXENV=py36


before_install:
- git submodule foreach git checkout master
- pip install tox
Expand All @@ -41,15 +33,11 @@ install:
before_script:
- python setup.py install
script:
- tox -e "flake8,$TOXENV"
- python qalab/qaenv.py -sd selenium -m hub -p lin64 -s &
- python qalab/qaenv.py -sd selenium -m node -p lin64 -s &
- sleep 10
- nc -z -v -w5 localhost 11000
- nc -z -v -w5 localhost 11001

after_script:
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
sonar-scanner -X -Dsonar.login=${SONAR_GITHUB_TOKEN} -Dsonar.host.url=http://qalab.tk:82 ;
else
sonar-scanner -X -Dsonar.login=${SONAR_GITHUB_TOKEN} -Dsonar.host.url=http://qalab.tk:82 -Dsonar.github.repository=netzulo/qalab -Dsonar.github.pullRequest=${TRAVIS_PULL_REQUEST} -Dsonar.github.oauth=${GITHUB_TOKEN} -Dsonar.analysis.mode=preview ;
fi
after_success:
- tox -e docs
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).


## [Unreleased] - xxxx-xx-xx

### Added
- This CHANGELOG

### Changed
- CI's configuration files #untracked
- pytest configuration files #untracked
- tox configuration files #untracked
- Update readme to improve readability

### Fixed

### Removed
- sonarqube configuration files #untracked
- Visual Studio Professional configuration files #untracked


[Unreleased]: https://github.com/netzulo/qacode/compare/v0.1.6...HEAD
[0.1.6]: https://github.com/netzulo/qacode/compare/v0.1.5...v0.1.6
93 changes: 34 additions & 59 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,6 @@ QA laboratory
| | |qalab_build_master_win| | |qacode_build_master_win| | |qadmin_build_master_win| | |qadoc_build_master_win| | |qadoc_build_master_win| |
+--------------+--------------------------+---------------------------+---------------------------+--------------------------+--------------------------+

Documentation
-------------

- QAlab qalab_api_
- QAcode qacode_api_
- QAtestlink qatestlink_api_
- QAdoc qadoc_api_
- QAdmin qadmin_api_
- QAdrivers qadrivers_api_


Code Metrics by sonarqube
-------------------------

.. image:: http://qalab.tk:82/api/badges/gate?key=qalab
:alt: Quality Gate
:target: http://qalab.tk:82/api/badges/gate?key=qalab
.. image:: http://qalab.tk:82/api/badges/measure?key=qalab&metric=lines
:alt: Lines
:target: http://qalab.tk:82/api/badges/gate?key=qalab
.. image:: http://qalab.tk:82/api/badges/measure?key=qalab&metric=bugs
:alt: Bugs
:target: http://qalab.tk:82/api/badges/gate?key=qalab
.. image:: http://qalab.tk:82/api/badges/measure?key=qalab&metric=vulnerabilities
:alt: Vulnerabilities
:target: http://qalab.tk:82/api/badges/gate?key=qalab
.. image:: http://qalab.tk:82/api/badges/measure?key=qalab&metric=code_smells
:alt: Code Smells
:target: http://qalab.tk:82/api/badges/gate?key=qalab
.. image:: http://qalab.tk:82/api/badges/measure?key=qalab&metric=sqale_debt_ratio
:alt: Debt ratio
:target: http://qalab.tk:82/api/badges/gate?key=qalab
.. image:: http://qalab.tk:82/api/badges/measure?key=qalab&metric=comment_lines_density
:alt: Comments
:target: http://qalab.tk:82/api/badges/gate?key=qalab


How to install ?
----------------
Expand All @@ -68,21 +32,9 @@ How to install ?
+ 2. *Enter on repo directory* : ``cd qalab``
+ 3. *Clone submodules* : ``git submodule update --init --recursive``
+ 4. *Attach branches HEAD* : ``git submodule foreach git checkout master``
+ 5. *Install qalab package*: from PIP ``pip install qalaboratory`` or from setup.py file ``python setup.py install``


How to exec tests ?
-------------------

+ 1. *Clone this repo* : ``git clone https://github.com/netzulo/qalab.git``
+ 2. *Enter on repo directory* : ``cd qalab``
+ 3. *Execute test with setup.py* : ``python setup.py test``


PIP install
***********

``pip install qalaboratory``

Command Usage
*************

Expand Down Expand Up @@ -136,10 +88,6 @@ Appium
+ 3. Create configuration : ``python qalab/qaenv.py --server_driver appium --mode node --install``
+ 4. Start Node : ``python qalab/qaenv.py --server_driver appium --mode node --start --platform win64``


TOX environments
****************

+---------------------+--------------------------------+
| Env name | Env description |
+=====================+================================+
Expand All @@ -160,6 +108,39 @@ TOX environments
| appium-node | Start intalled appium node |
+---------------------+--------------------------------+

How to exec tests ?
-------------------

+ Tests from setup.py file : ``python setup.py test``

+ Install from PIP file : ``pip install tox``
+ Tests from tox : ``tox -l && tox -e TOX_ENV_NAME`` ( *see tox.ini file to get environment names* )


+---------------------+--------------------------------+
| TOX Env name | Env description |
+=====================+================================+
| py27,py34,py35,py36 | Python supported versions |
+---------------------+--------------------------------+
| flake8 | Exec linter in qalab/ tests/ |
+---------------------+--------------------------------+
| coverage | Generate XML and HTML reports |
+---------------------+--------------------------------+
| docs | Generate doc HTML in /docs |
+---------------------+--------------------------------+
| selenium-hub | Start intalled selenium hub |
+---------------------+--------------------------------+
| selenium-node | Start intalled selenium node |
+---------------------+--------------------------------+
| selendroid-hub | Start intalled selendroid hub |
+---------------------+--------------------------------+
| selendroid-node | Start intalled selendroid node |
+---------------------+--------------------------------+
| appium-node | Start intalled appium node |
+---------------------+--------------------------------+
| selenium-tests | Execute Hub+Node tests |
+---------------------+--------------------------------+


QADrivers
*********
Expand Down Expand Up @@ -201,9 +182,3 @@ QADrivers
.. |qatestlink_build_master_win| image:: https://ci.appveyor.com/api/projects/status/kw4si7if8lw7m10n/branch/master?svg=true
.. |qatestlink_build_devel_lin| image:: https://travis-ci.org/netzulo/qatestlink.svg?branch=devel
.. |qatestlink_build_devel_win| image:: https://ci.appveyor.com/api/projects/status/kw4si7if8lw7m10n/branch/devel?svg=true
.. _qalab_api: http://qalab.tk/qalab/
.. _qacode_api: http://qalab.tk/qacode/
.. _qatestlink_api: http://qalab.tk/qatestlink/
.. _qadoc_api: http://qalab.tk/qadoc/
.. _qadmin_api: http://qalab.tk/qadmin/
.. _qadrivers_api: http://qalab.tk/qadrivers/
58 changes: 29 additions & 29 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
build: off
branches:
only:
- master
- devel
environment:
global:
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
# /E:ON and /V:ON options are not enabled in the batch script intepreter
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
CLCACHE_NODIRECT: "true"

matrix:
- JOB: "2.7 32-bit"
TOXENV: "py27"
Expand All @@ -12,54 +23,43 @@ environment:
PYTHON_VERSION: "2.7.10"
PYTHON_ARCH: "64"

- JOB: "3.4 32-bit"
TOXENV: "py34"
PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.4"
PYTHON_ARCH: "32"
- JOB: "3.4 64-bit"
TOXENV: "py34"
PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4"
PYTHON_ARCH: "64"

- JOB: "3.5 32-bit"
TOXENV: "py35"
PYTHON: "C:\\Python35"
PYTHON_VERSION: "3.5.0"
PYTHON_ARCH: "32"
- JOB: "3.5 64-bit"
TOXENV: "py35"
PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.0"
PYTHON_ARCH: "64"

- JOB: "3.6 32-bit"
TOXENV: "py36"
PYTHON: "C:\\Python36"
PYTHON_VERSION: "3.6.3"
PYTHON_ARCH: "32"
- JOB: "3.6 64-bit"
TOXENV: "py36"
PYTHON: "C:\\Python36"
PYTHON_VERSION: "3.6.3"
PYTHON_ARCH: "64"

install:
# Prepend newly installed Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
# Check that we have the expected version and architecture for Python
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
# Upgrade to the latest version of pip to avoid it displaying warnings
# about it being out of date.
- "pip install --disable-pip-version-check --user --upgrade pip"
- "python -m pip install wheel"
- "python -m pip install --pre -U tox"
- "tox -e \"{%TOXENV%,selenium-hub,selenium-node,appium-node}\""
# Prepend newly installed Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
# Check that we have the expected version and architecture for Python
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
# Upgrade to the latest version of pip to avoid it displaying warnings
# about it being out of date.
- "python -m pip install wheel"
- "python -m pip install --upgrade pip"
- "python -m pip install --pre -U tox"

test_script:
- "tox -e flake8,%TOXENV%"

after_test:
- "python setup.py sdist"

artifacts:
- path: "dist\\*"

Empty file added conftest.py
Empty file.
12 changes: 4 additions & 8 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
[pytest]
addopts =
--verbose
--junit-xml=tests/reports/report_xunit.xml
--html=tests/reports/report_html.html
--self-contained-html
--cov=qalab tests/
--cov-report html:tests/reports/report_coverage_html/
--cov-report xml:tests/reports/report_coverage.xml
addopts = --verbose
testpaths = tests
console_output_style = progress
python_files = suite_*_*.py
python_classes = Test*
python_functions = test_*_*
filterwarnings =
error
ignore::UserWarning
84 changes: 0 additions & 84 deletions qalab.pyproj

This file was deleted.

Loading

0 comments on commit 6909b6f

Please sign in to comment.