Slightly improve sqlite db engine tests

This commit is contained in:
Brian Picciano 2024-12-27 11:51:53 +01:00
parent 9407ec23c2
commit 054354b384
3 changed files with 45 additions and 1 deletions

View File

@ -145,13 +145,14 @@ func TestNetwork_SetConfig(t *testing.T) {
h = newIntegrationHarness(t) h = newIntegrationHarness(t)
network = h.createNetwork(t, "primus", nil) network = h.createNetwork(t, "primus", nil)
networkConfig = network.getConfig(t) networkConfig = network.getConfig(t)
metaPath = h.mkDir(t, "meta").Path
) )
networkConfig.Storage.Allocations = append( networkConfig.Storage.Allocations = append(
networkConfig.Storage.Allocations, networkConfig.Storage.Allocations,
daecommon.ConfigStorageAllocation{ daecommon.ConfigStorageAllocation{
DataPath: h.mkDir(t, "data").Path, DataPath: h.mkDir(t, "data").Path,
MetaPath: h.mkDir(t, "meta").Path, MetaPath: metaPath,
Capacity: 1, Capacity: 1,
S3APIPort: 4900, S3APIPort: 4900,
RPCPort: 4901, RPCPort: 4901,
@ -199,6 +200,7 @@ func TestNetwork_SetConfig(t *testing.T) {
string(garageConfig), string(garageConfig),
`db_engine = "`+garagesrv.DBEngineSqlite+`"`, `db_engine = "`+garagesrv.DBEngineSqlite+`"`,
) )
assert.FileExists(t, filepath.Join(metaPath, "db.sqlite"))
}) })
t.Run("add storage alloc/lmdb", func(t *testing.T) { t.Run("add storage alloc/lmdb", func(t *testing.T) {
@ -238,6 +240,7 @@ func TestNetwork_SetConfig(t *testing.T) {
string(garageConfig), string(garageConfig),
`db_engine = "`+garagesrv.DBEngineLMDB+`"`, `db_engine = "`+garagesrv.DBEngineLMDB+`"`,
) )
assert.NoFileExists(t, filepath.Join(metaPath, "db.sqlite"))
}) })
t.Run("remove storage alloc", func(t *testing.T) { t.Run("remove storage alloc", func(t *testing.T) {

13
tasks/nats/add.md Normal file
View File

@ -0,0 +1,13 @@
---
type: tasks
---
Introduce [NATS][nats] as a new service run by Isle. All hosts should join the
NATS network.
* The nebula lighthouse hosts can be used as the bootstrap nodes for finding the
rest of the NATS peers.
* The firewall must have a port automatically opened on it for all hosts.
[nats]: https://nats.io/

View File

@ -0,0 +1,28 @@
---
type: tasks
after:
- ./add.md
---
A simple mechanism should be developed which "watches" a garage directory or
file for changes. This mechanism has too sides.
## Producer
When making a change to a file in garage (putting or deleting) the producer
should publish the path to that file to a bucket-specific pubsub channel on
NATS.
This only applies for file changes which are expected to have a watcher.
## Watcher
The watcher is a simple mechanism which looks like this:
```go
type Watcher interface {
Wait(context.Context) (string, error) // returns the path to the changed file
}
```
It can be initialized with either a specific file path or a doublestar matcher.