Title: Change the bulk of our tests to "true" unit tests, and kill the fake database · Issue #2476 · coder/coder · GitHub
Open Graph Title: Change the bulk of our tests to "true" unit tests, and kill the fake database · Issue #2476 · coder/coder
X Title: Change the bulk of our tests to "true" unit tests, and kill the fake database · Issue #2476 · coder/coder
Description: Problem Now that we have embedded postgres, the fake database is not needed for quick local environments, and the main purpose is testing. However, we have to do some nasty stuff, (#2473) to keep it working, and because it is not postgre...
Open Graph Description: Problem Now that we have embedded postgres, the fake database is not needed for quick local environments, and the main purpose is testing. However, we have to do some nasty stuff, (#2473) to keep i...
X Description: Problem Now that we have embedded postgres, the fake database is not needed for quick local environments, and the main purpose is testing. However, we have to do some nasty stuff, (#2473) to keep i...
Opengraph URL: https://github.com/coder/coder/issues/2476
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Change the bulk of our tests to \"true\" unit tests, and kill the fake database","articleBody":"## Problem\r\n\r\nNow that we have embedded postgres, the fake database is not needed for quick local environments, and the main purpose is testing.\r\n\r\nHowever, we have to do some nasty stuff, (#2473) to keep it working, and _because_ it is not postgres, it can lead us into a false sense of security about whether our code actually works.\r\n\r\nBut, we do need a suite of tests that run fast, and our postgres tests are slow.\r\n\r\nCLI tests, by and large, shouldn't be calling the server at all, and instead be mocking out the codersdk. That will make them simpler (because you don't need a bunch of preamble to get the DB into the state you want), and super fast. It will also make is easier to test things other than the happy path like errors.\r\n\r\nCoderd tests can and should mock out the database interface for most cases, for the same reasons.\r\n\r\nWe still will want a couple integration tests that go all the way from the CLI -> API -> Database, but there will only be a few and we could use postgres for that.\r\n\r\nOnce we're in that state, we could consider killing the fake database.","author":{"url":"https://github.com/spikecurtis","@type":"Person","name":"spikecurtis"},"datePublished":"2022-06-17T18:17:02Z","url":"https://github.com/coder/coder/issues/2476"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d45827ed-49a4-b06a-0e44-027938de993e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A1AA:26ECEB:28D9892:33EBEBD:6B018C36 |
| html-safe-nonce | 287abb4a6215375f1863e017b6da53f028cf43ad654773a4d7f04deb18e890dd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMUFBOjI2RUNFQjoyOEQ5ODkyOjMzRUJFQkQ6NkIwMThDMzYiLCJ2aXNpdG9yX2lkIjoiMjE1NjM5NjE0OTMxNjA5NTAzMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 23dba7a23463c95ac751c487f874a7397889aedc301e13a910a037f424955eef |
| hovercard-subject-tag | issue:1275335970 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/2476/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f71d241d7986050012fb2bc4daedf0477edf388c8814c012c63da355b4a81387/coder/coder/issues/2476 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f71d241d7986050012fb2bc4daedf0477edf388c8814c012c63da355b4a81387/coder/coder/issues/2476 |
| og:image:alt | Problem Now that we have embedded postgres, the fake database is not needed for quick local environments, and the main purpose is testing. However, we have to do some nasty stuff, (#2473) to keep i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | spikecurtis |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width