Re: [Snowdrift-dev] [PATCH] Override Stripe secret key in test settings

2017-07-10 Thread Bryan Richter
On Tue, Jul 11, 2017 at 01:05:28AM +0300, fr33domlover wrote:
> From: fr33domlover 
> 
> ---
>  website/config/test-settings.yml | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/website/config/test-settings.yml 
> b/website/config/test-settings.yml
> index b2d43ca..ded169e 100644
> --- a/website/config/test-settings.yml
> +++ b/website/config/test-settings.yml
> @@ -6,8 +6,17 @@ database:
># something like:
>#
>#   database: "_env:PGDATABASE:Snowdrift_LOWER_test"
> +  #
> +  # Note that at the time of writing, settings loading in the Snowdrift test
> +  # suite ignores the environment (the Yesod scaffolding template does the
> +  # same) anyway.
>database: snowdrift_test
>  
>  # All I want to see is test results, usually.
>  detailed-logging: false
>  should-log-all: false
> +
> +# Make sure we don't accidentally use the real key in tests. Note that while 
> an
> +# alternative env variable is specified here, if the test suite settings 
> loader
> +# ignores the environment, it won't notice the variable.
> +stripe-secret-key: "_env:STRIPE_SECRET_TEST_KEY:set_test_key_here"
> -- 
> 1.9.1

Hmm.. I think this is unnecessary. The tests should be using
the same environment variable that everything does; namely,
"STRIPE_SECRET_KEY". The difference is that in the test _environment_,
the _environment variable_ will be set to the test key. :)

These settings.yml files should really go away, incidentally.
Everything should just be environment variables. Settings.hs needs a
rewrite. (I think we'll eventually replace *all* the Yesod scaffolding
bits and pieces.)

I haven't really looked into it, though... there may be complications.


signature.asc
Description: Digital signature
___
Dev mailing list
Dev@lists.snowdrift.coop
https://lists.snowdrift.coop/mailman/listinfo/dev


[Snowdrift-dev] [PATCH] Override Stripe secret key in test settings

2017-07-10 Thread fr33domlover
From: fr33domlover 

---
 website/config/test-settings.yml | 9 +
 1 file changed, 9 insertions(+)

diff --git a/website/config/test-settings.yml b/website/config/test-settings.yml
index b2d43ca..ded169e 100644
--- a/website/config/test-settings.yml
+++ b/website/config/test-settings.yml
@@ -6,8 +6,17 @@ database:
   # something like:
   #
   #   database: "_env:PGDATABASE:Snowdrift_LOWER_test"
+  #
+  # Note that at the time of writing, settings loading in the Snowdrift test
+  # suite ignores the environment (the Yesod scaffolding template does the
+  # same) anyway.
   database: snowdrift_test
 
 # All I want to see is test results, usually.
 detailed-logging: false
 should-log-all: false
+
+# Make sure we don't accidentally use the real key in tests. Note that while an
+# alternative env variable is specified here, if the test suite settings loader
+# ignores the environment, it won't notice the variable.
+stripe-secret-key: "_env:STRIPE_SECRET_TEST_KEY:set_test_key_here"
-- 
1.9.1

___
Dev mailing list
Dev@lists.snowdrift.coop
https://lists.snowdrift.coop/mailman/listinfo/dev