All Projects → 0xIslamTaha → orchestrator

0xIslamTaha / orchestrator

Licence: other
The orchestrator executes all cypress specs across parallel docker containers based on a configuration file.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to orchestrator

split-tests
Split test files in Jest and Cypress into parallel CI jobs
Stars: ✭ 22 (-63.93%)
Mutual labels:  parallel, cypress
dbaTDPMon
dbaTDPMon - Troubleshoot Database Performance and Monitoring
Stars: ✭ 20 (-67.21%)
Mutual labels:  parallel
cypress-cheat-sheet
A cheat sheet for Cypress.io
Stars: ✭ 27 (-55.74%)
Mutual labels:  cypress
Madara
✍️ A way for people to manage their tasks.
Stars: ✭ 17 (-72.13%)
Mutual labels:  cypress
esp-idf-parallel-tft
8bit parallel TFT & 4-line resistance touch screen Driver for esp-idf using i2s paralell mode
Stars: ✭ 45 (-26.23%)
Mutual labels:  parallel
codeceptjs-bdd
Javascript BDD UI Automation Framework. Exclusive LWC Shadow DOM Support. Playwright, Webdriver.io, Appium, Saucelabs.
Stars: ✭ 35 (-42.62%)
Mutual labels:  parallel
gitall.rs
Run Git commands in all subdirectories really fast
Stars: ✭ 25 (-59.02%)
Mutual labels:  parallel
svelte-starter-kit
Svelte starter kit — router, state management and testing included.
Stars: ✭ 16 (-73.77%)
Mutual labels:  cypress
cypress-get-it
Get elements by data attribute by creating a Cy command on the fly
Stars: ✭ 23 (-62.3%)
Mutual labels:  cypress
webring
“วงแหวนเว็บ” แห่งนี้สร้างขึ้นเพื่อส่งเสริมให้ศิลปิน นักออกแบบ และนักพัฒนาชาวไทย สร้างเว็บไซต์ของตัวเองและแบ่งปันการเข้าชมซึ่งกันและกัน
Stars: ✭ 125 (+104.92%)
Mutual labels:  cypress
quasar-starter-ssr-pwa-jest-cypress
Accelerated starter kit for building a quasar 17 app.
Stars: ✭ 49 (-19.67%)
Mutual labels:  cypress
cephgeorep
An efficient unidirectional remote backup daemon for CephFS.
Stars: ✭ 27 (-55.74%)
Mutual labels:  parallel
exrs
100% Safe Rust OpenEXR file library
Stars: ✭ 79 (+29.51%)
Mutual labels:  parallel
lego-webapp
Open source frontend for abakus.no
Stars: ✭ 44 (-27.87%)
Mutual labels:  cypress
optuna-examples
Examples for https://github.com/optuna/optuna
Stars: ✭ 238 (+290.16%)
Mutual labels:  parallel
starter-kit
Starter kit for full-stack JavaScript projects
Stars: ✭ 21 (-65.57%)
Mutual labels:  cypress
ProtoPromise
Robust and efficient library for management of asynchronous operations in C#/.Net.
Stars: ✭ 20 (-67.21%)
Mutual labels:  parallel
app
Source code of intencje.pl website and mobile/desktop apps based on Angular, Firebase, and Capacitor.
Stars: ✭ 12 (-80.33%)
Mutual labels:  cypress
wasm-bindgen-rayon
An adapter for enabling Rayon-based concurrency on the Web with WebAssembly.
Stars: ✭ 257 (+321.31%)
Mutual labels:  parallel
Recorder
A browser extension that generates Cypress, Playwright and Puppeteer test scripts from your interactions 🖱 ⌨
Stars: ✭ 277 (+354.1%)
Mutual labels:  cypress

🔥 orchestrator 🔥

orchestrator

Orchestrator executes all cypress specs across n parallel docker containers based on a configuration file.

😎 Orchestrator Tutorial:

1- Cypress parallelization with the Orchestrator — part 1

2- Cypress parallelization with the Orchestrator — part 2 — ShowCase

😍 Usecases:

Check the following repo as a public use case.

