Skip to content
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

Websocket Integration Tests #778

Closed

Conversation

computerpunc
Copy link
Contributor

@computerpunc computerpunc commented Aug 13, 2019

Currently, WebSocket has 35 tests that are not part of npm run test.
This PR will make the WebSocket tests be part of the regular testing flow.

To Do:

  • Remove dependancy on running npm link in order use current branch serverless-offline in testing.
  • Remove dependancy on running local DynamoDB instance for testing.
  • Move from __test__/manual/websocket to __test__/integration/websocket.
  • Use jest instead of mocha as a testing platform.
  • After Authorizer support in Websocket #732 is merged into master, prepare this PR for merge.

Added the plugin source to the project and changed the way the plugin handles auth.
Also, fixed  'should not open a connection when has an exception in connect function'.
doAction now returns a promise.
… into websocket-fixes-authorizer

# Conflicts:
#	manual_test_websocket/RouteSelection/scripts/deploy_to_aws.sh
#	manual_test_websocket/main/handler.js
#	manual_test_websocket/main/scripts/deploy_to_offline.sh
#	manual_test_websocket/main/test/e2e/ws.e2e.js
#	manual_test_websocket/main/test/support/WebSocketTester.js
#	package-lock.json
#	src/ApiGatewayWebSocket.js
#	src/__tests__/manual/websocket/RouteSelection/handler.js
#	src/__tests__/manual/websocket/RouteSelection/scripts/deploy_to_aws.sh
#	src/__tests__/manual/websocket/RouteSelection/scripts/deploy_to_offline.sh
#	src/__tests__/manual/websocket/RouteSelection/scripts/serverless.offline.yml
#	src/__tests__/manual/websocket/RouteSelection/test/e2e/ws.e2e.js
#	src/__tests__/manual/websocket/RouteSelection/test/support/WebSocketTester.js
#	src/__tests__/manual/websocket/main/scripts/deploy_to_aws.sh
#	src/__tests__/manual/websocket/main/scripts/deploy_to_offline.sh
#	src/__tests__/manual/websocket/main/test/support/WebSocketTester.js
#	src/__tests__/manual/websocket/scripts/deploy_to_aws.sh
#	src/__tests__/manual/websocket/scripts/deploy_to_offline.sh
#	src/__tests__/manual/websocket/test/support/WebSocketTester.js
#	src/index.js
#	src/websocketHelpers.js
… into websocket-fixes-authorizer

# Conflicts:
#	src/ApiGatewayWebSocket.js
Support authorizers.
fix a few typos
Depolyment and tests are run based on category.
@computerpunc
Copy link
Contributor Author

@dnalborczyk

This PR continues where #732 left-off.

Before continuing with this PR, I'll wait for #732 to be merged into master (via your branch).

This updated PR, in comparison to #732, contains only improvements to WebSocket testing. I've simplified testing by removing the need to use npm link and serverless=dynamodb-local.

So if you want, you can merge this PR to your branch and see if WebSocket testing works for you.

In order to run the tests, you now only have to go to ./src/__tests__/manual/websocket and then :

  • npm i
  • Set you AWS credentials. I use export AWS_PROFILE=XXXXX.
  • npm run test-e2e.

You can view logs in ./src/__tests__/manual/websocket/.logs folder.
The read me file is located at ./src/__tests__/manual/websocket/README.md.

If you still have problems, I'll try to help.

@dnalborczyk
Copy link
Collaborator

@computerpunc I'm still planning on pulling this in! Mind if I re-open?

@computerpunc computerpunc mentioned this pull request Sep 2, 2019
4 tasks
@dnalborczyk dnalborczyk reopened this Sep 8, 2019
@dnalborczyk
Copy link
Collaborator

#732 (comment) and #732 (comment)

@computerpunc
Copy link
Contributor Author

@dnalborczyk

If there is no planed refactoring effort, how about I open a new PR based on alpha and add there WebSocket integration tests?

@dnalborczyk
Copy link
Collaborator

hey @computerpunc ! that would be absolutely fantastic!

I'm still refactoring, but I leave the test folder structure alone until your PR is merged, I promise!
whichever tests are failing you could just test.skip 'em for now.

@computerpunc
Copy link
Contributor Author

I'm still refactoring, but I leave the test folder structure alone until your PR is merged, I promise!

Thanks

whichever tests are failing you could just test.skip 'em for now.

Will do

@computerpunc
Copy link
Contributor Author

This PR will continue in #814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants