-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add assertion and connection error reporters to TCP checks [sc-…
…23082] (#1014) * feat: add fixtures for various failing TCP checks - no tests yet * feat: add assertion and connection error reporters to TCP checks
- Loading branch information
Showing
3 changed files
with
239 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
packages/cli/e2e/__tests__/fixtures/tcp-check-failures/checkly.config.ts
This file contains 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,6 @@ | ||
const config = { | ||
projectName: 'TCP Check Failures', | ||
logicalId: process.env.PROJECT_LOGICAL_ID, | ||
repoUrl: 'https://github.com/checkly/checkly-cli', | ||
} | ||
export default config |
72 changes: 72 additions & 0 deletions
72
packages/cli/e2e/__tests__/fixtures/tcp-check-failures/tcp.check.ts
This file contains 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,72 @@ | ||
/* eslint-disable no-new */ | ||
import { TcpCheck, TcpAssertionBuilder } from 'checkly/constructs' | ||
|
||
new TcpCheck('tcp-check-dns-failure-ipv4', { | ||
name: 'TCP check with DNS lookup failure (IPv4)', | ||
activated: true, | ||
request: { | ||
hostname: 'does-not-exist.checklyhq.com', | ||
port: 443, | ||
}, | ||
}) | ||
|
||
new TcpCheck('tcp-check-dns-failure-ipv6', { | ||
name: 'TCP check with DNS lookup failure (IPv6)', | ||
activated: true, | ||
request: { | ||
hostname: 'does-not-exist.checklyhq.com', | ||
port: 443, | ||
ipFamily: 'IPv6', | ||
}, | ||
}) | ||
|
||
new TcpCheck('tcp-check-connection-refused', { | ||
name: 'TCP check for connection that gets refused', | ||
activated: true, | ||
request: { | ||
hostname: '127.0.0.1', | ||
port: 12345, | ||
}, | ||
}) | ||
|
||
new TcpCheck('tcp-check-connection-refused-2', { | ||
name: 'TCP check for connection that gets refused #2', | ||
activated: true, | ||
request: { | ||
hostname: '0.0.0.0', | ||
port: 12345, | ||
}, | ||
}) | ||
|
||
new TcpCheck('tcp-check-timed-out', { | ||
name: 'TCP check for connection that times out', | ||
activated: true, | ||
request: { | ||
hostname: 'api.checklyhq.com', | ||
port: 9999, | ||
}, | ||
}) | ||
|
||
new TcpCheck('tcp-check-failing-assertions', { | ||
name: 'TCP check with failing assertions', | ||
activated: true, | ||
request: { | ||
hostname: 'api.checklyhq.com', | ||
port: 80, | ||
data: 'GET / HTTP/1.1\r\nHost: api.checklyhq.com\r\nConnection: close\r\n\r\n', | ||
assertions: [ | ||
TcpAssertionBuilder.responseData().contains('NEVER_PRESENT'), | ||
TcpAssertionBuilder.responseTime().lessThan(1), | ||
], | ||
}, | ||
}) | ||
|
||
new TcpCheck('tcp-check-wrong-ip-family', { | ||
name: 'TCP check with wrong IP family', | ||
activated: true, | ||
request: { | ||
hostname: 'ipv4.google.com', | ||
port: 80, | ||
ipFamily: 'IPv6', | ||
}, | ||
}) |
This file contains 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