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

Refactor registration tests, remove hard-coded username validation #3138

Merged
merged 6 commits into from
Nov 22, 2023

Conversation

CicadaCinema
Copy link
Contributor

Pull Request Checklist

  • I have added Go unit tests or Complement integration tests for this PR or I have justified why this PR doesn't need tests
  • I have already signed off privately

This PR is in preparation for #3137 and removes the hard-coded username validation (previously only dependent on forceEmpty).

@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7863a40) 65.71% compared to head (e203b01) 63.91%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3138      +/-   ##
==========================================
- Coverage   65.71%   63.91%   -1.81%     
==========================================
  Files         507      506       -1     
  Lines       57291    57449     +158     
==========================================
- Hits        37651    36717     -934     
- Misses      15830    16895    +1065     
- Partials     3810     3837      +27     
Flag Coverage Δ
unittests 49.51% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CicadaCinema
Copy link
Contributor Author

Are these known flaky tests? On my machine I get:

Are We Synapse Yet?
===================

Non-Spec APIs: 76% (13/17 tests)
--------------
Non-Spec API             :  80% (4/5 tests)
MSCs                     :  78% (7/9 tests)
Unknown API (no group specified):  67% (2/3 tests)

Client-Server APIs: 93% (578/621 tests)
-------------------
Registration             :  91% (31/34 tests)
Login                    :  63% (12/19 tests)
Misc CS APIs             : 100% (1/1 tests)
Profile                  : 100% (6/6 tests)
Devices                  : 100% (12/12 tests)
Presence                 : 100% (15/15 tests)
Create Room              : 100% (13/13 tests)
Sync API                 :  90% (71/79 tests)
Room Membership          : 100% (11/11 tests)
Room State APIs          : 100% (15/15 tests)
Public Room APIs         : 100% (7/7 tests)
Room Aliases             : 100% (15/15 tests)
Joining Rooms            : 100% (8/8 tests)
Leaving Rooms            : 100% (1/1 tests)
Inviting users to Rooms  : 100% (14/14 tests)
Banning users            : 100% (5/5 tests)
Sending events           : 100% (2/2 tests)
Getting events for Rooms : 100% (10/10 tests)
Typing API               : 100% (5/5 tests)
Receipts                 : 100% (2/2 tests)
Read markers             : 100% (1/1 tests)
Media APIs               :  95% (20/21 tests)
Capabilities API         : 100% (2/2 tests)
Logout                   : 100% (4/4 tests)
Push APIs                : 100% (53/53 tests)
Account APIs             : 100% (10/10 tests)
V1 CS APIs               : 100% (1/1 tests)
Ephemeral Events         :   0% (0/1 tests)
Power Levels             : 100% (6/6 tests)
Redaction                : 100% (6/6 tests)
Third-Party ID APIs      :  16% (3/19 tests)
Guest APIs               :  92% (22/24 tests)
Room Auth                : 100% (17/17 tests)
Context APIs             : 100% (4/4 tests)
Room Upgrade APIs        : 100% (21/21 tests)
Room Versions            :  99% (82/83 tests)
Device Keys              :  94% (17/18 tests)
Device Key Backup        : 100% (10/10 tests)
Cross-signing Keys       : 100% (8/8 tests)
Tagging APIs             : 100% (8/8 tests)
OpenID API               : 100% (3/3 tests)
Send-to-Device APIs      : 100% (10/10 tests)
Server Admin API         : 100% (1/1 tests)
Ignore Users             : 100% (3/3 tests)
User Directory APIs      :  70% (7/10 tests)
Enforced canonical JSON  : 100% (3/3 tests)

Federation APIs: 100% (115/115 tests)
----------------
State APIs               : 100% (19/19 tests)
Invite API               : 100% (11/11 tests)
Device Key APIs          : 100% (9/9 tests)
Send-to-Device APIs      : 100% (2/2 tests)
Key API                  : 100% (6/6 tests)
Query API                : 100% (5/5 tests)
send_join API            : 100% (10/10 tests)
make_join API            : 100% (3/3 tests)
Auth                     : 100% (19/19 tests)
room versions            : 100% (7/7 tests)
Federation API           : 100% (13/13 tests)
get_missing_events API   : 100% (3/3 tests)
Backfill API             : 100% (5/5 tests)
send_leave API           : 100% (1/1 tests)
Public Room API          : 100% (2/2 tests)

Application Services APIs: 76% (19/25 tests)
--------------------------
Application Services API :  76% (19/25 tests)

+ exit 0
ubuntu@dendrite-dev:~/dendrite$ git branch
  main
  numeric-username-restriction
* refactor-registration-tests

@kegsay kegsay merged commit f25cce2 into matrix-org:main Nov 22, 2023
20 checks passed
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.

None yet

2 participants