Skip to main content

Library for running distributed Cicada tests

Project description

cicada-distributed

Main-Test

Cicada Distributed is a framework with the goal of making integration, load, and stress tests less expensive to build. Cicada is designed to manage vast groups of users to test your services while making tests easier to build and understand. To get started, install Cicada through pip:

pip install cicadad

Example

Create a file called test.py with the following:

from cicadad.core.decorators import scenario
from cicadad.core.engine import Engine

engine = Engine()


@scenario(engine)
def my_first_test(context):
    # Results of previously run scenarios get passed in as context

    # Write the body of your test here
    assert 2 + 2 == 4

    # Anything returned gets saved as a user output
    return "Passed!"


if __name__ == "__main__":
    engine.start()

Next, run the test:

cicada-distributed run

You should see Cicada run the test and print something like this in the console:

========================= Test Complete =========================

Passed:

* my_first_test

====================== 1 passed, 0 failed =======================

--------------------- my_first_test: Passed ---------------------

Time Taken: 2.018773 Seconds
Succeeded: 1 Loop(s)
Failed: 0 Loop(s)
Metrics:
                      my_first_test metrics
 ───────────────────────────────────────────────────────────────
  name                 value
 ───────────────────────────────────────────────────────────────
  runtimes             Min: 0.118, Median: 0.118, Average:
                       0.118, Max: 0.118, Len: 1
  results_per_second
  success_rate         100.0
 ───────────────────────────────────────────────────────────────

Example with Docker

To create a test and Dockerfile, create a directory and initialize the test scripts:

mkdir example-tests
cicada-distributed init ./example-tests

You should see a couple of files:

- example-tests
  - test.py
  - Dockerfile

Before running tests, you must start a local backend:

cicada-distributed start-cluster

When you run the command cicada-distributed run --mode=DOCKER, Cicada will build an image for the test and start a test runner. You should see the test runner create a container for the test, scenario, and users when you run docker ps.

Once tests are complete, stop the cluster:

cicada-distributed stop-cluster

Documentation

Documentation is available at https://cicadatesting.github.io/cicada-distributed-docs/docs/introduction/installation

Demos are available at https://github.com/cicadatesting/cicada-distributed-demos

Cicada Cloud's homepage is https://cicada-cloud.webflow.io/

Help

If you have a question, please post it on Stack Overflow with the cicada-distribtued tag:

https://stackoverflow.com/questions/tagged/cicada-distributed.

Chat

For quick questions, please feel free to post them on the Discord server.

Bugs

To report a bug, add it to the project's GitHub issue tracker.

License

Copyright Jeremy Herzog, 2021.

Cicada Distributed uses the Apache 2.0 license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cicadad-1.7.0.tar.gz (147.0 MB view details)

Uploaded Source

Built Distribution

cicadad-1.7.0-py3-none-any.whl (147.5 MB view details)

Uploaded Python 3

File details

Details for the file cicadad-1.7.0.tar.gz.

File metadata

  • Download URL: cicadad-1.7.0.tar.gz
  • Upload date:
  • Size: 147.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for cicadad-1.7.0.tar.gz
Algorithm Hash digest
SHA256 14793abe31bc40e05503e36da89b4a87aa2ecb66b217dc51d5cbd05be9bde001
MD5 0ec975c7eaf3a47ce0f4276b2abf9e80
BLAKE2b-256 045f622418995e1962c9673d39cacb89dab6c0b1232e14780a1a8bad0c0f042a

See more details on using hashes here.

File details

Details for the file cicadad-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: cicadad-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 147.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for cicadad-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 713ff9b8065fb891e809f297299cab1e0453dccaaf6eff4c2ca8343ec2e22daa
MD5 4b0380200d0a6b472c0ed050e2af87c1
BLAKE2b-256 e141656b2a640ae178a032d67febadbe062004f1fb56ce4698c0b7a24b6324bd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page