-
Notifications
You must be signed in to change notification settings - Fork 29
Add IoT Metrics Support #680
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
Changes from 36 commits
7146c33
60ae90e
9ca5d2d
daeaf35
c5dcafb
2ecc0b4
ff625a4
34f5f77
6bf3e55
33676ad
c48c9cb
c839553
9f4d041
e7eee32
d2d68b0
402af38
5744019
503b0be
ddde402
34952e5
c9cc6b9
0a38686
969d97e
956dbbe
6727fd3
93fcba5
892c18f
ec06c63
1823b66
16fd073
970dfd1
f06e2b9
efadb0c
196522d
21c9c5d
6c8b2dc
7693055
c831255
d20b464
7a8dc39
31c2f13
b1cb699
51fa175
49e421a
22c7c27
0486d91
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 |
|---|---|---|
|
|
@@ -82,12 +82,40 @@ test_env.conditional_test(test_env.AWS_IOT_ENV.mqtt311_is_valid_direct_auth_mqtt | |
| clean_session: true, | ||
| username: test_env.AWS_IOT_ENV.MQTT311_BASIC_AUTH_USERNAME, | ||
| password: test_env.AWS_IOT_ENV.MQTT311_BASIC_AUTH_PASSWORD, | ||
| socket_options: new SocketOptions() | ||
| socket_options: new SocketOptions(), | ||
| enable_metrics: false | ||
| } | ||
| await test_connection(config, new MqttClient(new ClientBootstrap())); | ||
| }) | ||
| }); | ||
|
|
||
| test_env.conditional_test(test_env.AWS_IOT_ENV.mqtt311_is_valid_direct_auth_mqtt())('MQTT311 Connection - basic auth with metrics', async () => { | ||
|
Contributor
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. Can we do this against IoT Core; as it stands this will only get run in codebuild
Contributor
Author
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. The test cannot run against IoT Core, as IoT Core will rule out the metrics string. The test actually uses the connection failure to verify that the metrics are appended. |
||
| await retry.networkTimeoutRetryWrapper( async () => { | ||
| const config: MqttConnectionConfig = { | ||
| client_id: `node-mqtt-unit-test-${uuid()}`, | ||
| host_name: test_env.AWS_IOT_ENV.MQTT311_DIRECT_AUTH_MQTT_HOST, | ||
| port: parseInt(test_env.AWS_IOT_ENV.MQTT311_DIRECT_AUTH_MQTT_PORT), | ||
| clean_session: true, | ||
| username: test_env.AWS_IOT_ENV.MQTT311_BASIC_AUTH_USERNAME, | ||
| password: test_env.AWS_IOT_ENV.MQTT311_BASIC_AUTH_PASSWORD, | ||
| socket_options: new SocketOptions(), | ||
| enable_metrics: true | ||
| } | ||
|
|
||
| const client = new MqttClient(new ClientBootstrap()) | ||
| const connection = client.new_connection(config); | ||
|
|
||
| let onConnectionFailureCalled = false; | ||
| connection.on('connection_failure', async (callback_data) => { | ||
| onConnectionFailureCalled = true; | ||
| }) | ||
|
|
||
| const connected = connection.connect(); | ||
| await expect(connected).rejects.toBeDefined(); | ||
| await expect(onConnectionFailureCalled).toBeTruthy(); | ||
| }) | ||
| }); | ||
|
|
||
| test_env.conditional_test(test_env.AWS_IOT_ENV.mqtt311_is_valid_direct_tls_mqtt())('MQTT311 Connection - TLS', async () => { | ||
| await retry.networkTimeoutRetryWrapper( async () => { | ||
| const tls_ctx_options = new TlsContextOptions(); | ||
|
|
@@ -194,7 +222,8 @@ test_env.conditional_test(test_env.AWS_IOT_ENV.mqtt311_is_valid_ws_auth_mqtt())( | |
| use_websocket: true, | ||
| username: test_env.AWS_IOT_ENV.MQTT311_BASIC_AUTH_USERNAME, | ||
| password: test_env.AWS_IOT_ENV.MQTT311_BASIC_AUTH_PASSWORD, | ||
| socket_options: new SocketOptions() | ||
| socket_options: new SocketOptions(), | ||
| enable_metrics: false | ||
| } | ||
| config.websocket_handshake_transform = async (request, done) => { | ||
| done(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.