Closed dstathis closed 1 year ago
@dstathis all is green at localhost
➜ prometheus-scrape-config-k8s-operator git:(upkeep) tox
lint create: /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/.tox/lint
lint installdeps: black, flake8 < 5, flake8-docstrings, flake8-copyright, flake8-builtins, pyproject-flake8, pep8-naming, isort, codespell
lint installed: black==22.8.0,click==8.1.3,codespell==2.2.1,flake8==4.0.1,flake8-builtins==1.5.3,flake8-copyright==0.2.3,flake8-docstrings==1.6.0,isort==5.10.1,mccabe==0.6.1,mypy-extensions==0.4.3,pathspec==0.10.1,pep8-naming==0.13.2,platformdirs==2.5.2,pycodestyle==2.8.0,pydocstyle==6.1.1,pyflakes==2.4.0,pyproject-flake8==4.0.1,snowballstemmer==2.2.0,tomli==2.0.1
lint run-test-pre: PYTHONHASHSEED='1641516975'
lint run-test: commands[0] | codespell . --skip .git --skip .tox --skip build --skip lib --skip venv --skip .mypy_cache --skip '*.svg'
lint run-test: commands[1] | pflake8 /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/src /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/tests
lint run-test: commands[2] | isort --check-only --diff /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/src /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/tests
lint run-test: commands[3] | black --check --diff /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/src /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/tests
All done! ✨ 🍰 ✨
7 files would be left unchanged.
static create: /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/.tox/static
static installdeps: -r/home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/requirements.txt, mypy, types-PyYAML, types-toml
static installed: mypy==0.971,mypy-extensions==0.4.3,ops==1.5.2,PyYAML==6.0,tomli==2.0.1,types-PyYAML==6.0.11,types-toml==0.10.8,typing_extensions==4.3.0
static run-test-pre: PYTHONHASHSEED='1641516975'
static run-test: commands[0] | mypy /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/src
Success: no issues found in 1 source file
unit create: /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/.tox/unit
unit installdeps: pytest, coverage[toml], responses, -r/home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/requirements.txt
unit installed: attrs==22.1.0,certifi==2022.6.15.2,charset-normalizer==2.1.1,coverage==6.4.4,idna==3.4,iniconfig==1.1.1,ops==1.5.2,packaging==21.3,pluggy==1.0.0,py==1.11.0,pyparsing==3.0.9,pytest==7.1.3,PyYAML==6.0,requests==2.28.1,responses==0.21.0,tomli==2.0.1,urllib3==1.26.12
unit run-test-pre: PYTHONHASHSEED='1641516975'
unit run-test: commands[0] | coverage run --source=/home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/src -m pytest -v --tb native --log-cli-level=INFO -s /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/tests/unit
==================================================================== test session starts =====================================================================
platform linux -- Python 3.10.4, pytest-7.1.3, pluggy-1.0.0 -- /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/.tox/unit/bin/python
cachedir: .tox/unit/.pytest_cache
rootdir: /home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator, configfile: pyproject.toml
collected 10 items
tests/unit/test_charm.py::TestCharm::test_alert_rules PASSED
tests/unit/test_charm.py::TestCharm::test_alert_rules_no_rules PASSED
tests/unit/test_charm.py::TestCharm::test_change_scrape_interval PASSED
tests/unit/test_charm.py::TestCharm::test_change_scrape_interval_multiple_downstreams PASSED
tests/unit/test_charm.py::TestCharm::test_change_scrape_interval_multiple_upstreams PASSED
tests/unit/test_charm.py::TestCharm::test_no_downstreams PASSED
tests/unit/test_charm.py::TestCharm::test_no_upstreams PASSED
tests/unit/test_charm.py::TestCharm::test_unused_unit_sets_waiting_status_by_default PASSED
tests/unit/test_charm.py::TestCharm::test_unused_unit_sets_waiting_status_on_consumer_joined PASSED
tests/unit/test_charm.py::TestCharm::test_unused_unit_sets_waiting_status_on_provider_joined PASSED
====================================================================== warnings summary ======================================================================
.tox/unit/lib/python3.10/site-packages/_pytest/config/__init__.py:1253
/home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/.tox/unit/lib/python3.10/site-packages/_pytest/config/__init__.py:1253: PytestConfigWarning: Unknown config option: asyncio_mode
self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")
tests/unit/test_charm.py: 10 warnings
/home/jose/trabajos/canonical/repos/prometheus-scrape-config-k8s-operator/.tox/unit/lib/python3.10/site-packages/ops/testing.py:132: UserWarning: Please set ops.testing.SIMULATE_CAN_CONNECT=True.See https://juju.is/docs/sdk/testing#heading--simulate-can-connect for details.
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================== 10 passed, 11 warnings in 0.18s ===============================================================
unit run-test: commands[1] | coverage report
Name Stmts Miss Branch BrPart Cover Missing
----------------------------------------------------------
src/charm.py 84 12 26 3 83% 112-120, 168-169, 172-173, 216
----------------------------------------------------------
TOTAL 84 12 26 3 83%
__________________________________________________________________________ summary ___________________________________________________________________________
lint: commands succeeded
static: commands succeeded
unit: commands succeeded
congratulations :)
Issue
General upkeep.
Solution
Set workload version to "n/a" there is no workload container. Consolidate CI.
Testing Instructions
Deploy and check workload version is set to "n/a".
Release Notes
prometheus-scrape-config-k8s now sets the workload version