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

DNM - Follow up #341: Add unit test and check if configuration exists before creating it #344

Closed
wants to merge 13 commits into from

Conversation

amandahla
Copy link
Collaborator

@amandahla amandahla commented May 7, 2024

Overview

Note: Not working with IRC enabled. WIP.

This is a follow-up of #341

  • Add unit test
  • Check if Synapse configuration file exists before creating it with the migrate_config command
  • Because of this check, some existing unit tests were changed

Without this check, the configuration is re-created all the time.

Rationale

Improvement.

Juju Events Changes

Module Changes

Library Changes

Checklist

No need to update CH docs.

@amandahla amandahla requested a review from a team as a code owner May 7, 2024 18:52
@amandahla amandahla added trivial bug Something isn't working labels May 7, 2024
arturo-seijas
arturo-seijas previously approved these changes May 8, 2024
@amandahla amandahla changed the title Follow up #341: Add unit test and check if configuration exists before creating it DNM - Follow up #341: Add unit test and check if configuration exists before creating it May 10, 2024
@amandahla amandahla changed the title DNM - Follow up #341: Add unit test and check if configuration exists before creating it Follow up #341: Add unit test and check if configuration exists before creating it May 13, 2024
@amandahla amandahla changed the title Follow up #341: Add unit test and check if configuration exists before creating it DNM - Follow up #341: Add unit test and check if configuration exists before creating it May 16, 2024
Copy link
Contributor

Test coverage for 4d86f9c

Name                            Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------------------------------
src/actions/__init__.py             3      0      0      0   100%
src/actions/register_user.py       22      0      2      0   100%
src/actions/reset_instance.py      21      0      2      0   100%
src/admin_access_token.py          10      0      0      0   100%
src/backup.py                     176      5     24      2    96%   353-354, 423-424, 480->482, 483
src/backup_observer.py            135     16     14      0    89%   132-135, 140-143, 179-182, 211-214
src/charm.py                      288      9     68      7    96%   141->143, 146, 258-259, 286, 293, 373->exit, 391-394, 456-457
src/charm_state.py                110      1     20      1    98%   252
src/charm_types.py                 35      0     10      0   100%
src/database_client.py             58      1     12      4    93%   35, 47->exit, 69->exit, 88->98
src/database_observer.py           50      3      6      1    93%   71-73, 89->91
src/exceptions.py                   4      0      0      0   100%
src/irc_bridge.py                  37      9      6      0    79%   31, 71-86
src/media_observer.py              53      4      4      2    89%   53, 79, 101-102
src/mjolnir.py                     90      1     28      3    97%   82, 86->93, 91->93
src/observability.py               10      0      0      0   100%
src/pebble.py                     234     36     38      9    83%   131-135, 166-167, 179->exit, 190-194, 213-214, 234-235, 306-307, 309-310, 324, 326, 328, 330, 332, 339-342, 390-391, 410-411, 430-431, 617-637
src/redis_observer.py              53      5      6      1    90%   67-70, 90-91
src/s3_parameters.py               23      0      4      0   100%
src/saml_observer.py               45      1      8      0    98%   63
src/smtp_observer.py               70      4     16      2    93%   74-78, 81, 100->105
src/synapse/__init__.py             4      0      0      0   100%
src/synapse/admin.py               20      2      2      0    91%   40-41
src/synapse/api.py                176      3     24      3    97%   176, 229, 402
src/synapse/workload.py           294     30     66     12    88%   299-300, 321-322, 379->381, 396->exit, 400-401, 421-422, 462-463, 499-500, 519-521, 523, 545-546, 601, 617, 664->667, 691-692, 711, 719->721, 721->723, 728-729, 765, 782, 791-792, 811->816, 817
src/user.py                        24      0      4      0   100%
---------------------------------------------------------------------------
TOTAL                            2045    130    364     47    93%

Static code analysis report

Working... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:01
Run started:2024-05-16 08:48:34.620571

Test results:
  No issues identified.

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

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):

@amandahla
Copy link
Collaborator Author

Closing it to be better investigated in ISD-1820

@amandahla amandahla closed this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Libraries: OK trivial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants