Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ideas about smoke tests #10

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft

Conversation

javierdelapuente
Copy link
Collaborator

Applicable spec:

Overview

Rationale

Juju Events Changes

Module Changes

Library Changes

Checklist

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 217 files.

Valid Invalid Ignored Fixed
129 15 73 0
Click to see the invalid file list
  • spread.yaml
  • tests/spread/general/django/django_hello_world/django_hello_world/init.py
  • tests/spread/general/django/django_hello_world/django_hello_world/asgi.py
  • tests/spread/general/django/django_hello_world/django_hello_world/settings.py
  • tests/spread/general/django/django_hello_world/django_hello_world/urls.py
  • tests/spread/general/django/django_hello_world/django_hello_world/wsgi.py
  • tests/spread/general/django/django_hello_world/manage.py
  • tests/spread/general/django/task.yaml
  • tests/spread/general/fastapi/app.py
  • tests/spread/general/fastapi/task.yaml
  • tests/spread/general/flask/app.py
  • tests/spread/general/flask/task.yaml
  • tests/spread/general/go/go.mod
  • tests/spread/general/go/main.go
  • tests/spread/general/go/task.yaml
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 216 files.

Valid Invalid Ignored Fixed
129 15 72 0
Click to see the invalid file list
  • spread.yaml
  • tests/spread/general/django/django_hello_world/django_hello_world/init.py
  • tests/spread/general/django/django_hello_world/django_hello_world/asgi.py
  • tests/spread/general/django/django_hello_world/django_hello_world/settings.py
  • tests/spread/general/django/django_hello_world/django_hello_world/urls.py
  • tests/spread/general/django/django_hello_world/django_hello_world/wsgi.py
  • tests/spread/general/django/django_hello_world/manage.py
  • tests/spread/general/django/task.yaml
  • tests/spread/general/fastapi/app.py
  • tests/spread/general/fastapi/task.yaml
  • tests/spread/general/flask/app.py
  • tests/spread/general/flask/task.yaml
  • tests/spread/general/go/go.mod
  • tests/spread/general/go/main.go
  • tests/spread/general/go/task.yaml
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 216 files.

Valid Invalid Ignored Fixed
129 15 72 0
Click to see the invalid file list
  • spread.yaml
  • tests/spread/general/django/django_hello_world/django_hello_world/init.py
  • tests/spread/general/django/django_hello_world/django_hello_world/asgi.py
  • tests/spread/general/django/django_hello_world/django_hello_world/settings.py
  • tests/spread/general/django/django_hello_world/django_hello_world/urls.py
  • tests/spread/general/django/django_hello_world/django_hello_world/wsgi.py
  • tests/spread/general/django/django_hello_world/manage.py
  • tests/spread/general/django/task.yaml
  • tests/spread/general/fastapi/app.py
  • tests/spread/general/fastapi/task.yaml
  • tests/spread/general/flask/app.py
  • tests/spread/general/flask/task.yaml
  • tests/spread/general/go/go.mod
  • tests/spread/general/go/main.go
  • tests/spread/general/go/task.yaml
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 216 files.

Valid Invalid Ignored Fixed
129 15 72 0
Click to see the invalid file list
  • spread.yaml
  • tests/spread/general/django/django_hello_world/django_hello_world/init.py
  • tests/spread/general/django/django_hello_world/django_hello_world/asgi.py
  • tests/spread/general/django/django_hello_world/django_hello_world/settings.py
  • tests/spread/general/django/django_hello_world/django_hello_world/urls.py
  • tests/spread/general/django/django_hello_world/django_hello_world/wsgi.py
  • tests/spread/general/django/django_hello_world/manage.py
  • tests/spread/general/django/task.yaml
  • tests/spread/general/fastapi/app.py
  • tests/spread/general/fastapi/task.yaml
  • tests/spread/general/flask/app.py
  • tests/spread/general/flask/task.yaml
  • tests/spread/general/go/go.mod
  • tests/spread/general/go/main.go
  • tests/spread/general/go/task.yaml
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 216 files.

