Skip to content
Snippets Groups Projects
Select Git revision
  • c6be6366d6411d7b0b53fd8879537a33fefd5a88
  • main default protected
  • 75389691-a67c-422a-91e9-aa58bfb5-main-patch-32205
  • test-pipe
  • extended-scripts
  • structured-badges
  • guix-pipeline
  • cabal-pipeline
8 results

Properties.hs

Blame
  • tox.ini 1.92 KiB
    [tox]
    requires =
        tox>=4
    env_list = py-lint, py-format, html-lint, html-format, migrations, django-test, coverage-report
    work_dir = .tools/tox
    
    [hub]
    setenv=
        ALLOWED_HOSTS={env:ALLOWED_HOSTS}
        DATABASE_URL={env:DATABASE_URL}
        DJANGO_DEBUG=I_KNOW_WHAT_I_AM_DOING
        DJANGO_SETTINGS_MODULE=hub.settings.test
        DISABLE_REQUEST_LOGGING=True
        SERVE_API=True
        SERVE_BACKOFFICE=True
        SERVE_FRONTEND=True
        SSO_SECRET_GENERATE=True
        STORAGE_TYPE=local
        USE_PLAIN_STATICFILES=True
        METRICS_SERVER_IPS="127.0.0.1,localhost"
    
    [testenv]
    skip_install = true
    
    [testenv:py-lint]
    groups = lint
    commands = ruff check .
    
    [testenv:py-format]
    groups = lint
    commands = ruff format . --diff
    
    [testenv:html-lint]
    groups = lint
    commands =
        djlint --profile jinja -e j2 --lint .
        djlint --profile django -e html --lint .
    
    [testenv:html-format]
    groups = lint
    commands =
        djlint --profile jinja -e j2 --reformat .
        djlint --profile django -e html --reformat .
    
    [testenv:migrations]
    groups = dev
    change_dir = {toxinidir}/src
    setenv =
        {[hub]setenv}
    allowlist_externals =
        ./manage.py
    commands =
        ./manage.py makemigrations --dry-run
        ./manage.py makemigrations --check
    
    [testenv:django-test]
    groups = dev
    change_dir = {toxinidir}/src
    setenv =
        {[hub]setenv}
        PYTHONWARNINGS=always
    commands =
        coverage run ./manage.py test -v 2 {posargs}
    
    [testenv:live-test]
    groups = dev
    change_dir = {toxinidir}
    setenv =
        {[hub]setenv}
        PYTHONWARNINGS=always
        SERVE_API=yes
    commands =
        python -m unittest {posargs}
    
    [testenv:coverage-report]
    deps = coverage
    commands =
        coverage report
        coverage xml
        coverage html
    
    [coverage:run]
    data_file = .tools/coverage/coverage
    dynamic_context = test_function
    omit =
        */migrations/*
    branch=true
    
    [coverage:report]
    show_missing=true
    
    [coverage:paths]
    src=
        src/
        /app/
    
    [coverage:xml]
    output = .tools/coverage/coverage.xml
    
    [coverage:html]
    directory = .tools/coverage/html