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

feat: server tests #1556

Merged
merged 2 commits into from
Apr 17, 2023
Merged

feat: server tests #1556

merged 2 commits into from
Apr 17, 2023

Conversation

boojack
Copy link
Collaborator

@boojack boojack commented Apr 17, 2023

πŸ€– Generated by Copilot at a85dda0

Summary

πŸ§ͺπŸ“πŸ› οΈ

This pull request adds unit tests for the server API endpoints using a testing server that runs on a random port. It also disables the CSRF protection middleware and exposes the echo.Echo instance of the server for testing purposes. Additionally, it fixes a minor formatting issue in server/jwt.go.

We test the server with our metal code
We send requests to the echo.Echo node
We create, update, and delete the memo
We disable the CSRF, we don't care for the foe

Walkthrough

  • Disable CSRF protection for server endpoints (link)
  • Add unit tests for authentication, memo, and system status server logic (link, link, link)
  • Add GetEcho method to Server struct in server/server.go (link)
  • Remove empty line from package server in server/jwt.go (link)
  • Import net package and use random unused port for testing profile in test/test.go (link, link)

@github-actions
Copy link

github-actions bot commented Apr 17, 2023

Uffizzi Ephemeral Environment deployment-22474

☁️ https://app.uffizzi.com/github.com/usememos/memos/pull/1556

πŸ“„ View Application Logs etc.

What is Uffizzi? Learn more!

@boojack boojack merged commit 994d5dd into main Apr 17, 2023
9 checks passed
@github-actions
Copy link

Uffizzi Preview deployment-22474 was deleted.

@boojack boojack deleted the feat/server-test branch April 25, 2023 15:46
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

1 participant