Skip to content

Commit

Permalink
stores: check if we are using MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Feb 19, 2024
1 parent d3b879f commit f02353f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
autopilot
bus bus/client
worker worker/client
- name: Test
uses: n8maninger/action-golang-test@v1
with:
args: "-race;-short"
# - name: Test
# uses: n8maninger/action-golang-test@v1
# with:
# args: "-race;-short"
- name: Test Stores - MySQL
if: matrix.os == 'ubuntu-latest'
uses: n8maninger/action-golang-test@v1
Expand All @@ -57,20 +57,20 @@ jobs:
with:
package: "./stores"
args: "-failfast;-race;-tags=testing;-timeout=30m"
- name: Test Integration
uses: n8maninger/action-golang-test@v1
with:
package: "./internal/testing/..."
args: "-failfast;-race;-tags=testing;-timeout=30m"
- name: Test Integration - MySQL
if: matrix.os == 'ubuntu-latest'
uses: n8maninger/action-golang-test@v1
env:
RENTERD_DB_URI: 127.0.0.1:3800
RENTERD_DB_USER: root
RENTERD_DB_PASSWORD: test
with:
package: "./internal/testing/..."
args: "-failfast;-race;-tags=testing;-timeout=30m"
# - name: Test Integration
# uses: n8maninger/action-golang-test@v1
# with:
# package: "./internal/testing/..."
# args: "-failfast;-race;-tags=testing;-timeout=30m"
# - name: Test Integration - MySQL
# if: matrix.os == 'ubuntu-latest'
# uses: n8maninger/action-golang-test@v1
# env:
# RENTERD_DB_URI: 127.0.0.1:3800
# RENTERD_DB_USER: root
# RENTERD_DB_PASSWORD: test
# with:
# package: "./internal/testing/..."
# args: "-failfast;-race;-tags=testing;-timeout=30m"
- name: Build
run: go build -o bin/ ./cmd/renterd
4 changes: 4 additions & 0 deletions stores/slabbuffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ func TestRecordAppendToCompletedBuffer(t *testing.T) {
ss := newTestSQLStore(t, defaultTestSQLStoreConfig)
defer ss.Close()

if isSQLite(ss.db) {
t.Fatal("we're still using SQLite")

Check failure on line 16 in stores/slabbuffer_test.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 1.22)

Test go.sia.tech/renterd/stores/TestRecordAppendToCompletedBuffer failed in 0.06s

slabbuffer_test.go:16: we're still using SQLite
}

completionThreshold := int64(1000)
mgr, err := newSlabBufferManager(ss.SQLStore, completionThreshold, t.TempDir())
if err != nil {
Expand Down
11 changes: 5 additions & 6 deletions stores/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ type testSQLStore struct {
}

type testSQLStoreConfig struct {
dbURI string
dbUser string
dbPassword string
dbName string
dbMetricsName string

dbURI string
dbUser string
dbPassword string
dbName string
dbMetricsName string
dir string
persistent bool
skipMigrate bool
Expand Down

0 comments on commit f02353f

Please sign in to comment.