Giter Site home page Giter Site logo

dcos-e2e's Introduction

Build Status

codecov

Updates

DC/OS End to End tests

End to end tests are tests which require a DC/OS cluster to run against. Each test spins up at least one cluster, and has the choice of configuring this cluster as appropriate. For example, a test may require a cluster with a certain number of agents, or certain configuration options.

Usage

Tests must be run in a supported environment. See "Required Environment".

To create tests using clusters with custom configurations, first install the harness:

pip install --process-dependency-links git+https://github.com/mesosphere/dcos-e2e.git@master 

Then, create a test, such as the following:

import subprocess
import uuid
from pathlib import Path

from dcos_e2e.backends import Docker
from dcos_e2e.cluster import Cluster
from passlib.hash import sha512_crypt

def test_oss_example():

    oss_artifact = Path('/tmp/dcos_generate_config.sh')

    with Cluster(cluster_backend=Docker()) as cluster:
        cluster.install_dcos_from_path(
            build_artifact=oss_artifact,
            extra_config={'check_time': True},
        )
        (master, ) = cluster.masters
        result = master.run(args=['test', '-f', path],
                            user=cluster.default_ssh_user)
        print(result.stdout)
        cluster.wait_for_dcos_oss()
        cluster.run_integration_tests(pytest_command=['pytest', '-x', 'test_tls.py'])
        try:
            master.run(args=['test', '-f', '/no/file/here'],
                       user=cluster.default_ssh_user)
        except subprocess.CalledProcessError:
            print('No file exists')

def test_ee_example():

    ee_artifact = Path('/tmp/dcos_generate_config.ee.sh')

    superuser_username = str(uuid.uuid4())
    superuser_password = str(uuid.uuid4())

    # DC/OS Enterprise clusters require various configuration variables which
    # are not allowed or required by DC/OS OSS clusters.
    extra_config = {
        'superuser_username': superuser_username,
        'superuser_password_hash': sha512_crypt.hash(superuser_password),
        'fault_domain_enabled': False,
    }

    with Cluster(cluster_backend=Docker()) as cluster:
        cluster.install_dcos_from_path(
            build_artifact=ee_artifact,
            extra_config=extra_config,
        )
        cluster.wait_for_dcos_ee(
            superuser_username=superuser_username,
            superuser_password=superuser_password,
        )

See API.md for details on the API.

Contributing

See CONTRIBUTING.md for details on how to contribute to this repository.

Required Environment

See BACKENDS.md for details on requirements for launching clusters with each backend.

Cleaning Up and Troubleshooting

Some backends leave junk around, especially when tests are cancelled. See BACKENDS.md for specifics of dealing with particular backends.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.