-
Notifications
You must be signed in to change notification settings - Fork 69
Smoke tests #42
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
Merged
Merged
Smoke tests #42
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
e41d38d
added kafka consumer ready check, added smoke tests setup, test cases…
mmacai b0d83bb
Merge branch 'master' into smoke-tests
mmacai 1128b32
added kafka consumer ready check info to changelog
mmacai 67a36cd
moved smoke tests setup to separate folder
mmacai 5675010
Merge branch 'master' into smoke-tests
mmacai d6d78f5
fixed typo in tests
mmacai ca3e690
fixed compilation warning with function headers
mmacai eea2f54
revamped typespec for kafka ready check function definitions
mmacai bc41acb
switched kafka ready check header with typespec
mmacai 611d644
updated formatting for kafka ready check typespec
mmacai fd93108
formatted group subscriber file
mmacai 966a07b
fixed kafka ready check log wording
mmacai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| [ | ||
| { | ||
| "id": "smoke-service", | ||
| "name": "smoke-service", | ||
| "auth_type": "none", | ||
| "auth": { | ||
| "use_header": false, | ||
| "header_name": "", | ||
| "use_query": false, | ||
| "query_name": "" | ||
| }, | ||
| "versioned": false, | ||
| "version_data": { | ||
| "default": { | ||
| "endpoints": [ | ||
| { | ||
| "id": "get", | ||
| "path": "/api", | ||
| "method": "GET", | ||
| "not_secured": true | ||
| }, | ||
| { | ||
| "id": "post", | ||
| "path": "/api", | ||
| "method": "POST", | ||
| "not_secured": true | ||
| }, | ||
| { | ||
| "id": "put", | ||
| "path": "/api", | ||
| "method": "PUT", | ||
| "not_secured": true | ||
| }, | ||
| { | ||
| "id": "patch", | ||
| "path": "/api", | ||
| "method": "PATCH", | ||
| "not_secured": true | ||
| }, | ||
| { | ||
| "id": "delete", | ||
| "path": "/api", | ||
| "method": "DELETE", | ||
| "not_secured": true | ||
| }, | ||
| { | ||
| "id": "head", | ||
| "path": "/api", | ||
| "method": "HEAD", | ||
| "not_secured": true | ||
| }, | ||
| { | ||
| "id": "options", | ||
| "path": "/api", | ||
| "method": "OPTIONS", | ||
| "not_secured": true | ||
| }, | ||
| { | ||
| "id": "post-kafka-produce", | ||
| "path": "/kafka/produce", | ||
| "method": "POST", | ||
| "not_secured": true | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| "proxy": { | ||
| "use_env": true, | ||
| "target_url": "API_HOST", | ||
| "port": 8000 | ||
| } | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,4 @@ | ||
| ExUnit.start() | ||
| # Exclude all smoke tests from running by default | ||
| ExUnit.configure exclude: [smoke: true] | ||
| Application.ensure_all_started(:bypass) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
apps/rig_outbound_gateway/test/kafka/group_subscriber_test.exs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| defmodule RigOutboundGateway.Kafka.GroupSubscriberTest do | ||
| @moduledoc false | ||
| use ExUnit.Case, async: true | ||
| alias RigOutboundGateway.Kafka.GroupSubscriber | ||
|
|
||
| @tag :smoke | ||
| test "kafka consumer connection should be correctly established" do | ||
| assert GroupSubscriber.wait_for_consumer_ready("rig", 0) == { | ||
| :ok, | ||
| "Consumer for topic: rig and partition: 0 is ready." | ||
| } | ||
| end | ||
|
|
||
| @tag :smoke | ||
| test "kafka consumer connection should fail with wrong topic" do | ||
| assert GroupSubscriber.wait_for_consumer_ready("bad", 0, 5000) == { | ||
| :error, | ||
| "Consumer ready check for topic: bad and partition: 0 timeouted." | ||
| } | ||
| end | ||
|
|
||
| @tag :smoke | ||
| test "kafka consumer connection should fail with wrong partition" do | ||
| assert GroupSubscriber.wait_for_consumer_ready("rig", 1, 5000) == { | ||
| :error, | ||
| "Consumer ready check for topic: rig and partition: 1 timeouted." | ||
| } | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| ExUnit.start() | ||
| # Exclude all smoke tests from running by default | ||
| ExUnit.configure exclude: [smoke: true] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
just a minor comment about the two specs: having one spec per function clause is optional and makes perfect sense if there something like "if I put a String.t in there, I get a String.t out, but if I put an atom in there, it'll be an atom" (you get the idea). However, in this case I feel it would be clearer (and less to write/read/maintain) to have just one combined spec, as I don't see any gain in expressing the same thing using two lines:
What do you think?
PS: I think
integerhere should actually benon_neg_integer()in both cases