-
Notifications
You must be signed in to change notification settings - Fork 0
Tests/s3 lambda tests #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| average,name,subject,marks,header,headerValue,expected | ||
| 50,Bob,Physics,"50,50,50,50",X-Amz-Executed-Version,$LATEST,expected_1 | ||
| 50,John,Physics,"70,60,60,50",X-Amz-Executed-Version,$LATEST,expected_2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| variable_bucket,variable_file,variable_expected,content_expected | ||
| testlum-var-bucket-1,upload_1.json,1,{"Testlum": "TOP"} | ||
| testlum-var-bucket-2,upload_2.json,2,{"Testlum": "The Best"} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Alice", | ||
| "subject": "Mathematics", | ||
| "scores": [90, 85, 92, 88] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "student": "Alice", | ||
| "subject": "Mathematics", | ||
| "scores": [90, 85, 92, 88], | ||
| "average": 88.75, | ||
| "passed": true, | ||
| "status": "PASSED" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "student": "Bob", | ||
| "subject": "Physics", | ||
| "scores": [40, 55, 50, 45], | ||
| "average": 47.5, | ||
| "passed": false, | ||
| "status": "FAILED" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| <scenario xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xmlns="http://www.knubisoft.com/testlum/testing/model/scenario" | ||
| xsi:schemaLocation="http://www.knubisoft.com/testlum/testing/model/scenario scenario.xsd"> | ||
|
|
||
| <overview> | ||
| <description>Self test for student-scores-python: student score processor - calculates average, pass/fail status | ||
| </description> | ||
| <name>AWS Lambda Self scenario</name> | ||
| </overview> | ||
|
|
||
| <settings truncateStorages="true"> | ||
| <tags>lambda</tags> | ||
| </settings> | ||
|
|
||
| <condition comment="Condition that evaluates to TRUE" | ||
| name="trueExecution" | ||
| spel="1 == 1"/> | ||
|
|
||
| <lambda comment="Should invoke student-scores-python with passing student scores - average 88.75" | ||
| alias="LAMBDA" | ||
| condition="trueExecution" | ||
| functionName="student-scores-python"> | ||
| <body> | ||
| <from file="body_1.json"/> | ||
| </body> | ||
| <response file="expected_1.json"> | ||
| <header name="X-Amz-Executed-Version" data="$LATEST"/> | ||
| </response> | ||
| </lambda> | ||
|
|
||
| <condition comment="Condition that evaluates to FALSE from the body of previous call" | ||
| name="falseExecution" | ||
| spel="1 == 2"/> | ||
|
|
||
| <lambda comment="Should skip invoke student-scores-python with failing student scores - average 47.5" | ||
| alias="LAMBDA" | ||
| condition="falseExecution" | ||
| functionName="student-scores-python"> | ||
| <body> | ||
| <raw> | ||
| { | ||
| "name": "Bob", | ||
| "subject": "Physics", | ||
| "scores": [40, 55, 50, 45] | ||
| } | ||
| </raw> | ||
| </body> | ||
| <response file="expected_2.json"> | ||
| <header name="X-Amz-Executed-Version" data="$LATEST"/> | ||
| </response> | ||
| </lambda> | ||
|
|
||
| </scenario> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| [ { | ||
| "id" : "1", | ||
| "author" : "J. K. Rowling", | ||
| "title" : "Harry Potter and Philosopher's Stone", | ||
| "number" : 1 | ||
| }, { | ||
| "id" : "2", | ||
| "author" : "J. R. R. Tolkien", | ||
| "title" : "The Lord of the Rings: The Fellowship of the Ring", | ||
| "number" : 2 | ||
| }, { | ||
| "id" : "3", | ||
| "author" : "George R. R. Martin", | ||
| "title" : "A Game of Thrones", | ||
| "number" : 3 | ||
| }, { | ||
| "id" : "4", | ||
| "author" : "Fredrik Backman", | ||
| "title" : "A Man Called Ove", | ||
| "number" : 4 | ||
| }, { | ||
| "id" : "5", | ||
| "author" : "Ivan Franko", | ||
| "title" : "Kamenyari", | ||
| "number" : 5 | ||
| }, { | ||
| "id" : "6", | ||
| "author" : "Taras Shevchenko", | ||
| "title" : "Kobzar", | ||
| "number" : 6 | ||
| } ] |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change tag to end2end |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Alice", | ||
| "subject": "Mathematics", | ||
| "scores": [90, 85, 92, 88] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "student": "Alice", | ||
| "subject": "Mathematics", | ||
| "scores": [90, 85, 92, 88], | ||
| "average": 88.75, | ||
| "passed": true, | ||
| "status": "PASSED" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "student": "Bob", | ||
| "subject": "Physics", | ||
| "scores": [40, 55, 50, 45], | ||
| "average": 47.5, | ||
| "passed": false, | ||
| "status": "FAILED" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <scenario xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xmlns="http://www.knubisoft.com/testlum/testing/model/scenario" | ||
| xsi:schemaLocation="http://www.knubisoft.com/testlum/testing/model/scenario scenario.xsd"> | ||
|
|
||
| <overview> | ||
| <description>Repeat test for student-scores-python lambda: student score processor - calculates average, pass/fail status | ||
| </description> | ||
| <name>AWS Lambda Repeat scenario</name> | ||
| </overview> | ||
|
|
||
| <settings truncateStorages="true"> | ||
| <tags>lambda</tags> | ||
| </settings> | ||
|
|
||
| <repeat comment="Invoke lambda function with repeat command N times" times="5"> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. repeat with variations |
||
| <lambda comment="Invoke student-scores-python with passing student scores - average 88.75" | ||
| alias="LAMBDA" | ||
| functionName="student-scores-python"> | ||
| <body> | ||
| <from file="body_1.json"/> | ||
| </body> | ||
| <response file="expected_1.json"> | ||
| <header name="X-Amz-Executed-Version" data="$LATEST"/> | ||
| </response> | ||
| </lambda> | ||
| </repeat> | ||
|
|
||
| </scenario> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "name": "Alice", | ||
| "subject": "Mathematics", | ||
| "scores": [90, 85, 92, 88] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "student": "Alice", | ||
| "subject": "Mathematics", | ||
| "scores": [90, 85, 92, 88], | ||
| "average": 88.75, | ||
| "passed": true, | ||
| "status": "PASSED" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "student": "Bob", | ||
| "subject": "Physics", | ||
| "scores": [40, 55, 50, 45], | ||
| "average": 47.5, | ||
| "passed": false, | ||
| "status": "FAILED" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <scenario xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xmlns="http://www.knubisoft.com/testlum/testing/model/scenario" | ||
| xsi:schemaLocation="http://www.knubisoft.com/testlum/testing/model/scenario scenario.xsd"> | ||
|
|
||
| <overview> | ||
| <description>Self test for student-scores-python lambda: student score processor - calculates average,pass/fail status | ||
| </description> | ||
| <name>AWS Lambda Self scenario</name> | ||
| </overview> | ||
|
|
||
| <settings truncateStorages="true"> | ||
| <tags>lambda</tags> | ||
| </settings> | ||
|
|
||
| <lambda comment="Invoke student-scores-python with passing student scores - average 88.75" | ||
| alias="LAMBDA" | ||
| functionName="student-scores-python"> | ||
| <body> | ||
| <from file="body_1.json"/> | ||
| </body> | ||
| <response file="expected_1.json"> | ||
| <header name="X-Amz-Executed-Version" data="$LATEST"/> | ||
| </response> | ||
| </lambda> | ||
|
|
||
| <lambda comment="Invoke student-scores-python with failing student scores - average 47.5" | ||
| alias="LAMBDA" | ||
| functionName="student-scores-python"> | ||
| <body> | ||
| <raw> | ||
| { | ||
| "name": "Bob", | ||
| "subject": "Physics", | ||
| "scores": [40, 55, 50, 45] | ||
| } | ||
| </raw> | ||
| </body> | ||
| <response file="expected_2.json"> | ||
| <header name="X-Amz-Executed-Version" data="$LATEST"/> | ||
| </response> | ||
| </lambda> | ||
|
|
||
| </scenario> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. inject here |
||
| "student" : "Bob", | ||
| "subject" : "Physics", | ||
| "scores" : [ 50, 50, 50, 50 ], | ||
| "average" : 50.0, | ||
| "passed" : false, | ||
| "status" : "FAILED" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "student" : "John", | ||
| "subject" : "Physics", | ||
| "scores" : [ 70, 60, 60, 50 ], | ||
| "average" : 60.0, | ||
| "passed" : true, | ||
| "status" : "PASSED" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
condition doesn't check anything
should be step with error inside