-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove runtime tests, simplify Rest vs CLI test hierarchy, add sniff test for all runtimes #3840
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
Conversation
|
@rabbah Do the unicode test pass for you on Mac?. For me they always failed and only passed on travis. May be related to default encoding and we may need to make it more explicit |
|
They do yes - do you run the tests from gradle or ij? |
|
I just need a sniff tests - it doesn't have to be unicode (which should be covered by the unit proxy tests anyway). So it could be "echo" as well. |
| /** | ||
| * Test the Java "hello world" demo sequence | ||
| */ | ||
| it should "Invoke a java action" in withAssetCleaner(wskprops) { (wp, assetHelper) => |
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.
this test can be dropped.
| /* | ||
| * Example from the docs. | ||
| */ | ||
| it should "Invoke a Java action where main is in the default package" in withAssetCleaner(wskprops) { |
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.
move this to unit test.
EDIT: added to java runtime tests.
| } | ||
| } | ||
|
|
||
| it should "Ensure that Java actions cannot be created without a specified main method" in withAssetCleaner(wskprops) { |
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.
move this to cli/unit test.
EDIT: moved.
|
|
||
| behavior of s"Runtime $currentNodeJsKind" | ||
|
|
||
| it should "Ensure that NodeJS actions can have a non-default entrypoint" in withAssetCleaner(wskprops) { |
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.
drop, duplicate of unit test.
| } | ||
| } | ||
|
|
||
| it should "Ensure that zipped actions are encoded and uploaded as NodeJS actions" in withAssetCleaner(wskprops) { |
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.
drop, duplicate of unit test.
EDIT: moved to CLI test suite.
| } | ||
| } | ||
|
|
||
| it should "invoke an action and confirm expected environment is defined" in withAssetCleaner(wskprops) { |
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.
drop, duplicate.
| } | ||
| } | ||
|
|
||
| it should "invoke an invalid action and get error back" in withAssetCleaner(wskprops) { (wp, assetHelper) => |
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.
duplicate - but unit test doesn't check error message as done here, should tighten unit test accordingly.
EDIT: updated unit tests for runtimes accordingly.
|
|
||
| behavior of "Python virtualenv" | ||
|
|
||
| Seq(("python2_virtualenv.zip", "python:2"), ("python3_virtualenv.zip", "python:3")).foreach { |
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.
drop, duplicates.
|
|
||
| behavior of "Swift runtime" | ||
|
|
||
| it should "Ensure that Swift actions can have a non-default entrypoint" in withAssetCleaner(wskprops) { |
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.
drop, duplicate.
| class WskRestActionTests extends WskActionTests with WskActorSystem { | ||
| override val wsk = new WskRestOperations | ||
|
|
||
| it should "create an action with an empty file" in withAssetCleaner(wskprops) { (wp, assetHelper) => |
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.
The docker skeleton and python runtimes accept an empty code string during init, and fail in run (docker skeleton will just run the stub, and python will return error = action did not return dictionary).
Java will fail with class/method not found for main during class loader.
Swift will fail with did not generate an executable.
Dropping this test is OK - I don't think we're getting any increased coverage. It would be nice to make the failures uniform but this may be a little difficult for all the runtimes to normalize.
EDIT: I added tests for empty code strings to the runtime suite.
ee8be72 to
7c660ae
Compare
0968438 to
d38af10
Compare
|
|
||
| val bodyHead = Map("name" -> name.toJson, "namespace" -> namespace.toJson) | ||
|
|
||
| val (updateExistence, resultExistence) = update match { |
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.
I removed this because this is mimicking CLI functionality and I think should be considered invalid for the REST operations. If this was an SDK I can see supporting this but here the tests should be making pass through calls and not really doing anything fancy. I kept copy support although I was tempted to remove that also.
| } | ||
| } | ||
|
|
||
| it should "reject action update for sequence with no components" in withAssetCleaner(wskprops) { (wp, assetHelper) => |
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.
moved to a unit test.
| } | ||
| } | ||
|
|
||
| it should "report error when creating an action with unknown kind" in withAssetCleaner(wskprops) { |
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.
moved to a unit test.
| rr.stderr should include("kind 'foobar' not in Set") | ||
| } | ||
|
|
||
| it should "report error when creating an action with zip but without kind" in withAssetCleaner(wskprops) { |
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.
moved to a unit test.
| } | ||
| } | ||
|
|
||
| it should "ensure action update with --web flag only copies existing annotations when new annotations are not provided" in withAssetCleaner( |
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.
this is a CLI test, does not belong with the REST tests.
EDIT: already exists in the cli tests.
Codecov Report
@@ Coverage Diff @@
## master #3840 +/- ##
==========================================
+ Coverage 74.6% 74.61% +0.01%
==========================================
Files 138 138
Lines 6465 6465
Branches 406 406
==========================================
+ Hits 4823 4824 +1
+ Misses 1642 1641 -1
Continue to review full report at Codecov.
|
|
PG1 3103 🔴 |
a6c27dc to
a71efae
Compare
7ac0094 to
9e470e3
Compare
|
Thanks a big bunch for all of this grunt work 👍 |
Tweak some tests checking status codes. Fix bug in test which permitted one too many log sentinels. Add test for non-main entry point Add one more tests to runtime docs.
|
@dgrove-oss All the tests which needed to move have no been moved. This PR is ready. Linked all related PRs: apache/openwhisk-cli#350 |
dgrove-oss
left a comment
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.
looks good to go. I will merge this and then work on merging through all the downstream PRs.
* Update tests for upstream changes in apache/openwhisk#3840.
…test for all runtimes (apache#3840) Additional cleanup of tests: removes WskRest* where possible and makes the base test suite the Rest tests removes runtime tests should should be moved to their respective runtimes runs the unicode tests over all the non-deprecated kinds per the runtime manifest
Additional cleanup of tests:
Also fixes #3845. See issue for details.
Description
Related issue and scope
My changes affect the following components
Types of changes
Checklist: