61 Commits

Author SHA1 Message Date
Frank Schmid
5526802a1b
Added request cache and queue to AWS provider
Make sure that requests are throttled. Use a queue for the requests.

Added new expected parameter to request() call in variables test

Added request cache tests
Check that request is indeed called 1000 times

Cache promises, not values

Use request cache for AWS variable requests

Use fromCallback instead of "new Promise" anti-pattern.

Added request cache to AWS provider
2017-12-05 12:39:39 +01:00
Benjamin Forster
fae0ccb1d7 update variable name in test to be more descriptive 2017-12-01 10:40:23 +11:00
Benjamin Forster
6e6fea3fa2 update ssm cache to generic variable cache. 2017-12-01 10:33:30 +11:00
Benjamin Forster
382f6900e0 update test to show that cache is working 2017-11-30 10:08:23 +11:00
Benjamin Forster
33b666c431 add test 2017-11-29 17:49:52 +11:00
horike37
0bb444ac76 minor tweak 2017-11-09 01:27:09 +09:00
horike37
dbe02ab0e8 Merge branch 'master' of github.com:serverless/serverless 2017-11-08 10:30:50 +09:00
Frank Schmid
5744a08a91 Fixed #getValueFromFile():should work for absolute paths with ~ unit test 2017-11-07 12:21:06 +01:00
Frank Schmid
3e826ef598 Reworked remaining variable tests to use sinon chai notation 2017-11-07 11:49:07 +01:00
horike37
9cb43195be add test if symlink works 2017-11-07 09:36:20 +09:00
horike37
59290542c0 improve Variables test 2017-11-07 09:14:24 +09:00
horike37
21a64aed19 update test for that case 2017-11-07 00:00:40 +09:00
Basile Trujilllo [L0gIn]
188382f339 Add symlink variable file unit tests 2017-10-17 14:32:58 +02:00
Loren Gordon
629c073c6b Tests SSM variable syntax for all allowable characters 2017-09-13 07:14:49 -04:00
Loren Gordon
9746de39dd Expects string variables to fulfill promise 2017-09-07 09:39:31 -04:00
Loren Gordon
6088c9f494 Updates string syntax tests to call functions under test 2017-09-07 08:21:48 -04:00
Loren Gordon
5a7d14af09 Adds overwrite syntax support to SSM variable syntax
Check for the expected error message in the case the SSM parameter
does not exist and return `undefined`. Any other (unexpected) error
message still throws an exception.
2017-09-01 15:10:00 -04:00
Loren Gordon
ba14eb9ab2 Adds tests for SSM variable functionality 2017-09-01 12:54:04 -04:00
Philipp Muens
f8787d4289 Minor fixes 2017-08-21 13:35:04 +02:00
Philipp Muens
44aa158da9 Fix breaking test for custom variableSyntax usage 2017-08-21 13:19:08 +02:00
Philipp Muens
701187bc59 Update all variableSyntax usages 2017-08-21 13:11:29 +02:00
Toby Hede
33431cb45a Allow double-quoted and single-quoted variables
Empty string is now valid
2017-08-20 11:05:15 +10:00
Toby Hede
a1c8a37b9a Allow use of string as default values in variables 2017-08-18 09:07:29 +10:00
indieisaconcept
71f1aa09cb preserve context when executing exported function from .js file
The change ensures that when a .js file exported function is executed,
the original execution context is supplied in order to maintain "this".
2017-07-26 11:21:09 +10:00
Eslam λ Hefnawy
bb32b01f7a Merge pull request #3909 from jaikdean/variable-syntax-documentation-fix
Update example custom variable syntax to work with loading files
2017-07-12 19:42:18 +07:00
Philipp Muens
c67d60f5d6 Merge pull request #3888 from mangas/3629-fix-file-absolute-path
handle absolute paths in file()
2017-07-07 14:55:02 +02:00
Jaik Dean
c33c4f782a Update example alternate variable syntax to work with loading files 2017-07-06 16:42:08 +01:00
Filipe Azevedo
aab492f079 handle absolute paths with ~ in file() 2017-07-03 18:19:23 +01:00
Luke Herrington
1264dd015c
Improve usage and error handling of javascript variables. 2017-06-23 10:49:38 -07:00
Philipp Muens
0e4aceb704 Update error message 2017-06-11 21:14:12 +02:00
Philipp Muens
ee14ce9f36 Minor code changes and test improvements 2017-06-08 09:54:46 +02:00
Jeremy Benoist
ca202c5672
Throw an Error when requested variable does not exist
When we define a cf variable in serverless.yml and that variable wasn't output from the Cloudformation Outputs
a useless error was throw:

> Cannot read property 'OutputValue' of undefined

Now the error give more information:

> Trying to request a non variable from Cloudformation.
> Stack name: "some-stack" Requested variable: "DoestNotExist"
2017-06-06 17:18:33 +02:00
Sam Marks
aef89a51c7 Another follow-up on async vars. 2017-05-31 00:18:10 -04:00
Eslam λ Hefnawy
ddb99af627 Merge pull request #3592 from aoskotsky-amplify/master
Add support for S3 variables
2017-05-18 21:28:02 +07:00
Eslam A. Hefnawy
7503fa0bc5 fixed bug when using dot notation in yml keys 2017-05-15 22:05:04 +07:00
Eslam A. Hefnawy
971a27994c fixed bug when referencing vars from other vars object values 2017-05-12 13:34:11 +07:00
Alex Oskotsky
2945880e68 Add support for S3 variables 2017-05-10 23:31:43 -04:00
Eslam A. Hefnawy
7c7b2bc849 added more test for cf vars 2017-05-09 19:10:57 +07:00
Eslam A. Hefnawy
f7b26a492c added cross service communication feature via cf variable source 2017-05-09 19:04:30 +07:00
Eslam A. Hefnawy
9b10da6dc8 fixed all unit tests 2017-05-05 00:36:32 +07:00
Eslam A. Hefnawy
bd33c98e7f fixed variables tests 2017-05-03 22:23:25 +07:00
Philipp Muens
bfb67aadde Minor typo fixes / cleanup 2017-03-01 09:17:10 +01:00
Erik Erikson
93c7afb3f5 Resolve PR Comments
1. Improve wording of documentation.  Note the concrete object that will be written in its entirety
2. Expand documentation.  Note a potential security risk for secrets
3. Move, without changes, the `warnIfNotFound` method because it was putting space between `getValueFromSource` and the various source type specific functions it uses
4. Implement unit tests for `warnIfNotFound`
5. Implement unit tests for `logWarning`
2017-02-10 18:31:02 -08:00
Erik Erikson
7376fc0dff Merge branch 'master' into allow-self-reference
# Conflicts:
#	lib/classes/Error.js
2017-02-08 15:51:57 -08:00
Erik Erikson
b936492af1 Allow for Top Level References & Commit Comments
1. Newly allow `${opt:}` and `${env:}` as a valid reference to the root of the option and environment settings hive, respectively
2. Write a test ensuring the above
3. Document the new capability
4. Eliminate a silly through-${self:} use example
5. Allow for the use of populateProperty in a not-in-place manner
6. Allow for the valid (albeit odd) valueToPopulate[''] case
2017-02-08 14:05:36 -08:00
Erik Erikson
230f37f4a4 Allow for Self-Reference
1. Newly allow '${self:}' as a valid reference to the current serverless.yml's root
  a. This allows for a more clean manner of passing names and identifiers around between projects.  Particularly, this facilitates exporting values from projects so they can be used in other projects via Fn::ImportValue.
2. Write a test ensuring the above
3. Document the new capability

Example usage: https://github.com/Nordstrom/hello-retail/pull/26/files
2017-02-07 19:19:30 -08:00
Philipp Muens
54fbaadede Remove defaults service property 2017-01-30 11:03:40 +01:00
John McKim
adea45e978 Temporarily remove provider.variableSyntax during variable population 2016-12-08 17:42:07 +10:00
ac360
15d0df22ae fix tests, add errors for better ux 2016-11-07 21:51:01 -08:00
ac360
d7b5afa459 fix test 2016-11-06 23:04:33 -08:00