Skip to content

Commit

Permalink
Config file comment example and testing output
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed Oct 16, 2023
1 parent 96d6343 commit f0915b2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/utils/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ func TestConfigParsing(t *testing.T) {
fsys := afero.NewMemMapFs()
assert.NoError(t, WriteConfig(fsys, false))
assert.NoError(t, LoadConfigFS(fsys))

// Test default network
assert.Equal(t, "supabase_network_utils", NetId)
})

t.Run("config file with environment variables", func(t *testing.T) {
Expand All @@ -45,6 +48,9 @@ func TestConfigParsing(t *testing.T) {
// Check error
assert.Equal(t, "hello", Config.Auth.External["azure"].ClientId)
assert.Equal(t, "this is cool", Config.Auth.External["azure"].Secret)
// Check for overridden network
assert.Equal(t, "supabase-test-network", Config.Network)
assert.Equal(t, "supabase-test-network", NetId)
})

t.Run("config file with environment variables fails when unset", func(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions internal/utils/templates/init_config.test.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# A string used to distinguish different Supabase projects on the same host. Defaults to the
# working directory name when running `supabase init`.
project_id = "{{ .ProjectId }}"
# Uncomment to use a custom docker network
network = "supabase-test-network"

[api]
enabled = true
Expand Down
2 changes: 2 additions & 0 deletions internal/utils/templates/init_config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# A string used to distinguish different Supabase projects on the same host. Defaults to the
# working directory name when running `supabase init`.
project_id = "{{ .ProjectId }}"
# Uncomment to use a custom docker network
# network = "supabase_network_{{ .ProjectId }}"

[api]
enabled = true
Expand Down

0 comments on commit f0915b2

Please sign in to comment.