Commit Graph

153 Commits

Author SHA1 Message Date
David Dworken
2b115844f4
Improve testutils server runner to persist logs and kill existing servers automatically 2023-09-13 20:23:09 -07:00
Sergio Moura
3c0d3561fb Merge remote-tracking branch 'origin/master' into sergio/db 2023-09-11 10:15:53 -04:00
Sergio Moura
f9ee8ed189 use DateOnly as local constant instead of using the imported time package 2023-09-11 10:15:42 -04:00
David Dworken
2ccbb8d587
Store timestamps in DB in Unix time, and display them in the Local time for consistent TZs in displays, and to ensure ordering is correct
This fixes a bug where entries could be out of order if they were recorded on machines in different TZs (e.g. if one machine had the TZ set to UTC). Admittedly, this commit isn't a perfect fix since
it doesn't change all the existing hishtory entries to be stored in UTC, but this just means that the ordering bug will continue to exist for historical entries, but be fixed for new entries. And
for our purposes, that is good enough. :)

 # Please enter the commit message for your changes. Lines starting
2023-09-09 12:28:01 -07:00
Sergio Moura
382f234c09 remove usage_data related queries from the main package into a database package 2023-09-08 10:58:01 -04:00
David Dworken
25eae144d8
Revert all tmpfs related commits, since running in a tmpfs doesn't seem to meaningfully improve test reliability 2023-09-04 18:03:46 -07:00
David Dworken
9b06e6980a
Revert 2ca6c751d0 and instead have BackupAndRestore keep files on the same mount point 2023-09-02 20:09:22 -07:00
David Dworken
2ca6c751d0
Avoid constantly copying the binary back and forth to make tests faster on github actions 2023-09-02 19:51:43 -07:00
David Dworken
c0f33a3456
Swap from os.Rename to a custom implementation that copies files to support cross-device renames, as needed for making ~/.hishtory/ a tmpfs for tests 2023-09-02 18:50:52 -07:00
David Dworken
ddddff0f1b
Add automatic retries for the TestTui method which is sadly inherently flaky since it is akin to screenshot tests of a terminal 2023-08-29 23:23:21 -07:00
David Dworken
a79d401058
Make queries async for better TUI performance when sqlite is slow 2023-08-27 11:42:17 -07:00
David Dworken
201bedf020
Remove workarounds for half-implemented windows support 2023-05-19 17:16:17 -07:00
David Dworken
27cd544524
Add support for arm7 for #63 to support raspberry pis 2023-02-18 22:00:39 -08:00
David Dworken
413e2e438f
Fix github actions golden paths 2023-02-13 20:49:41 -08:00
David Dworken
a4ae3f83ad
Log goldenPath for golden not found errors 2023-02-13 20:20:45 -08:00
David Dworken
fea151261f
Move goldens func to testutils and use it for some simple horizontal scrolling tests 2023-02-11 09:09:48 -08:00
David Dworken
f8b51e49da
Support customizing HISHTORY_PATH for people who want to install hishtory in an alternate location to fix #54 2022-12-16 22:22:57 -08:00
David Dworken
7c86b812bf
Add support for linux arm64 for #48 2022-12-11 20:39:45 -08:00
David Dworken
857e423e10
Fix linter errors + some general clean up 2022-12-11 20:31:50 -08:00
David Dworken
35444bf56e
Swap ioutil to non-deprecated alternatives + clean up pre-commit errors 2022-11-27 11:59:06 -08:00
David Dworken
c603537137
Optimize the apiSubmit function to ensure that it doesn't lead to errors from large insertions 2022-11-26 10:31:43 -08:00
David Dworken
d4efc62df1
Add client-side code to ask for feedback when uninstalling 2022-11-16 21:54:05 -08:00
David Dworken
86f9d67aff
Fix test failures caused by the cobra install command not respecting the secret key
Also added a persistLog() function so that I can easily inspect the hishtory logs from test runs.
2022-11-16 20:28:25 -08:00
David Dworken
49a1035169
Fix flakey test failures by removing cache=shared which is a discouraged mode (https://www.sqlite.org/sharedcache.html). WAL is sufficient for our purposes. Plus fix a bug where the TUI would go into an infinite loop if there were zero results. 2022-11-15 23:20:19 -08:00
David Dworken
53a417296e
Improve backup and restore env function + fix makefile with quotes + remove the zdotdir created file 2022-11-13 16:53:37 -08:00
David Dworken
cda9c886e1
Introduce a helper method for checking if we're in github actions 2022-11-12 06:46:37 -08:00
David Dworken
ddc9dc1080
Better reset the local state to attempt to fix a github action failure 2022-11-12 06:42:10 -08:00
David Dworken
36ff3d362c
windows: use a temp file rather than hardcoding /tmp/ since that doesn't exist on windows 2022-11-06 17:46:45 -08:00
David Dworken
456513d71e
windows: restore the cd ../ behavior, but for windows 2022-11-06 14:42:01 -08:00
David Dworken
4a9b202e5f
Windows: handle failing to read the VERSION file 2022-11-06 00:17:03 -07:00
David Dworken
6938035715
Windows: handle failing to read the VERSION file 2022-11-06 00:16:14 -07:00
David Dworken
f4925a0999
Windows: Disable killall on windows 2022-11-06 00:02:48 -07:00
David Dworken
c87ae611fb
Just for fun, re-enable tests on github actions 2022-11-05 23:44:01 -07:00
David Dworken
e46221f893
Revert all the windows+freebsd commits since they seem to be hopelessly broken 2022-11-04 23:14:34 -07:00
David Dworken
43cc45b80d
Add workaround for testutils searching for the hishtory dir 2022-11-04 21:50:45 -07:00
David Dworken
d4ca466314
Import initial history from fish too 2022-11-03 22:32:55 -07:00
David Dworken
c1d17842c4
Write the config fragment to the bash_profile for MacOs to fix #14 2022-11-03 21:01:57 -07:00
David Dworken
185d2739c7
Add offline mode for hiSHtory 2022-11-03 13:16:45 -07:00
David Dworken
17ae676da0
Add uninstall command + tests for uninstall 2022-11-02 19:41:49 -07:00
David Dworken
0f9e77223e Chdir so that we have a consistent cwd for github actions 2022-10-29 17:53:40 -07:00
David Dworken
cdc5421a7b Move testutils to a separate package so as to move test-only code out of the main binary 2022-10-27 21:53:47 -07:00
David Dworken
37c36ea5f1 Add docs on the manually created postgres indices 2022-10-23 17:35:30 -07:00
David Dworken
951f5b018f killall hishtory between tests in case that is the cause of the background test failures 2022-10-23 01:03:16 -07:00
David Dworken
abe231f5b0 Initial non-unit tested version of fish support 2022-10-18 19:55:41 -07:00
David Dworken
4e4caef10f Add initial implementation of fuzz testing that fuzzes multiple devices and multiple users 2022-09-22 23:06:28 -07:00
David Dworken
c6d4f1ef68 Fix missing newline in zshrc, add test for hishtory redact prompting, and tag TODOs with plans 2022-09-22 18:22:06 -07:00
David Dworken
41f82e8034 Add ReadCount field to deletion requests so that we can eventually delete them from the DB 2022-09-20 21:13:59 -07:00
David Dworken
5391ecd220 First version of working redaction with passing integration tests 2022-09-19 22:49:48 -07:00
David Dworken
09dfaf00fa mkdir -p but for real 2022-09-18 21:05:51 -07:00
David Dworken
1a74f9792f mkdir -p 2022-09-18 19:20:21 -07:00
David Dworken
0792a5665c Fix incorrect variable reference that lead to failures on github actions 2022-09-18 18:34:27 -07:00
David Dworken
1bf510ff8a Better offline handling, implemented the local portion of delete, and maybe fixed the bug when running tests on github actions 2022-09-18 09:42:24 -07:00
David Dworken
6c6acc5473 Fix another actions only bug + add todo 2022-09-18 09:14:34 -07:00
David Dworken
ff4cd0d9e1 Clean up the testutils BackupAndRestoreWithId method 2022-09-17 23:02:57 -07:00
David Dworken
3bfe88d73e Improve error message + remove code that disabled error checking on github actions 2022-09-17 22:45:07 -07:00
David Dworken
964f79c037 Clean up test code 2022-09-17 21:59:13 -07:00
David Dworken
55f0f97d29 Fix tests for importing so they pass on github actions 2022-09-17 21:56:39 -07:00
David Dworken
e8f001c78b Add basic support for stripping out HISTTIMEFORMAT prefixes 2022-06-12 21:28:19 -07:00
David Dworken
a08465ce6f Skip a debugging test in github actions since it fails there for an unknown reason 2022-05-27 22:15:05 -07:00
David Dworken
c79466c679 Fix OBO to make debug info actually useful 2022-05-27 22:06:20 -07:00
David Dworken
1d8730b0d7 Add more debugging info 2022-05-27 19:00:02 -07:00
David Dworken
1da703e9c2 Working update code for macos 2022-05-26 23:45:08 -07:00
David Dworken
47d13a9c27 Passing the basic dump testss 2022-05-22 19:45:46 -07:00
David Dworken
feaa8b2bd1 Add a DB dump test that passes on zsh (is failing for an unknown reason on bash currently) + fix backup and restore for WAL files + better offline support 2022-05-01 22:37:26 -04:00
David Dworken
cbc4e70605 Integrated client-side with dump requests, haven't written any integration tests yet 2022-04-28 11:46:14 -07:00
David Dworken
46d7e9e013 Tests passing when being run offline, still not integrated with the new API endpoints yet 2022-04-28 11:26:55 -07:00
David Dworken
74caf87eda Add basic xattr implementation (commiting to save it, about to delete most of it) 2022-04-25 21:42:28 -07:00
David Dworken
10ee085d4c Remove unnecessary set -m calls, speed up the local make acttest command, embed ReleaseVersion into the test server to fix the test failures on macos, and update install to be resistant to bashrc and zshrc not existing 2022-04-19 21:05:54 -07:00
David Dworken
aae18d44b9 Working basic zsh integration (with lots of failing tests that are currently getting skipped) 2022-04-17 19:54:17 -07:00
David Dworken
e98783d30f Add server-side code to handle updates for non-linux 2022-04-17 12:02:56 -07:00
David Dworken
735a98a611 Add API endpoint for getting information about the latest hishtory version and download URLs 2022-04-16 16:34:09 -07:00
David Dworken
a436edbd16 Add backend code to delete entries that have already been read + start collecitng data on usage data so we can eventually prune data from users that are no longer using hishtory 2022-04-16 11:37:43 -07:00
David Dworken
c369661e53 More server-side logging + client-side logging 2022-04-16 00:44:47 -07:00
David Dworken
682a063e95 making tests pass on actions by grepping out pipefail which is flakily recorded due to actions not recording line numbers 2022-04-15 18:06:48 -07:00
David Dworken
ab0d9d4c90 optimize test runtime by running a single server instance per-file rather than one per test 2022-04-15 11:20:23 -07:00
David Dworken
b09b725f49 Properly skip recording of commands prefixed with a space to match bash's history behavior 2022-04-15 00:04:49 -07:00
David Dworken
dc6fb6a47b Refactor tests to make them non-flakey and pass on actions
This required adding the ability to have hishtory run synchronously to avoid reconditions. I also added additional waiting code. Also a whole bunch of new tests and disabled gorm's default logger which also caued flakeyness
2022-04-14 20:18:49 -07:00
David Dworken
e2b5fd13bf tests passing inside act, hopefully on real actions 2022-04-13 21:30:27 -07:00
David Dworken
5325fc75ae Add negative conditions to search queries + tests + better error messages by including filename:line in error messages 2022-04-11 22:36:52 -07:00
David Dworken
bf789605d1 record registration ip and date in the server-side DB for usage analytics 2022-04-09 16:37:51 -07:00
David Dworken
9f20074a4f change tests to not hardcode the local path to source on my laptop 2022-04-09 11:55:00 -07:00
David Dworken
57a95fb9a7 Moved all backend code into the backend/ directory 2022-04-08 23:56:02 -07:00
David Dworken
2a083b7d06 add code to auto-update the version tag in the server + tests 2022-04-08 23:47:13 -07:00
David Dworken
f2e6de2eb3 pre-commit + stricter formatting + pre-commit fixes 2022-04-07 21:40:22 -07:00
David Dworken
c2465d7c99 refactored to move no longer shared things out of the shared/ folder 2022-04-07 21:05:58 -07:00
David Dworken
1065fff062 refactoring, better tests, commit hash, banner, and tested working locally 2022-04-06 22:43:07 -07:00
David Dworken
684511f4f7 working update 2022-04-06 18:18:46 -07:00
David Dworken
71fc809f9a tests are passing and getting close now. Need to test the live update flow along with more thorough testing for everything 2022-04-05 23:31:24 -07:00
David Dworken
843bcb32b3 goodbye to the Persist method that was silly 2022-04-04 22:09:14 -07:00
David Dworken
e2acc6612a well, it builds :D but still failing all the tests 2022-04-04 22:07:01 -07:00
David Dworken
a4daa28e26 before refactoring to drop the old 'remote' client 2022-04-03 21:27:32 -07:00
David Dworken
c5eea01a23 device ID is now a random uuid generated by the client 2022-04-03 21:00:46 -07:00
David Dworken
32e74eb3a1 building, before doing the refactor to make device ID just another random ID 2022-04-03 20:55:37 -07:00
David Dworken
2a3887b9ed adapted to have it duplicate entries into per-device entries server-side 2022-04-03 10:08:18 -07:00
David Dworken
0a3d60769c fixed the DB error, was stupid mistake in test-only code 2022-04-02 22:54:09 -07:00
David Dworken
f1303849cf still horribly broken, just a commit before refactoring to move http handlers onto a struct 2022-04-02 22:27:20 -07:00
David Dworken
252e9ab122 Website landing page, install instructions, update command, status command, set up postgres, and fixing broken tests 2022-03-29 21:56:28 -07:00
David Dworken
3cc9118a69 working tracking for start time 2022-01-09 16:39:13 -08:00
David Dworken
11962b26c9 Working install + more tests 2022-01-09 15:48:20 -08:00
David Dworken
9b144e7f31 working integration tests 2022-01-09 14:34:59 -08:00