├── .github └── workflows │ └── blank.yml ├── .gitignore ├── .travis.yml ├── Jenkinsfile ├── Jenkinsfiles_Dec ├── LICENSE ├── README.md ├── azure-pipelines.yml ├── features ├── __init__.py ├── calc_feature_1.feature ├── calc_feature_2.feature ├── calc_feature_3.feature ├── pages │ ├── __init__.py │ └── simple_calculator.py └── steps │ ├── __init__.py │ └── simple_cal_steps.py └── requirements.txt /.github/workflows/blank.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - master 7 | push: 8 | branches: 9 | - master 10 | - release/* 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | strategy: 17 | max-parallel: 4 18 | matrix: 19 | python-version: [2.7] 20 | 21 | steps: 22 | - uses: actions/checkout@v1 23 | - name: Set up Python ${{ matrix.python-version }} 24 | uses: actions/setup-python@v1 25 | with: 26 | python-version: ${{ matrix.python-version }} 27 | - name: Run Parallel Test 28 | run: | 29 | python -m pip install --upgrade pip 30 | python --version 31 | pip install virtualenv 32 | virtualenv .env 33 | source .env/bin/activate 34 | pip install -r requirements.txt 35 | pip install git+git://github.com/hugeinc/behave-parallel.git@a57eff3087aae9bd7519a7d4fc15228611db20b9#egg=behave-parallel --upgrade 36 | pip freeze 37 | behave --processes 5 --parallel-element feature 38 | 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | 26 | # PyInstaller 27 | # Usually these files are written by a python script from a template 28 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 29 | *.manifest 30 | *.spec 31 | 32 | # Installer logs 33 | pip-log.txt 34 | pip-delete-this-directory.txt 35 | 36 | # Unit test / coverage reports 37 | htmlcov/ 38 | .tox/ 39 | .coverage 40 | .coverage.* 41 | .cache 42 | nosetests.xml 43 | coverage.xml 44 | *,cover 45 | 46 | # Translations 47 | *.mo 48 | *.pot 49 | 50 | # Django stuff: 51 | *.log 52 | 53 | # Sphinx documentation 54 | docs/_build/ 55 | 56 | # PyBuilder 57 | target/ 58 | 59 | .env/ 60 | 61 | .idea/ 62 | src/ 63 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | sudo: false 3 | python: 4 | - "2.7" 5 | cache: 6 | directories: 7 | - $HOME/.env/pip 8 | script: 9 | - python --version 10 | - pip install virtualenv 11 | - virtualenv .env 12 | - source .env/bin/activate 13 | - pip install -r requirements.txt 14 | - pip install git+git://github.com/hugeinc/behave-parallel.git@a57eff3087aae9bd7519a7d4fc15228611db20b9#egg=behave-parallel --upgrade 15 | - pip freeze 16 | - behave --processes 5 --parallel-element feature 17 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | node{ 2 | stage('Checkout Project'){ 3 | properties([pipelineTriggers([[$class: 'GitHubPushTrigger']])]) 4 | checkout scm 5 | git_branch = env.BRANCH_NAME 6 | git_tag = sh returnStdout: true, script: 'git tag -l --points-at HEAD' 7 | } 8 | 9 | stage("Bake Docker") { 10 | echo 'Bake Docker' 11 | } 12 | stage('Test'){ 13 | parallel ( 14 | "JUnit": { 15 | sh "echo JUnit" 16 | }, 17 | "DBUnit": { 18 | sh "echo DBUnit" 19 | }, 20 | "Jasmine": { 21 | sh "echo Jasmine" 22 | }, 23 | ) 24 | } 25 | 26 | stage('Deploy Dev'){ 27 | sh "echo Dev" 28 | } 29 | stage('Browser Tests'){ 30 | parallel ( 31 | "Firefox": { 32 | sh "echo Firefox" 33 | }, 34 | "Edge": { 35 | sh "echo Edge" 36 | }, 37 | "Safari": { 38 | sh "echo Safari" 39 | }, 40 | "Chrome": { 41 | sh "echo Chrome" 42 | }, 43 | ) 44 | } 45 | stage('Deploy Staging'){ 46 | sh "echo Staging" 47 | } 48 | stage('Browser Tests'){ 49 | parallel ( 50 | "Firefox": { 51 | sh "echo Firefox" 52 | }, 53 | "Edge": { 54 | sh "echo Edge" 55 | }, 56 | "Safari": { 57 | sh "echo Safari" 58 | }, 59 | "Chrome": { 60 | sh "echo Chrome" 61 | }, 62 | ) 63 | } 64 | 65 | stage('Deploy Perf'){ 66 | sh "echo Staging" 67 | } 68 | stage('Browser Tests'){ 69 | parallel ( 70 | "VAPT": { 71 | sh "echo VAPT" 72 | }, 73 | "Load Tests": { 74 | sh "echo Load Tests" 75 | }, 76 | "Stress Tests": { 77 | sh "echo Stress Tests" 78 | }, 79 | "Spike Tests": { 80 | sh "echo Spike Tests" 81 | }, 82 | ) 83 | } 84 | stage('Blue Production'){ 85 | sh "echo Blue Production" 86 | } 87 | stage('Post Deployment Browser Tests'){ 88 | parallel ( 89 | "Firefox": { 90 | sh "echo Firefox" 91 | }, 92 | "Edge": { 93 | sh "echo Edge" 94 | }, 95 | "Safari": { 96 | sh "echo Safari" 97 | }, 98 | "Chrome": { 99 | sh "echo Chrome" 100 | }, 101 | ) 102 | } 103 | stage('Green Production'){ 104 | sh "echo Green Production" 105 | } 106 | stage("Merge Pull Request") 107 | { 108 | sh "echo Merge Pull Request" 109 | } 110 | stage("Merge to Master") 111 | { 112 | sh "echo Merge to Master" 113 | } 114 | 115 | } 116 | -------------------------------------------------------------------------------- /Jenkinsfiles_Dec: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent { docker { image 'python:3.7.2' } } 3 | stages { 4 | stage('build') { 5 | steps { 6 | sh 'pip install -r requirements.txt' 7 | } 8 | } 9 | stage('test') { 10 | steps { 11 | sh 'python test.py' 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Vishal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Welcome to the behave_parallel_demo wiki! 3 | 4 |
8 | 9 | 10 | | CI Provider | Build Status | Time Taken(Approx) | 11 | | ------------- | ------------- | ------------- | 12 | | **Github Actions** | [](https://launch-editor.github.com/actions?workflowID=CI&event=push&nwo=vishalm%2Fbehave_parallel_demo)| 40+ Sec [Github Status](https://launch-editor.github.com/actions?workflowID=CI&event=push&nwo=vishalm%2Fbehave_parallel_demo)| 13 | | **Azure DevOps** | [](https://dev.azure.com/vishalmishra84/Test%20Project/_build/latest?definitionId=2&branchName=master) | 31+ Sec [Azure Stats](https://dev.azure.com/vishalmishra84/Test%20Project/_build?definitionId=2&view=ms.vss-pipelineanalytics-web.new-build-definition-pipeline-analytics-view-cardmetrics)| 14 | | **Travis** | [](https://travis-ci.org/vishalm/behave_parallel_demo) | 33+ Sec [Travis Status](http://scribu.net/travis-stats/#vishalm/behave_parallel_demo/master)| 15 | 16 | 17 | 18 | #### Must do 19 | How what want to manage virtual env but make sure you are following these steps 20 | * `virtualenv .env ` 21 | * `source .env/bin/activate ` 22 | * `pip install -r requirements.txt` 23 | * `pip install git+git://github.com/hugeinc/behave-parallel.git@a57eff3087aae9bd7519a7d4fc15228611db20b9#egg=behave-parallel --upgrade` ### Super importent 24 | 25 | 26 | ##Works exact steps on Ubuntu: 27 | 28 | ### Steps: 29 | 1. Clone this repo 30 | 1. Goto to root of the project 31 | 1. Create a virtual evn 32 | 33 | * `virtualenv .env ` 34 | * `source .env/bin/activate ` 35 | * `pip install -r requirements.txt` 36 | * `pip install git+git://github.com/hugeinc/behave-parallel.git@a57eff3087aae9bd7519a7d4fc15228611db20b9#egg=behave-parallel --upgrade` ### Super importent 37 | * `pip freeze` 38 | 39 | ###Run Features in parallel 40 | `/usr/bin/time behave --processes 5 --parallel-element feature ` 41 | 42 | ###Run Scenario in parallel 43 | `/usr/bin/time behave --processes 5 --parallel-element scenario ` 44 | 45 | ###How I run feature: 46 | `/usr/bin/time behave --processes "${PROCESS_COUNT}" --parallel-element feature --junit --junit-directory=xmlrunner -v -t "${TAGS_LIST}" -f rerun -o rerun.txt -f plain -T --no-skipped --tags=~@xfail features/` 47 | 48 | ###How I run Scenario: 49 | `/usr/bin/time behave --processes "${PROCESS_COUNT}" --parallel-element scenario --junit --junit-directory=xmlrunner -v -t "${TAGS_LIST}" -f rerun -o rerun.txt -f plain -T --no-skipped --tags=~@xfail features/ ` 50 | 51 | Actual Source: 52 | 53 |