Valid Invalid Ignored Fixed
129 15 72 0
Click to see the invalid file list
  • spread.yaml
  • tests/spread/general/django/django_hello_world/django_hello_world/init.py
  • tests/spread/general/django/django_hello_world/django_hello_world/asgi.py
  • tests/spread/general/django/django_hello_world/django_hello_world/settings.py
  • tests/spread/general/django/django_hello_world/django_hello_world/urls.py
  • tests/spread/general/django/django_hello_world/django_hello_world/wsgi.py
  • tests/spread/general/django/django_hello_world/manage.py
  • tests/spread/general/django/task.yaml
  • tests/spread/general/fastapi/app.py
  • tests/spread/general/fastapi/task.yaml
  • tests/spread/general/flask/app.py
  • tests/spread/general/flask/task.yaml
  • tests/spread/general/go/go.mod
  • tests/spread/general/go/main.go
  • tests/spread/general/go/task.yaml
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 219 files.

Valid Invalid Ignored Fixed
129 18 72 0
Click to see the invalid file list
  • spread.yaml
  • tests/spread/general/django/django_hello_world/django_hello_world/init.py
  • tests/spread/general/django/django_hello_world/django_hello_world/asgi.py
  • tests/spread/general/django/django_hello_world/django_hello_world/settings.py
  • tests/spread/general/django/django_hello_world/django_hello_world/urls.py
  • tests/spread/general/django/django_hello_world/django_hello_world/wsgi.py
  • tests/spread/general/django/django_hello_world/manage.py
  • tests/spread/general/django/task.yaml
  • tests/spread/general/fastapi/app.py
  • tests/spread/general/fastapi/task.yaml
  • tests/spread/general/flask/app.py
  • tests/spread/general/flask/task.yaml
  • tests/spread/general/go/go.mod
  • tests/spread/general/go/main.go
  • tests/spread/general/go/task.yaml
  • tests/spread/lib/cloud-config.yaml
  • tests/spread/lib/test-helpers.sh
  • tests/spread/lib/tools/retry
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 219 files.

Valid Invalid Ignored Fixed
129 18 72 0
Click to see the invalid file list
  • spread.yaml
  • tests/spread/general/django/django_hello_world/django_hello_world/init.py
  • tests/spread/general/django/django_hello_world/django_hello_world/asgi.py
  • tests/spread/general/django/django_hello_world/django_hello_world/settings.py
  • tests/spread/general/django/django_hello_world/django_hello_world/urls.py
  • tests/spread/general/django/django_hello_world/django_hello_world/wsgi.py
  • tests/spread/general/django/django_hello_world/manage.py
  • tests/spread/general/django/task.yaml
  • tests/spread/general/fastapi/app.py
  • tests/spread/general/fastapi/task.yaml
  • tests/spread/general/flask/app.py
  • tests/spread/general/flask/task.yaml
  • tests/spread/general/go/go.mod
  • tests/spread/general/go/main.go
  • tests/spread/general/go/task.yaml
  • tests/spread/lib/cloud-config.yaml
  • tests/spread/lib/test-helpers.sh
  • tests/spread/lib/tools/retry
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 219 files.

Valid Invalid Ignored Fixed
129 18 72 0
Click to see the invalid file list
  • spread.yaml
  • tests/spread/general/django/django_hello_world/django_hello_world/init.py
  • tests/spread/general/django/django_hello_world/django_hello_world/asgi.py
  • tests/spread/general/django/django_hello_world/django_hello_world/settings.py
  • tests/spread/general/django/django_hello_world/django_hello_world/urls.py
  • tests/spread/general/django/django_hello_world/django_hello_world/wsgi.py
  • tests/spread/general/django/django_hello_world/manage.py
  • tests/spread/general/django/task.yaml
  • tests/spread/general/fastapi/app.py
  • tests/spread/general/fastapi/task.yaml
  • tests/spread/general/flask/app.py
  • tests/spread/general/flask/task.yaml
  • tests/spread/general/go/go.mod
  • tests/spread/general/go/main.go
  • tests/spread/general/go/task.yaml
  • tests/spread/lib/cloud-config.yaml
  • tests/spread/lib/test-helpers.sh
  • tests/spread/lib/tools/retry
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 219 files.

Valid Invalid Ignored Fixed
129 18 72 0
Click to see the invalid file list
  • spread.yaml
  • tests/spread/general/django/django_hello_world/django_hello_world/init.py
  • tests/spread/general/django/django_hello_world/django_hello_world/asgi.py
  • tests/spread/general/django/django_hello_world/django_hello_world/settings.py
  • tests/spread/general/django/django_hello_world/django_hello_world/urls.py
  • tests/spread/general/django/django_hello_world/django_hello_world/wsgi.py
  • tests/spread/general/django/django_hello_world/manage.py
  • tests/spread/general/django/task.yaml
  • tests/spread/general/fastapi/app.py
  • tests/spread/general/fastapi/task.yaml
  • tests/spread/general/flask/app.py
  • tests/spread/general/flask/task.yaml
  • tests/spread/general/go/go.mod
  • tests/spread/general/go/main.go
  • tests/spread/general/go/task.yaml
  • tests/spread/lib/cloud-config.yaml
  • tests/spread/lib/test-helpers.sh
  • tests/spread/lib/tools/retry
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 219 files.

