From f0915b2a2aff3b9fe32cfc040a651a362242745c Mon Sep 17 00:00:00 2001 From: Sam Lown Date: Mon, 16 Oct 2023 21:55:30 +0000 Subject: [PATCH] Config file comment example and testing output --- internal/utils/config_test.go | 6 ++++++ internal/utils/templates/init_config.test.toml | 2 ++ internal/utils/templates/init_config.toml | 2 ++ 3 files changed, 10 insertions(+) diff --git a/internal/utils/config_test.go b/internal/utils/config_test.go index 8aa7d4f0a..56a97698a 100644 --- a/internal/utils/config_test.go +++ b/internal/utils/config_test.go @@ -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) { @@ -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) { diff --git a/internal/utils/templates/init_config.test.toml b/internal/utils/templates/init_config.test.toml index 0ee38fe3d..05ef48a0d 100644 --- a/internal/utils/templates/init_config.test.toml +++ b/internal/utils/templates/init_config.test.toml @@ -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 diff --git a/internal/utils/templates/init_config.toml b/internal/utils/templates/init_config.toml index fbe70ac9a..773c1508b 100644 --- a/internal/utils/templates/init_config.toml +++ b/internal/utils/templates/init_config.toml @@ -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