Commit Graph

164 Commits

Author SHA1 Message Date
David Dworken
5ea4fef6f6
Add tests for fix for #238 2024-08-29 22:53:50 -07:00
David Dworken
c93fcbb8e2
Add make fmt to pre-commit 2024-08-11 12:26:09 -07:00
Pavel Griaznov
8da11eb3fa
run "make fmt" (#233) 2024-08-11 12:19:41 -07:00
David Dworken
f64f97095f
Add ability for the client to configure the model via an environment variable 2024-08-11 12:15:44 -07:00
Pavel Griaznov
231197f27a
ai: add some new env variables to control OpenAI requests (#231)
Co-authored-by: David Dworken <david@daviddworken.com>
2024-08-11 11:57:27 -07:00
Pavel Griaznov
a0dc68306b
use http.DefaultClient (#232) 2024-08-11 11:20:29 -07:00
David Dworken
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
David Dworken
44b4cc6df6
Backup and restore .zhistory file in tests 2024-04-14 09:57:05 -07:00
David Dworken
6aea2cb4d9
Remove minor version numbers from os versions for golden files for tests 2024-04-03 19:04:49 -07:00
David Dworken
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
David Dworken
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
David Dworken
ae14d5dd7a
Add explicit handling for 429 error code from OpenAI 2024-02-06 20:02:09 -08:00
David Dworken
4b93240948
Log OpenAI error to debug log for #167 2024-02-05 21:34:03 -08:00
David Dworken
80454d3859
Add more debugging info when OpenAI API returns zero responses for #167 2024-02-04 17:32:20 -08:00
David Dworken
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
David Dworken
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
David Dworken
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
David Dworken
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
David Dworken
3ce76d154a
Add timestamp to testlog 2023-12-20 19:41:00 -08:00
David Dworken
9b5a09f85e
Fix incorrect argument order 2023-12-19 20:51:02 -08:00
David Dworken
8fd809fdc8 Improve AI suggestions by specifying shell name and OS in OpenAI query 2023-12-19 20:50:29 -08:00
David Dworken
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
David Dworken
7272ca8448
Delete data from backend when uninstalling, fixes #132 (#143) 2023-12-10 09:15:11 -08:00
David Dworken
8419a883b4
Normalize hostnames in goldens so that golden files work well for local tests too 2023-12-09 15:12:40 -08:00
David Dworken
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
David Dworken
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
David Dworken
b928ff642f
Add additional error checking for server startup 2023-11-22 20:47:40 -08:00
David Dworken
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
David Dworken
c52dbebb1b
Consolidate TODOs 2023-11-12 05:04:55 -08:00
David Dworken
034c317d74
Update prompt to discourage adding formatting 2023-11-12 04:54:37 -08:00
David Dworken
1a450c0817 Add basic sanity test to confirm that our interactions with the OpenAI API are correct 2023-11-12 02:57:23 -08:00
David Dworken
6962233e1e Better log messages and error messages 2023-11-12 02:57:23 -08:00
David Dworken
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
David Dworken
b0f3107da2 Add basic test for AI queries 2023-11-12 02:57:23 -08:00
David Dworken
0ea3ce2399 Add basic debouncing for AI integration + implement AI suggestions via hishtory API endpoint 2023-11-12 02:57:23 -08:00
David Dworken
eb835fe52c Add initial version of AI searching, but with a broken implementation of debouncing 2023-11-12 02:57:23 -08:00
David Dworken
390f37f20c
Update testTui tests to run with online and offline installs 2023-10-25 20:44:26 -07:00
David Dworken
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
David Dworken
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
David Dworken
56f54f0f65
Better output formatting for server failures 2023-10-15 12:48:05 -07:00
David Dworken
6fb6498515
Make deletion request processing happen in parallel to speed up query endpoint 2023-10-14 17:21:00 -07:00
David Dworken
f0dbcd6e3b
Add more thorough tests for updates 2023-10-09 21:41:30 -07:00
David Dworken
d2788a9f31
Swap interface{} to any 2023-10-07 15:11:49 -07:00
David Dworken
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
David Dworken
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
David Dworken
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
David Dworken
7e33e942e6
Delete no longer used function 2023-09-28 22:14:35 -07:00
David Dworken
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
David Dworken
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
David Dworken
0c202e4130
Delete no longer used function 2023-09-24 18:09:41 -07:00