Valid Invalid Ignored Fixed
129 1 89 0
Click to see the invalid file list
  • spread.yaml
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

@canonical canonical deleted a comment from github-actions bot Oct 21, 2024
Copy link
Contributor

Unit tests failed for 06db70a

```

============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-8.3.3, pluggy-1.5.0 -- /home/ubuntu/actions-runner/_work/paas-charm/paas-charm/.tox/unit/bin/python
cachedir: .tox/unit/.pytest_cache
rootdir: /home/ubuntu/actions-runner/_work/paas-charm/paas-charm
configfile: pyproject.toml
plugins: anyio-4.6.2.post1
collecting ... collected 85 items / 1 error

==================================== ERRORS ====================================
____ ERROR collecting tests/spread/scenario/smoke/tests/unit/test_charm.py _____
ImportError while importing test module '/home/ubuntu/actions-runner/_work/paas-charm/paas-charm/tests/spread/scenario/smoke/tests/unit/test_charm.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.10/importlib/init.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/spread/scenario/smoke/tests/unit/test_charm.py:7: in
import scenario
E ModuleNotFoundError: No module named 'scenario'
=============================== warnings summary ===============================
examples/flask/lib/charms/traefik_k8s/v2/ingress.py:255
/home/ubuntu/actions-runner/_work/paas-charm/paas-charm/examples/flask/lib/charms/traefik_k8s/v2/ingress.py:255: PydanticDeprecatedSince20: Pydantic V1 style @validator validators are deprecated. You should migrate to Pydantic V2 style @field_validator validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.9/migration/
@validator("scheme", pre=True)

examples/flask/lib/charms/traefik_k8s/v2/ingress.py:262
/home/ubuntu/actions-runner/_work/paas-charm/paas-charm/examples/flask/lib/charms/traefik_k8s/v2/ingress.py:262: PydanticDeprecatedSince20: Pydantic V1 style @validator validators are deprecated. You should migrate to Pydantic V2 style @field_validator validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.9/migration/
@validator("port", pre=True)

examples/flask/lib/charms/traefik_k8s/v2/ingress.py:280
/home/ubuntu/actions-runner/_work/paas-charm/paas-charm/examples/flask/lib/charms/traefik_k8s/v2/ingress.py:280: PydanticDeprecatedSince20: Pydantic V1 style @validator validators are deprecated. You should migrate to Pydantic V2 style @field_validator validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.9/migration/
@validator("host", pre=True)

examples/flask/lib/charms/traefik_k8s/v2/ingress.py:286
/home/ubuntu/actions-runner/_work/paas-charm/paas-charm/examples/flask/lib/charms/traefik_k8s/v2/ingress.py:286: PydanticDeprecatedSince20: Pydantic V1 style @validator validators are deprecated. You should migrate to Pydantic V2 style @field_validator validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.9/migration/
@validator("ip", pre=True)

src/paas_charm/charm_state.py:331
/home/ubuntu/actions-runner/_work/paas-charm/paas-charm/src/paas_charm/charm_state.py:331: PydanticDeprecatedSince20: pydantic.config.Extra is deprecated, use literal values instead (e.g. extra='allow'). Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.9/migration/
class SamlParameters(BaseModel, extra=Extra.allow):

src/paas_charm/django/charm.py:37
/home/ubuntu/actions-runner/_work/paas-charm/paas-charm/src/paas_charm/django/charm.py:37: PydanticDeprecatedSince20: Pydantic V1 style @validator validators are deprecated. You should migrate to Pydantic V2 style @field_validator validators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.9/migration/
@validator("allowed_hosts")

tests/unit/test_deprecated.py:6
/home/ubuntu/actions-runner/_work/paas-charm/paas-charm/tests/unit/test_deprecated.py:6: DeprecationWarning: paas_app_charmer package is deprecated
import paas_app_charmer.django

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
ERROR tests/spread/scenario/smoke/tests/unit/test_charm.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
========================= 7 warnings, 1 error in 0.72s =========================

Copy link
Contributor

Test coverage for 06db70a

Name                                          Stmts   Miss Branch BrPart  Cover   Missing
-----------------------------------------------------------------------------------------
src/paas_app_charmer/__init__.py                  2      0      0      0   100%
src/paas_app_charmer/django/__init__.py           2      0      0      0   100%
src/paas_app_charmer/django/charm.py              2      0      0      0   100%
src/paas_app_charmer/fastapi/__init__.py          2      0      0      0   100%
src/paas_app_charmer/fastapi/charm.py             2      0      0      0   100%
src/paas_app_charmer/flask/__init__.py            2      0      0      0   100%
src/paas_app_charmer/flask/charm.py               2      0      0      0   100%
src/paas_app_charmer/go/__init__.py               2      0      0      0   100%
src/paas_app_charmer/go/charm.py                  2      0      0      0   100%
src/paas_charm/__init__.py                       32     17      0      0    47%   13-14, 19-20, 26-27, 33-37, 43-44, 50-51, 57-58
src/paas_charm/_gunicorn/__init__.py              0      0      0      0   100%
src/paas_charm/_gunicorn/charm.py                15      4      0      0    73%   22, 32-40
src/paas_charm/_gunicorn/webserver.py            83     51     14      0    33%   53, 70-74, 100-103, 112-143, 152, 167-199, 203-207
src/paas_charm/_gunicorn/workload_config.py       8      2      0      0    75%   25-26
src/paas_charm/_gunicorn/wsgi_app.py             16      6      0      0    62%   39-47, 51-54
src/paas_charm/app.py                           157    115     54      0    20%   66-67, 95-101, 108-111, 115-118, 136-173, 180-192, 206-230, 242, 255-301, 316-324, 339-343, 357-378
src/paas_charm/charm.py                         242    148     54      0    32%   34-35, 42-43, 80-163, 177-190, 195, 200, 205, 214-222, 227, 235-237, 245-267, 279-300, 308-320, 331, 341-352, 372-374, 379-380, 385, 390, 395, 400, 405, 410, 415, 420, 425, 430, 435, 440, 445, 450, 455, 460, 465, 470, 475
src/paas_charm/charm_state.py                   107     45     12      0    52%   71-77, 111-127, 146-149, 162, 171, 186-188, 197, 248-279, 325-328, 363-366
src/paas_charm/charm_utils.py                    23      7      0      0    70%   58-64
src/paas_charm/database_migration.py             35     17      2      0    49%   46-48, 56, 64, 72, 97-126
src/paas_charm/databases.py                      25     15      6      0    32%   40-58, 70-94
src/paas_charm/django/__init__.py                 2      0      0      0   100%
src/paas_charm/django/charm.py                   50     25      8      0    43%   48-50, 68-69, 77, 88-92, 103-115, 123-140
src/paas_charm/exceptions.py                      5      1      0      0    80%   20
src/paas_charm/fastapi/__init__.py                2      0      0      0   100%
src/paas_charm/fastapi/charm.py                  31      8      0      0    74%   60, 65-68, 91, 99-100
src/paas_charm/flask/__init__.py                  2      0      0      0   100%
src/paas_charm/flask/charm.py                    26      3      0      0    88%   61, 79, 87
src/paas_charm/framework.py                      23     17     12      0    17%   29-50
src/paas_charm/go/__init__.py                     2      0      0      0   100%
src/paas_charm/go/charm.py                       28      8      0      0    71%   52, 57-60, 80, 88-89
src/paas_charm/observability.py                  24     16      4      0    29%   39-87
src/paas_charm/rabbitmq.py                       78     50     22      0    28%   88-105, 112-113, 117-118, 122-123, 127, 132, 143-148, 157-162, 170-188, 196-206, 220-221
src/paas_charm/secret_storage.py                 50     32     14      0    28%   29-33, 50-58, 69-73, 85-90, 104-109, 121, 130-131, 139, 143
src/paas_charm/utils.py                          44     31     14      0    22%   29-38, 47-57, 73-79, 98-105
-----------------------------------------------------------------------------------------
TOTAL                                          1128    618    216      0    38%
Coverage failure: total of 38 is less than fail-under=90

Static code analysis report

Run started:2024-10-22 14:49:33.226761

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 2380
  Total lines skipped (#nosec): 1
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 2

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant