Commit Graph

158 Commits

Author SHA1 Message Date
7ebb693cdb Fix double-syncing error where devices receive entries from themselves #202 (#204)
* Fix double-syncing error where devices receive entries from themselves

* Fix incorrect error message

* Add TODO

* Update TestESubmitThenQuery after making query more efficient

* Update TestDeletionRequests and remove unnecessary asserts

* Swap server_test.go to using require

* Fix incorrect require due to typo
2024-04-14 22:53:28 -07:00
44b4cc6df6 Backup and restore .zhistory file in tests 2024-04-14 09:57:05 -07:00
6aea2cb4d9 Remove minor version numbers from os versions for golden files for tests 2024-04-03 19:04:49 -07:00
6065068f9b Enable colored golden tests for linux (#184)
* Enable golden tests for linux and ensure all goldens get saved as outputs

* Swap in OS specific goldens

* Update colored goldens to take into account OS version, since different macos versions have different behavior here

* Update goldens

* Re-enable golden tests

* Add missing golden

* Empty commit

* Remove linux kernel version from OS name
2024-03-28 08:03:04 -07:00
21b401bc14 Add ability to configure custom OpenAI API endpoint for #186 (#194)
* Add ability to configure custom OpenAI API endpoint for #186

* Ensure the AiCompletionEndpoint field is always initialized
2024-03-26 22:13:57 -07:00
ae14d5dd7a Add explicit handling for 429 error code from OpenAI 2024-02-06 20:02:09 -08:00
4b93240948 Log OpenAI error to debug log for #167 2024-02-05 21:34:03 -08:00
80454d3859 Add more debugging info when OpenAI API returns zero responses for #167 2024-02-04 17:32:20 -08:00
17b158d4b3 Swap to checking golden usage post-tests so that it covers all golden usages, and not just per-package 2023-12-22 08:04:10 -08:00
e5764c6f07 Update AssertAllGoldensUsed to use an allowlist of goldens that may not be referenced in GH actions 2023-12-22 06:51:21 -08:00
9f5453f710 Fix issue where we paniced because the colored TUI test goldens weren't used on linux 2023-12-21 18:31:29 -08:00
88f1c0168e Move test goldens to testdata/ directory to be more idiomatic, and add assertion that they're all actively being used by the tests (#154)
* Move golden files to testdata dir

* Add assertion that requires that all goldens are used

* Add map init so the map is non-nil

* Add print to confirm that tests finished running

* Remove colon so that this doesn't match against gotestsum looking for the substring "panic:", which can happen depending on how stdout is buffer

* Revert "Remove colon so that this doesn't match against gotestsum looking for the substring "panic:", which can happen depending on how stdout is buffer"

This reverts commit b44e53a17b.
2023-12-21 17:06:46 -08:00
3ce76d154a Add timestamp to testlog 2023-12-20 19:41:00 -08:00
9b5a09f85e Fix incorrect argument order 2023-12-19 20:51:02 -08:00
8fd809fdc8 Improve AI suggestions by specifying shell name and OS in OpenAI query 2023-12-19 20:50:29 -08:00
3a01e47701 Refactor: Move UsageData and Device to the backend/server directory since they are purely server-side constructs 2023-12-10 10:32:04 -08:00
7272ca8448 Delete data from backend when uninstalling, fixes #132 (#143) 2023-12-10 09:15:11 -08:00
8419a883b4 Normalize hostnames in goldens so that golden files work well for local tests too 2023-12-09 15:12:40 -08:00
acdcd9569a Fix error checking so that if /tmp/test-goldens/ exists, then we don't error out 2023-12-03 16:58:31 -08:00
bdaf0f8a65 Make TUI always take exactly the full width of the terminal through more precise calculations of the overhead used for the table (#136)
* Make TUI always take exactly the full width of the terminal through more precise calculations of the overhead used for the table

* Update TUI goldens for more accurate TUI sizing

* More golden updates for wider table sizing

* Include failed test goldens as artifacts for easier test fixing on github actions
2023-12-03 13:15:38 -08:00
b928ff642f Add additional error checking for server startup 2023-11-22 20:47:40 -08:00
0c2774ec15 Change deletion request code to not filter on DeviceId since the two device ID fields are not actually the same (see the newly added comment) 2023-11-22 20:44:57 -08:00
c52dbebb1b Consolidate TODOs 2023-11-12 05:04:55 -08:00
034c317d74 Update prompt to discourage adding formatting 2023-11-12 04:54:37 -08:00
1a450c0817 Add basic sanity test to confirm that our interactions with the OpenAI API are correct 2023-11-12 02:57:23 -08:00
6962233e1e Better log messages and error messages 2023-11-12 02:57:23 -08:00
afe1a38a0e Fix 2d63263b79 by applying the override on the backend rather than in the client-side variable that isn't actually being referenced 2023-11-12 02:57:23 -08:00
b0f3107da2 Add basic test for AI queries 2023-11-12 02:57:23 -08:00
0ea3ce2399 Add basic debouncing for AI integration + implement AI suggestions via hishtory API endpoint 2023-11-12 02:57:23 -08:00
eb835fe52c Add initial version of AI searching, but with a broken implementation of debouncing 2023-11-12 02:57:23 -08:00
390f37f20c Update testTui tests to run with online and offline installs 2023-10-25 20:44:26 -07:00
9433bd6e94 Refactor offline simulation tests so that they reliably set the env variable before ever starting the shell, since we need the env variable to also apply to presaving 2023-10-22 11:28:41 -07:00
f3727dbeff Wire through a flag so that we can track when installations come from tests, and delete those from the DB more aggressively 2023-10-15 13:09:48 -07:00
56f54f0f65 Better output formatting for server failures 2023-10-15 12:48:05 -07:00
6fb6498515 Make deletion request processing happen in parallel to speed up query endpoint 2023-10-14 17:21:00 -07:00
f0dbcd6e3b Add more thorough tests for updates 2023-10-09 21:41:30 -07:00
d2788a9f31 Swap interface{} to any 2023-10-07 15:11:49 -07:00
d33bd6a046 Improve history import performance so that we can import 100k entries in ~6 seconds (down from ~20 seconds) 2023-10-02 22:27:24 -07:00
0b57034c39 Revert "Revert all commits since v0.223 to enable me to release a patch on top of v0.223"
This reverts commit 68ed9f2d5d.
2023-09-29 18:21:23 -07:00
68ed9f2d5d Revert all commits since v0.223 to enable me to release a patch on top of v0.223 2023-09-28 22:15:30 -07:00
7e33e942e6 Delete no longer used function 2023-09-28 22:14:35 -07:00
9fda54d4c2 Remove testutils.Check(t, err) and replace it with require.NoError which gives a clearer error message and a full stacktrace 2023-09-28 22:13:27 -07:00
6d5a86a8bb Revert all commits since v0.223 to enable me to release a patch on top of v0.223 2023-09-28 21:49:37 -07:00
0c202e4130 Delete no longer used function 2023-09-24 18:09:41 -07:00
5121df5a8c Remove testutils.Check(t, err) and replace it with require.NoError which gives a clearer error message and a full stacktrace 2023-09-24 16:05:01 -07:00
cc11916f3c Create func to automatically create DB indexes rather than just documenting them in a comment that has to be manually executed 2023-09-22 19:11:43 -07:00
51f2c15f35 Add index for deletion requests now that the volume of deletion requests will increase 2023-09-22 19:01:27 -07:00
1d878195b2 Rework ff98a7907c to use the newly added EntryId column rather than deleting based on the start time 2023-09-22 14:03:41 -07:00
9b847c5e35 Further optimize client-server roundtrips by including deletion and dump requests in submit responses (follow up to 1e43de689f) 2023-09-22 13:49:29 -07:00
a5f11af150 Add initial code to support unique per-entry IDs
This code has two caveats for old entries:
1. the ID is being backfiled with a random per-(device,entry) ID. So the ID won't match cross-device.
2. the server-side ID will still be a random ID that is unrelated to the entry ID
2023-09-22 13:16:24 -07:00