♟️ Orchestrator mechanism:

  • Pares a config file.
  • Create (config.parallelizm * config.browsers.length) containers in parallel.
  • Recursively list all the specs files
  • Split all the specs across all those machines based on their execution time.
  • Collect all the execution json reports from those containers.
  • Down all the running containers.
  • Generate one HTML report that has all specs execution results.
  • Analyse the execution time for each spec.
  • Generate the execution time reports per browser under ExecutionTimeReport dir.
  • In the next run, The orchestrator will split the test cases based on this execution time report to reduce the execution time.

🏹 The Splitting mechanism:

The orchestrator can measure and report the execution time for each spec per browser. It will report it as mochawesome-report/specsExecutionTime-chrome.json file. If you provided this path as specsExecutionTimePath in the next run, The orchestrator will split the specs-based on its execution time to minimize the total execution time 🚀.

⌨️ Operating Systems:

  • Linux: working out of the box.
  • MacOS: please exeucte brew install coreutils command.
  • Windows 10: fully supported via WSL.

👌 Installation:

  • Install from npm
npm -g install @0xislamtaha/orchestrator
  • Install from Github branch
npm -g install 0xislamtaha/orchestrator

🔑 Requirements to use orchestrator:

1- docker-compose file with a cypress service. here is an example of it.

version: '3.8'
services:
  cypress-container:
    image: 0xislamtaha/cypress-snapshot-image:latest
    network_mode: "bridge"
    volumes:
      - ./cypress/:/cypress_testing/cypress
      - ./mochawesome-report:/cypress_testing/mochawesome-report
      - /dev/shm:/dev/shm

2- use mochawesome as a reporter in cypress.json, just add the following snippet to your cypress.json.

{
  "reporter": "mochawesome",
  "reporterOptions": {
    "reportDir": "cypress/report/mochawesome-report",
    "overwrite": false,
    "html": false,
    "json": true
  }
}

3- Edit the orchestrator configuration file with your configuration. Here is the description of each configuration option.

- parallelizm:
    description: number of container machines per browser
    type: Integer
    example: 2

- browser:
    description: list of browsers
    type: list
    example: ["chrome", "firefox"]

- timeout:
    description: timeout of each process of cypress 
    type: string
    example: "20m"

- environment:
    description: enviroment variable to be exported 
    type: dict
    example: {"DOCKER_TAG": "master_283"}

- preCommands: 
    description: list of commands to be executed befor the deployment of the cypress containers
    type: list
    example: ["ls -al", "mkdir -p test"],

- dockerComposeOptions:
    description: docker-compose options to be passed to the docker-compose commands
    type: dict
    example: {"-p": "project_name"}

- dockerComposePath:
    description: path to the docker compose file.
    type: string
    example: "/opt/code/github/cypress.docker-compose.yml"

- specsHomePath:
    description: path to the specs dir in the host machine.
    type: string
    example: "/opt/code/github/cypress/integration/"

- specsDockerPath:
    description: path to the specs dir in the cypress container.
    type: string
    example: "/cypress/integration"

- cypressContainerName:
    description: the name of cypress service.
    type: sting
    example: "cypress_service"

- mochawesomeJSONPath:
    description: path to the mochawseom dir in the host machine.
    type: string
    example: "mochawesome-report/*.json"

- reportPath:
    description: path to save the generated HTML report dir.
    type: string
    example: "./"

- specs:
    description: array of specific specs to be executed
    type: array
    example: ["test.js", "test2.js"]

- analyseReport:
    description: boolen value to generate an execution time report. 
    type: boolen
    example: true

🎮 Usage:

  • With your configuration file
npx orchestrator --config "/path/to/orchestrator.json"
  • You can overwrite any configuration param on the fly, simply pass the new configuration as a parameter.
npx orchestrator --config ./src/orchestrator.json --parallelizm 2 --environment '{"DOCKER_TAG":"master_283"}' --browsers "[chrome, firefox]" --specs "[alerts.js, avatar.js]"

📖 Reports:

The orchestrator generates two reports by default:

  • The HTML report under the mochawesome-report dir.
  • The execution time reports per browser und ExecutionTimeReport dir.

🎬 To-Do:

  • list configuration rather than multiple files for multiple test suites.
  • Provide --help option.

License:

The orchestrator is licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].