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

Increase test coverage #1719

Open
10 of 46 tasks
wolfgangwalther opened this issue Dec 31, 2020 · 2 comments
Open
10 of 46 tasks

Increase test coverage #1719

wolfgangwalther opened this issue Dec 31, 2020 · 2 comments
Labels
ci Related to CI setup

Comments

@wolfgangwalther
Copy link
Member

wolfgangwalther commented Dec 31, 2020

To be able to properly use coverage overlays (#1713), we need to increase coverage close to 100%. Many of the files are close to that already.

This issue is to track progress across PRs.

TODO:

  • Main
  • UnixSocket
    • Add test to throw when unix socket already exists
  • PostgREST.ApiRequest
    • Add test with empty query param (?key=) (line 171)
    • Add test with + in query string converted to space (line 183)
    • Debug "application/x-www-form-urlencoded" (line 215)
    • Add test for POST with unsupported Content-Type body (line 240)
    • Add test for unsupported request method (line 259)
  • PostgREST.App
    • Make any RPC STABLE (line 112) (should we test for read only transaction somehow?) (Refactor dbStructure.hs #1720)
    • Add tests that throw with POST, PATCH, DELETE (lines 160, 195, 254)
    • Check whether count queries can actually throw (lines 138, 170, 204, 237, 264)
    • Add test to return count on PATCH (line 212)
    • Add OPTIONS request to missing endpoint (line 285)
    • Check whether pdName can be covered in line 292
    • Find out why tablePKCols dbStructure s tn is not covered in line 329
  • PostgREST.Auth
    • Add roleclaimkey tests that try to access objects with arrays presents or vice-versa (line 89)
    • Check whether constructing a JWT with something different from an object as top-level json value can be constructed (line 82)
    • Add test with empty jwt-aud (line 64)
  • PostgREST.Config (Add basic io tests and remove unused code #1717)
    • Add tests for error messages on config errors
  • PostgREST.DbRequestBuilder
    • Understand whats happening here...
  • PostgREST.DbStructure (Refactor dbStructure.hs #1720)
    • Refactor addHasVariadic to in-SQL (line 145)
    • Refactor parseArg to in-SQL to solve TODO and coverage (line 161)
    • Add schema description to fixtures (line 247)
    • Refactor combinations to allow better Pattern Matching in line 404
    • Refactor addViewM2ORels to remove Pattern Matching in line 342
  • PostgREST.Error
  • PostgREST.Middleware (Refactor Middleware.hs #1724)
    • Refactoring
    • Add logging tests
  • PostgREST.OpenAPI
  • PostgREST.Parsers
  • PostgREST.Private.Common
  • PostgREST.Private.ProxyUri
  • PostgREST.Private.QueryFragment
  • PostgREST.QueryBuilder
  • PostgREST.RangeQuery
  • PostgREST.Statements
  • PostgREST.Types
@steve-chavez
Copy link
Member

Noted that we only run coverage on pg 15. This generates some drop for code paths that only run on pg 9.6 and lower, like: https://github.com/PostgREST/postgrest/pull/2843/files#r1248317325

@steve-chavez
Copy link
Member

Show instances added on #2847 dropped the coverage a bit. Related to this need #2627.

Ideally we'd be able to use our doctests to cover those. An alternative could be moving the doctests to unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Related to CI setup
Development

No branches or pull requests

2 participants