Skip to main content

Maxwell's demon of test enviroment

Orchestrate testing env easily.

Wraps docker-compose and it's dependencies into it's own container with http api.

Execute docker-compose commands sequences for starting requested services set from volumed docker-compose files. Rerun environment when in-flight one is different from new requested.

Vedro usage

Add "supervisor" container

  maxwelld:
    image: docker.io/ko10ok/maxwelld:0.2.9
    volumes:
      - .:/project
      - ./docker-composes:/docker-composes
      - ./env-tmp:/env-tmp
    environment:
      - DOCKER_HOST=tcp://dockersock:2375
      - COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME}
      - NON_STOP_CONTAINERS=dockersock,maxwelld,e2e
      - HOST_PROJECT_ROOT_DIRECTORY=${HOST_PROJECT_ROOT_DIRECTORY}

Define services config

# env_set.py
from maxwelld import Environments
from maxwelld import Environment
from maxwelld import DEFAULT_ENV
from maxwelld import Service

web = Service('web')
web_gallery = Service('web-gallery')  # Service names "web-gallery", "mq", etc from docker-compose.yml
mq = Service('mq')
db = Service('db')

class Envs(Environments):
    DEFAULT = Environment(
        DEFAULT_ENV,
        web, web_gallery,
        db,
        mq
    )

Enable plugin

from maxwelld import vedro_plugin as vedro_maxwell
from maxwelld import ComposeConfig
from env_set import Envs

class Config(vedro.Config):

    class Plugins(vedro.Config.Plugins):
        
        class VedroMaxwell(vedro_maxwell.VedroMaxwell):
            enabled = True
            envs = Envs()
            compose_cfgs = {
                'default': ComposeConfig('docker-compose.yml', parallel_env_limit=1),
                'dev': ComposeConfig('docker-compose.yml:docker-compose.dev.yml', parallel_env_limit=1),
            }

How To Start Contributing

Run e2e tests

cd tests
make watch  # separate terminal to watch for changes
make e2e-run

# verbose output 
make e2e-run args='-vvv'

# specific test
make e2e-run args='scenarios/api/up_env_with_custom_services_set_enviroment.py -vvv'

Update in-image maxwelld library / rebuild dependencies

make watch -B  # kill & restart existing watcher
# or
make e2e-run -B  # rebuild before test run

Run in-project integrated

Client changes testing (e2e vedro)

Add volume with package

  e2e:
    volumes:
      - /Users/***/repos/maxwelld:/maxwelld

and update in started container

docker-compose exec e2e /venv/bin/python3 -m pip install /maxwelld

Server changes testing

make beta image

make build-image-beta

and change it for ur project

    image: docker.io/***/maxwelld:*.*.*-beta

Metadata

Release files for maxwelld 2.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maxwelld 2.1.5
File Size Uploaded
maxwelld-2.1.5.tar.gz 34.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for maxwelld 2.1.5
File Interpreter ABI Platform
maxwelld-2.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 81.8 kB

Release files / maxwelld-2.1.5.tar.gz

Download URL maxwelld-2.1.5.tar.gz
Size 34.2 kB
Tags Source
SHA-256 checksum
How to use checksums
879110ea020739a30209411a350df52243b5e876ea109a012c34990e887fde17
BLAKE2b-256 checksum
How to use checksums
4dd56d4492ffd26c35c63e2f92a599c53c07d7a149e8a58713eb781d34044ad1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release files / maxwelld-2.1.5-py3-none-any.whl

Download URL maxwelld-2.1.5-py3-none-any.whl
Size 47.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72e107e63949e488e1f1609742230ef9a0907ebaacf229a65b893ee6b41e1619
BLAKE2b-256 checksum
How to use checksums
c773e78f389898846edd131320a0a6e346d617a7553b249a96709163b487eaa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release history Release notifications | RSS feed

This release

2.1.5 This release

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.1

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.12

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.21

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page