Observed since 21 Oct, 08:58 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0xislamtaha/orchestrator
Execute cypress specs in parallel across multiple docker containers

Orchestrator executes all cypress specs across n parallel docker containers based on a configuration file.
1- Cypress parallelization with the Orchestrator — part 1
2- Cypress parallelization with the Orchestrator — part 2 — ShowCase
Check the following repo as a public use case.
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 🚀.
brew install coreutils command.npm -g install @0xislamtaha/orchestrator
npm -g install 0xislamtaha/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
npx orchestrator --config "/path/to/orchestrator.json"
npx orchestrator --config ./src/orchestrator.json --parallelizm 2 --environment '{"DOCKER_TAG":"master_283"}' --browsers "[chrome, firefox]" --specs "[alerts.js, avatar.js]"
The orchestrator generates two reports by default:
mochawesome-report dir.ExecutionTimeReport dir.Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
argEnvironment{
"local_name": "arg",
"alias": false,
"peer_metadata": null
} | ^4.1.3 | runtime |
esmEnvironment{
"local_name": "esm",
"alias": false,
"peer_metadata": null
} | ^3.2.25 | runtime |
mochawesome-mergeEnvironment{
"local_name": "mochawesome-merge",
"alias": false,
"peer_metadata": null
} | ^4.1.0 | runtime |
mochawesome-report-generatorEnvironment{
"local_name": "mochawesome-report-generator",
"alias": false,
"peer_metadata": null
} | ^5.1.0 | runtime |
shelljsEnvironment{
"local_name": "shelljs",
"alias": false,
"peer_metadata": null
} | ^0.8.4 | runtime |
Source distribution
{
"integrity": "sha512-CQmwnpbu7fH/JMDk2z2yaFJhkOU/j+9rnjblIrb8ctgy9phQtqUMmptfqDnUtu0vmMWbSkjMR6uvnhyN2xN3fQ==",
"shasum": "3ad0b2c9f4b0d15803ced1528fd4e5579a935987",
"tarball": "https://registry.npmjs.org/@0xislamtaha/orchestrator/-/orchestrator-2.0.2.tgz",
"fileCount": 10,
"unpackedSize": 22652,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh6s9CCRA9TVsSAnZWagAAlXoP/20uDg4f0yuvHlat4rn3\n+KxNgedaayIGqYqF/oMyPIoQguYSlzz06nDPW5mQqi8+3c3XfNrLC4aFpGKD\nAiulYFAROhXAE0kRYn6htYtPa70crb7dIX/U8dqYQS1lZ/wMD8emgTHvccbb\n+ltgObprY8MgdWD+Iwz2e3AJ9NdpWrcu9VCfryRB9yArGlo7LlC3oJ9K4ub8\nBUtHZvGhbdJoU3lMJo5rjS2DETxCq+MPzUWIsBppqYEyi/DPHAS0REh1QjKh\nccg3qGhcKHUVS+0vYS4b5N8DJx2wPhbPhyVyGI9nE9JY/naUdQ2VuFG24ip1\nilVsfBoAUMjf/rI6PUnEcRNvp/6yzck1ONU+vxPFeBQ8GQoZML1EqelGcxO7\nTy1xb+SKTgWwrR3XvMlDg+c3W4iiuZudNfKoCwexD/v1vgcb9YROqC8ufhPN\n2Nlg+y5d9dkDN53OG506tcNyQClvgbdnS8dQ5qpBHGNMZapyUEkxQiBlIpin\nmouFVpXJVmKB+OzYfkzexwADRToYfnI3+hU/jzkTw6yPOV2pF5p2QEqyk5qm\n8qwIt5nw1lKSKAz8dh4ads88PgfF0uHFH4Ye11TKCFhaFfqCL4XltecfIx38\nYuBDbwHM0qMM8xM3zGz9wSPA/HBW/dN3uP4P3ZBZNwG6RiNklGZROLn20waD\nTgzw\r\n=pXPw\r\n-----END PGP SIGNATURE-----\r\n",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIQCDMBegKpsw27sz9pG0caQ70rDdjUmV2Dg/M5c7Z4oD3AIgMMY8rxGgTdjI043/Ie26qmEuwZRYHiBG2AisXv/knLQ="
}
]
}Observed since 21 Oct, 08:58 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:d101c1987f73ec184569dc8e4e0b907c8cb16d704443ff08c9fd33075a30ceb6