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

Road to 100% Coverage #153

Open
25 of 32 tasks
lukewhrit opened this issue Sep 8, 2020 · 2 comments
Open
25 of 32 tasks

Road to 100% Coverage #153

lukewhrit opened this issue Sep 8, 2020 · 2 comments
Assignees
Labels
💥 bug Something isn't working
Milestone

Comments

@lukewhrit
Copy link
Owner

lukewhrit commented Sep 8, 2020

Description

If we ever want Spacebin to be stable and suited for use in production environments, we must ensure builds are reproducible and that code issues are caught before they are pushed to a release. To this end, we want to create unit tests for every aspect of the program that checks and ensures everything works according to the specifications.

This issue contains a list of every part of Spacebin that should be tested, and whether it's currently being tested or not. Our top priority should be the Server (API) functions. We want to make sure that API routes are returning what we want.

Progress

  • Config
    • Loading config
  • Server
    • Config route
    • Create document
      • Creating a document and getting the correct Document in response
      • Creating a document and getting sent to the correct webpage
      • Failing when given bad content
    • Fetch document
      • Fetching a document
      • Fetching a document and getting plain-text
      • Failing on a non-existent document
      • Failing on a bad id
    • Core server
      • Creating a server instance
      • Mounting middleware
      • Registering security headers
      • Mounting static content
      • Mounting route handlers
  • Utility functions
    • Ratelimiter string parser
      • Fail on invalid strings (i.e. too many parts, invalid number syntax, number out of range)
      • Pass on valid strings
    • ID generation
      • Generating a phrase
      • Generating a key
    • Helpers
      • Count lines of a document and convert that into HTML line identifiers
      • Validate body of a create document request
      • Identifying and decoding POST request bodies
      • Writing JSON objects to an HTTP response writer
      • Writing Errors to an HTTP response writer
@lukewhrit lukewhrit added the 💥 bug Something isn't working label Sep 8, 2020
@lukewhrit lukewhrit self-assigned this Sep 8, 2020
@lukewhrit lukewhrit added this to the Alpha v0.1.0 milestone Sep 8, 2020
@lukewhrit lukewhrit modified the milestones: Alpha v0.1.0, Alpha v0.2.0 Sep 29, 2020
@github-actions github-actions bot closed this as completed Dec 7, 2020
@lukewhrit lukewhrit reopened this Dec 7, 2020
@lukewhrit lukewhrit reopened this Dec 15, 2020
@lukewhrit lukewhrit reopened this Dec 23, 2020
@lukewhrit lukewhrit reopened this Dec 31, 2020
@lukewhrit
Copy link
Owner Author

We need a library for mock database interactions in order to implement tests for Fetch/Create endpoints

@lukewhrit lukewhrit removed this from the Alpha v0.2.0 milestone Aug 6, 2023
Repository owner deleted a comment from github-actions bot Aug 7, 2023
@lukewhrit
Copy link
Owner Author

We need to configure codecov to ignore the httplog middleware (util/logger.go) and perhaps the config route handler. As far as I can tell that code cannot error under any reasonable circumstance since it's being encoded from a strictly typed struct.

@lukewhrit lukewhrit changed the title bug: Code isn't tested Road to 100% Coverage Jun 28, 2024
@lukewhrit lukewhrit pinned this issue Jun 28, 2024
@lukewhrit lukewhrit moved this to ☄️ Features in Spacebin Jul 6, 2024
@lukewhrit lukewhrit added this to the v1.0.3 milestone Jul 8, 2024
@lukewhrit lukewhrit moved this from ☄️ Features to ✈️ In Progress in Spacebin Jul 8, 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
Projects
Status: 🐛 Bugs / QOL
Development

No branches or pull requests

1 participant