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

Run integration tests in parallel to speed up testing #175

Merged
merged 36 commits into from
Feb 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f8a3552
Remove a few direct DB insertions to prepare for parallel tests
ddworken Feb 10, 2024
fbcdece
Revert "Remove a few direct DB insertions to prepare for parallel tests"
ddworken Feb 10, 2024
d646939
Add rudimentary experiment of splitting tests into two chunks to make…
ddworken Feb 10, 2024
ea7c714
Add missing tag
ddworken Feb 10, 2024
06cc3ee
Remove code that enforces that all goldens are used, since it is inco…
ddworken Feb 10, 2024
5a6be56
Lay out the framework for checking goldens being used across all test…
ddworken Feb 10, 2024
25ecebe
Fix missing brace
ddworken Feb 10, 2024
1deb3cf
Revert "Remove code that enforces that all goldens are used, since it…
ddworken Feb 10, 2024
d8b9d77
Add initial work towards checking that all goldens are used
ddworken Feb 10, 2024
f3710b1
Delete incorrect and unreferenced matrix
ddworken Feb 10, 2024
8b1d117
Upgrade actions/upload-artifact to see if that makes the download in …
ddworken Feb 10, 2024
168d738
Alternatively, try downloading the artifact by name
ddworken Feb 10, 2024
f4694bd
Update golden checker to read all the golden artifacts
ddworken Feb 10, 2024
ed22ae6
Swap to using glob to enumerate all golden files, rather than hardcod…
ddworken Feb 10, 2024
4efead7
Remove debugging commands
ddworken Feb 10, 2024
f0ce593
Remove goldens that are actually used
ddworken Feb 10, 2024
93d2b47
Remove another golden that is actually used
ddworken Feb 10, 2024
8e7b078
Add more comprehensive support for test sharding
ddworken Feb 11, 2024
7fb25c2
Fix references to test shards and increase shard count
ddworken Feb 11, 2024
f2c3aeb
Shard the fuzz test
ddworken Feb 11, 2024
c7d5ab0
Add debug prints
ddworken Feb 11, 2024
c97f381
Mark additional tests for sharding
ddworken Feb 11, 2024
f20b2a0
Fix logic error that broke test sharding
ddworken Feb 11, 2024
7e58088
Remove debug print
ddworken Feb 11, 2024
102a3b5
Fix incorrect logic with skipping the fuzz test
ddworken Feb 11, 2024
43a6506
Move sharding functions to testutils and add some comments
ddworken Feb 11, 2024
00c98d5
Upgrade all setup-go actions to enable caching of deps
ddworken Feb 11, 2024
60f923c
Remove goldens that don't exist
ddworken Feb 11, 2024
d5eb739
Remove new line
ddworken Feb 11, 2024
7bd6d6e
Reduce delay
ddworken Feb 11, 2024
ce01d4c
Correct stage name
ddworken Feb 11, 2024
02b5e1f
Remove incorrect skip code from the first version of sharding
ddworken Feb 11, 2024
ffb06fe
Remove unused import
ddworken Feb 11, 2024
fa65aed
Reduce number of test shards to match GitHub's limit of 5 concurrent …
ddworken Feb 11, 2024
7bce688
Use cask for installing homebrew to speed up github actions
ddworken Feb 11, 2024
b3804ef
More cleanup for unused goldens
ddworken Feb 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Docker Compose setup
Expand Down
39 changes: 30 additions & 9 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-14]
test_shard: ["0", "1", "2", "3", "4"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Linux Setup
Expand All @@ -45,10 +46,10 @@ jobs:
sudo scutil --set HostName ghaction-runner-hostname
- name: MacOS Docker Setup
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'macos-14 '}}
continue-on-error: true
continue-on-error: true # Since colima is flaky, and a failure here only impacts our metrics
run: |
# Install docker so it can be used for datadog
brew install docker
brew install --cask docker
colima start
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Set up Datadog
Expand All @@ -69,33 +70,53 @@ jobs:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
go install gotest.tools/gotestsum@bc98120
make test
NUM_TEST_SHARDS=5 CURRENT_SHARD_NUM=${{ matrix.test_shard }} make test
- name: Extra Delay
run: |

# Add an extra short delay to allow datadog to flush metrics
sleep 300 # 5 minutes
sleep 90
- name: Upload test results json
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-results-${{ matrix.os }}.json
name: test-results-${{ matrix.os }}-${{ matrix.test_shard }}.json
path: /tmp/testrun.json
- name: Upload failed test goldens
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: test-goldens-${{ matrix.os }}.zip
name: test-goldens-${{ matrix.os }}-${{ matrix.test_shard }}.zip
path: /tmp/test-goldens/
- name: Upload test log
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: testlog-${{ matrix.os }}.txt
name: testlog-${{ matrix.os }}-${{ matrix.test_shard }}.txt
path: /tmp/test.log
- name: Upload used goldens
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: goldens-used-${{ matrix.os }}-${{ matrix.test_shard }}
path: /tmp/goldens-used.txt

# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true
# limit-access-to-actor: true
check-goldens:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Download artifact
uses: actions/download-artifact@v4
- name: Check all goldens were used
run: |
go run client/posttest/main.go check-goldens
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/server-releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Build server binary
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/slsa-releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.21
- uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ forcetest: ## Force running all tests without a test cache
make test

test: ## Run all tests
TZ='America/Los_Angeles' HISHTORY_TEST=1 HISHTORY_SKIP_INIT_IMPORT=1 gotestsum --packages ./... --rerun-fails=10 --rerun-fails-max-failures=30 --format testname --jsonfile /tmp/testrun.json --post-run-command "go run client/posttest/main.go" -- -p 1 -timeout 90m
TZ='America/Los_Angeles' HISHTORY_TEST=1 HISHTORY_SKIP_INIT_IMPORT=1 gotestsum --packages ./... --rerun-fails=10 --rerun-fails-max-failures=30 --format testname --jsonfile /tmp/testrun.json --post-run-command "go run client/posttest/main.go export" -- -p 1 -timeout 90m

ftest: ## Run a specific test specified via `make ftest FILTER=TestParam/testTui/color`
go clean -testcache
Expand Down
117 changes: 65 additions & 52 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,58 +62,58 @@ func TestParam(t *testing.T) {
shellTesters = shellTesters[:1]
}
for _, tester := range shellTesters {
t.Run("testRepeatedCommandThenQuery/"+tester.ShellName(), func(t *testing.T) { testRepeatedCommandThenQuery(t, tester) })
t.Run("testRepeatedCommandAndQuery/"+tester.ShellName(), func(t *testing.T) { testRepeatedCommandAndQuery(t, tester) })
t.Run("testRepeatedEnableDisable/"+tester.ShellName(), func(t *testing.T) { testRepeatedEnableDisable(t, tester) })
t.Run("testExcludeHiddenCommand/"+tester.ShellName(), func(t *testing.T) { testExcludeHiddenCommand(t, tester) })
t.Run("testUpdate/head->release/"+tester.ShellName(), func(t *testing.T) { testUpdateFromHeadToRelease(t, tester) })
t.Run("testUpdate/prev->release/"+tester.ShellName(), func(t *testing.T) { testUpdateFromPrevToRelease(t, tester) })
t.Run("testUpdate/prev->release/prod/"+tester.ShellName(), func(t *testing.T) { testUpdateFromPrevToReleaseViaProd(t, tester) })
t.Run("testUpdate/prev->current/"+tester.ShellName(), func(t *testing.T) { testUpdateFromPrevToCurrent(t, tester) })
t.Run("testAdvancedQuery/"+tester.ShellName(), func(t *testing.T) { testAdvancedQuery(t, tester) })
t.Run("testIntegration/"+tester.ShellName(), func(t *testing.T) { testIntegration(t, tester, Online) })
t.Run("testIntegration/offline/"+tester.ShellName(), func(t *testing.T) { testIntegration(t, tester, Offline) })
t.Run("testIntegrationWithNewDevice/"+tester.ShellName(), func(t *testing.T) { testIntegrationWithNewDevice(t, tester) })
t.Run("testHishtoryBackgroundSaving/"+tester.ShellName(), func(t *testing.T) { testHishtoryBackgroundSaving(t, tester) })
t.Run("testDisplayTable/"+tester.ShellName(), func(t *testing.T) { testDisplayTable(t, tester) })
t.Run("testTableDisplayCwd/"+tester.ShellName(), func(t *testing.T) { testTableDisplayCwd(t, tester) })
t.Run("testTimestampsAreReasonablyCorrect/"+tester.ShellName(), func(t *testing.T) { testTimestampsAreReasonablyCorrect(t, tester) })
t.Run("testRequestAndReceiveDbDump/"+tester.ShellName(), func(t *testing.T) { testRequestAndReceiveDbDump(t, tester) })
t.Run("testInstallViaPythonScript/"+tester.ShellName(), func(t *testing.T) { testInstallViaPythonScript(t, tester) })
t.Run("testExportWithQuery/"+tester.ShellName(), func(t *testing.T) { testExportWithQuery(t, tester) })
t.Run("testHelpCommand/"+tester.ShellName(), func(t *testing.T) { testHelpCommand(t, tester) })
t.Run("testReuploadHistoryEntries/"+tester.ShellName(), func(t *testing.T) { testReuploadHistoryEntries(t, tester) })
t.Run("testHishtoryOffline/"+tester.ShellName(), func(t *testing.T) { testHishtoryOffline(t, tester) })
t.Run("testInitialHistoryImport/"+tester.ShellName(), func(t *testing.T) { testInitialHistoryImport(t, tester) })
t.Run("testLocalRedaction/"+tester.ShellName(), func(t *testing.T) { testLocalRedaction(t, tester, Online) })
t.Run("testLocalRedaction/offline/"+tester.ShellName(), func(t *testing.T) { testLocalRedaction(t, tester, Offline) })
t.Run("testRemoteRedaction/"+tester.ShellName(), func(t *testing.T) { testRemoteRedaction(t, tester) })
t.Run("testMultipleUsers/"+tester.ShellName(), func(t *testing.T) { testMultipleUsers(t, tester) })
t.Run("testConfigGetSet/"+tester.ShellName(), func(t *testing.T) { testConfigGetSet(t, tester) })
t.Run("testHandleUpgradedFeatures/"+tester.ShellName(), func(t *testing.T) { testHandleUpgradedFeatures(t, tester) })
t.Run("testCustomColumns/"+tester.ShellName(), func(t *testing.T) { testCustomColumns(t, tester) })
t.Run("testUninstall/"+tester.ShellName(), func(t *testing.T) { testUninstall(t, tester) })
t.Run("testPresaving/"+tester.ShellName(), func(t *testing.T) { testPresaving(t, tester, tester.ShellName()) })
t.Run("testPresavingOffline/"+tester.ShellName(), func(t *testing.T) { testPresavingOffline(t, tester) })
t.Run("testPresavingDisabled/"+tester.ShellName(), func(t *testing.T) { testPresavingDisabled(t, tester) })
t.Run("testControlR/online/"+tester.ShellName(), func(t *testing.T) { testControlR(t, tester, tester.ShellName(), Online) })
t.Run("testControlR/offline/"+tester.ShellName(), func(t *testing.T) { testControlR(t, tester, tester.ShellName(), Offline) })
t.Run("testTabCompletion/"+tester.ShellName(), func(t *testing.T) { testTabCompletion(t, tester, tester.ShellName()) })
}
t.Run("testTabCompletion/fish", func(t *testing.T) { testTabCompletion(t, zshTester{}, "fish") })
t.Run("testPresaving/fish", func(t *testing.T) { testPresaving(t, zshTester{}, "fish") })
t.Run("testControlR/fish", func(t *testing.T) { testControlR(t, bashTester{}, "fish", Online) })
t.Run("testTui/search/online", func(t *testing.T) { testTui_search(t, Online) })
t.Run("testTui/search/offline", func(t *testing.T) { testTui_search(t, Offline) })
t.Run("testTui/general/online", func(t *testing.T) { testTui_general(t, Online) })
t.Run("testTui/general/offline", func(t *testing.T) { testTui_general(t, Offline) })
t.Run("testTui/scroll", testTui_scroll)
t.Run("testTui/resize", testTui_resize)
t.Run("testTui/delete", testTui_delete)
t.Run("testTui/color", testTui_color)
t.Run("testTui/errors", testTui_errors)
t.Run("testTui/ai", testTui_ai)
t.Run("testTui/defaultFilter", testTui_defaultFilter)
t.Run("testRepeatedCommandThenQuery/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testRepeatedCommandThenQuery(t, tester) }))
t.Run("testRepeatedCommandAndQuery/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testRepeatedCommandAndQuery(t, tester) }))
t.Run("testRepeatedEnableDisable/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testRepeatedEnableDisable(t, tester) }))
t.Run("testExcludeHiddenCommand/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testExcludeHiddenCommand(t, tester) }))
t.Run("testUpdate/head->release/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testUpdateFromHeadToRelease(t, tester) }))
t.Run("testUpdate/prev->release/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testUpdateFromPrevToRelease(t, tester) }))
t.Run("testUpdate/prev->release/prod/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testUpdateFromPrevToReleaseViaProd(t, tester) }))
t.Run("testUpdate/prev->current/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testUpdateFromPrevToCurrent(t, tester) }))
t.Run("testAdvancedQuery/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testAdvancedQuery(t, tester) }))
t.Run("testIntegration/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testIntegration(t, tester, Online) }))
t.Run("testIntegration/offline/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testIntegration(t, tester, Offline) }))
t.Run("testIntegrationWithNewDevice/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testIntegrationWithNewDevice(t, tester) }))
t.Run("testHishtoryBackgroundSaving/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testHishtoryBackgroundSaving(t, tester) }))
t.Run("testDisplayTable/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testDisplayTable(t, tester) }))
t.Run("testTableDisplayCwd/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testTableDisplayCwd(t, tester) }))
t.Run("testTimestampsAreReasonablyCorrect/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testTimestampsAreReasonablyCorrect(t, tester) }))
t.Run("testRequestAndReceiveDbDump/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testRequestAndReceiveDbDump(t, tester) }))
t.Run("testInstallViaPythonScript/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testInstallViaPythonScript(t, tester) }))
t.Run("testExportWithQuery/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testExportWithQuery(t, tester) }))
t.Run("testHelpCommand/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testHelpCommand(t, tester) }))
t.Run("testReuploadHistoryEntries/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testReuploadHistoryEntries(t, tester) }))
t.Run("testHishtoryOffline/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testHishtoryOffline(t, tester) }))
t.Run("testInitialHistoryImport/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testInitialHistoryImport(t, tester) }))
t.Run("testLocalRedaction/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testLocalRedaction(t, tester, Online) }))
t.Run("testLocalRedaction/offline/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testLocalRedaction(t, tester, Offline) }))
t.Run("testRemoteRedaction/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testRemoteRedaction(t, tester) }))
t.Run("testMultipleUsers/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testMultipleUsers(t, tester) }))
t.Run("testConfigGetSet/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testConfigGetSet(t, tester) }))
t.Run("testHandleUpgradedFeatures/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testHandleUpgradedFeatures(t, tester) }))
t.Run("testCustomColumns/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testCustomColumns(t, tester) }))
t.Run("testUninstall/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testUninstall(t, tester) }))
t.Run("testPresaving/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testPresaving(t, tester, tester.ShellName()) }))
t.Run("testPresavingOffline/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testPresavingOffline(t, tester) }))
t.Run("testPresavingDisabled/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testPresavingDisabled(t, tester) }))
t.Run("testControlR/online/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testControlR(t, tester, tester.ShellName(), Online) }))
t.Run("testControlR/offline/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testControlR(t, tester, tester.ShellName(), Offline) }))
t.Run("testTabCompletion/"+tester.ShellName(), wrapTestForSharding(func(t *testing.T) { testTabCompletion(t, tester, tester.ShellName()) }))
}
t.Run("testTabCompletion/fish", wrapTestForSharding(func(t *testing.T) { testTabCompletion(t, zshTester{}, "fish") }))
t.Run("testPresaving/fish", wrapTestForSharding(func(t *testing.T) { testPresaving(t, zshTester{}, "fish") }))
t.Run("testControlR/fish", wrapTestForSharding(func(t *testing.T) { testControlR(t, bashTester{}, "fish", Online) }))
t.Run("testTui/search/online", wrapTestForSharding(func(t *testing.T) { testTui_search(t, Online) }))
t.Run("testTui/search/offline", wrapTestForSharding(func(t *testing.T) { testTui_search(t, Offline) }))
t.Run("testTui/general/online", wrapTestForSharding(func(t *testing.T) { testTui_general(t, Online) }))
t.Run("testTui/general/offline", wrapTestForSharding(func(t *testing.T) { testTui_general(t, Offline) }))
t.Run("testTui/scroll", wrapTestForSharding(testTui_scroll))
t.Run("testTui/resize", wrapTestForSharding(testTui_resize))
t.Run("testTui/delete", wrapTestForSharding(testTui_delete))
t.Run("testTui/color", wrapTestForSharding(testTui_color))
t.Run("testTui/errors", wrapTestForSharding(testTui_errors))
t.Run("testTui/ai", wrapTestForSharding(testTui_ai))
t.Run("testTui/defaultFilter", wrapTestForSharding(testTui_defaultFilter))

// Assert there are no leaked connections
assertNoLeakedConnections(t)
Expand Down Expand Up @@ -1038,6 +1038,7 @@ echo other`)
}

func TestInstallViaPythonScriptWithCustomHishtoryPath(t *testing.T) {
markTestForSharding(t, 0)
defer testutils.BackupAndRestore(t)()
defer testutils.BackupAndRestoreEnv("HISHTORY_PATH")()
altHishtoryPath := ".other-path"
Expand All @@ -1052,6 +1053,7 @@ func TestInstallViaPythonScriptWithCustomHishtoryPath(t *testing.T) {
}

func TestInstallViaPythonScriptInOfflineMode(t *testing.T) {
markTestForSharding(t, 1)
defer testutils.BackupAndRestore(t)()
defer testutils.BackupAndRestoreEnv("HISHTORY_OFFLINE")()
os.Setenv("HISHTORY_OFFLINE", "1")
Expand Down Expand Up @@ -1108,6 +1110,7 @@ func testInstallViaPythonScriptChild(t *testing.T, tester shellTester) {
}

func TestInstallViaPythonScriptFromHead(t *testing.T) {
markTestForSharding(t, 2)
defer testutils.BackupAndRestore(t)()
tester := zshTester{}

Expand Down Expand Up @@ -1219,6 +1222,7 @@ func testHelpCommand(t *testing.T, tester shellTester) {

func TestStripBashTimePrefix(t *testing.T) {
// Setup
markTestForSharding(t, 4)
defer testutils.BackupAndRestore(t)()
tester := bashTester{}
installHishtory(t, tester, "")
Expand Down Expand Up @@ -1611,6 +1615,7 @@ func testHandleUpgradedFeatures(t *testing.T, tester shellTester) {

func TestFish(t *testing.T) {
// Setup
markTestForSharding(t, 5)
defer testutils.BackupAndRestore(t)()
tester := bashTester{}
installHishtory(t, tester, "")
Expand Down Expand Up @@ -2570,6 +2575,7 @@ echo bar`)

func TestTimestampFormat(t *testing.T) {
// Setup
markTestForSharding(t, 6)
tester := zshTester{}
defer testutils.BackupAndRestore(t)()
userSecret := installHishtory(t, tester, "")
Expand Down Expand Up @@ -2607,6 +2613,7 @@ func TestTimestampFormat(t *testing.T) {

func TestSortByConsistentTimezone(t *testing.T) {
// Setup
markTestForSharding(t, 7)
tester := zshTester{}
defer testutils.BackupAndRestore(t)()
installHishtory(t, tester, "")
Expand Down Expand Up @@ -2646,6 +2653,7 @@ func TestSortByConsistentTimezone(t *testing.T) {

func TestZDotDir(t *testing.T) {
// Setup
markTestForSharding(t, 8)
tester := zshTester{}
defer testutils.BackupAndRestore(t)()
defer testutils.BackupAndRestoreEnv("ZDOTDIR")()
Expand Down Expand Up @@ -2680,6 +2688,7 @@ func TestZDotDir(t *testing.T) {

func TestRemoveDuplicateRows(t *testing.T) {
// Setup
markTestForSharding(t, 9)
tester := zshTester{}
defer testutils.BackupAndRestore(t)()
installHishtory(t, tester, "")
Expand Down Expand Up @@ -2732,6 +2741,7 @@ echo foo`)

func TestSetConfigNoCorruption(t *testing.T) {
// Setup
markTestForSharding(t, 10)
tester := zshTester{}
defer testutils.BackupAndRestore(t)()
installHishtory(t, tester, "")
Expand Down Expand Up @@ -2766,6 +2776,7 @@ func TestSetConfigNoCorruption(t *testing.T) {
// Test that the config retrieved from the context is a reference and there are no consistency issues with it getting out of sync
func TestCtxConfigIsReference(t *testing.T) {
// Setup
markTestForSharding(t, 11)
tester := zshTester{}
defer testutils.BackupAndRestore(t)()
installHishtory(t, tester, "")
Expand Down Expand Up @@ -2877,6 +2888,7 @@ func createSyntheticImportEntries(t testing.TB, numSyntheticEntries int) {

func TestImportHistory(t *testing.T) {
// Setup
markTestForSharding(t, 11)
tester := bashTester{}
defer testutils.BackupAndRestore(t)()
userSecret := installHishtory(t, tester, "")
Expand Down Expand Up @@ -2931,6 +2943,7 @@ func BenchmarkImport(b *testing.B) {
}

func TestAugmentedIsOfflineError(t *testing.T) {
markTestForSharding(t, 12)
defer testutils.BackupAndRestore(t)()
installHishtory(t, zshTester{}, "")
defer testutils.BackupAndRestoreEnv("HISHTORY_SIMULATE_NETWORK_ERROR")()
Expand Down
6 changes: 6 additions & 0 deletions client/fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ func FuzzTestMultipleUsers(f *testing.F) {
if skipSlowTests() {
f.Skip("skipping slow tests")
}
if isShardedTestRun() {
if currentShardNumber() != 0 {
f.Skip("Skipping sharded test")
}
}

defer testutils.RunTestServer()()
// Format:
// $Op = $Key;$Device|$Command\n
Expand Down
Loading
Loading