-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix CDK deployment #34
Merged
Merged
Changes from all commits
Commits
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 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
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
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
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
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 |
---|---|---|
@@ -1,37 +1,46 @@ | ||
import {parseNeptuneDomainFromEndpoint, parseNeptuneDomainFromHost, parseNeptuneGraphName} from '../util.js'; | ||
import {parseNeptuneDomainFromHost, parseNeptuneEndpoint} from '../util.js'; | ||
|
||
test('parse domain from neptune cluster host', () => { | ||
expect(parseNeptuneDomainFromHost('db-neptune-abc-def.cluster-xyz.us-west-2.neptune.amazonaws.com')).toBe('neptune.amazonaws.com'); | ||
expect(parseNeptuneDomainFromHost('db-neptune-abc-def.cluster-xyz.us-west-2.neptune.amazonaws.com')) | ||
.toBe('neptune.amazonaws.com'); | ||
}); | ||
|
||
test('parse domain from neptune analytics host', () => { | ||
expect(parseNeptuneDomainFromHost('g-abcdef.us-west-2.neptune-graph.amazonaws.com')).toBe('neptune-graph.amazonaws.com'); | ||
expect(parseNeptuneDomainFromHost('g-abcdef.us-west-2.neptune-graph.amazonaws.com')) | ||
.toBe('neptune-graph.amazonaws.com'); | ||
}); | ||
|
||
test('parse domain from host without enough parts throws error', () => { | ||
expect(() => parseNeptuneDomainFromHost('invalid.com')).toThrow('Cannot parse neptune host invalid.com because it has 2 part(s) delimited by . but expected at least 5'); | ||
expect(() => parseNeptuneDomainFromHost('invalid.com')) | ||
.toThrow('Cannot parse neptune host invalid.com because it has 2 part(s) delimited by . but expected at least 5'); | ||
}); | ||
|
||
test('parse domain from neptune cluster endpoint', () => { | ||
expect(parseNeptuneDomainFromEndpoint('db-neptune-abc-def.cluster-xyz.us-west-2.neptune.amazonaws.com:8182')).toBe('neptune.amazonaws.com'); | ||
test('parse neptune db endpoint', () => { | ||
let neptuneInfo = parseNeptuneEndpoint('db-neptune-abc-def.cluster-xyz.us-west-2.neptune.amazonaws.com:8182'); | ||
expect(neptuneInfo).toHaveProperty('port', '8182'); | ||
expect(neptuneInfo).toHaveProperty('host', 'db-neptune-abc-def.cluster-xyz.us-west-2.neptune.amazonaws.com'); | ||
expect(neptuneInfo).toHaveProperty('domain', 'neptune.amazonaws.com'); | ||
expect(neptuneInfo).toHaveProperty('region', 'us-west-2'); | ||
expect(neptuneInfo).toHaveProperty('graphName', 'db-neptune-abc-def'); | ||
expect(neptuneInfo).toHaveProperty('neptuneType', 'neptune-db'); | ||
}); | ||
|
||
test('parse domain from neptune analytics endpoint', () => { | ||
expect(parseNeptuneDomainFromEndpoint('g-abcdef.us-west-2.neptune-graph.amazonaws.com:8182')).toBe('neptune-graph.amazonaws.com'); | ||
test('parse neptune analytics endpoint', () => { | ||
let neptuneInfo = parseNeptuneEndpoint('g-abcdef.us-east-1.neptune-graph.amazonaws.com:8183'); | ||
expect(neptuneInfo).toHaveProperty('port', '8183'); | ||
expect(neptuneInfo).toHaveProperty('host', 'g-abcdef.us-east-1.neptune-graph.amazonaws.com'); | ||
expect(neptuneInfo).toHaveProperty('domain', 'neptune-graph.amazonaws.com'); | ||
expect(neptuneInfo).toHaveProperty('region', 'us-east-1'); | ||
expect(neptuneInfo).toHaveProperty('graphName', 'g-abcdef'); | ||
expect(neptuneInfo).toHaveProperty('neptuneType', 'neptune-graph'); | ||
}); | ||
|
||
test('parse domain from endpoint without enough parts throws error', () => { | ||
expect(() => parseNeptuneDomainFromEndpoint('g-abcdef.us-west-2.neptune-graph.amazonaws.com')).toThrow('Cannot parse domain from neptune endpoint g-abcdef.us-west-2.neptune-graph.amazonaws.com because it has 1 part(s) delimited by : but expected 2'); | ||
test('parse neptune endpoint without port throws error', () => { | ||
expect(() => parseNeptuneEndpoint('db-neptune-abc-def.cluster-xyz.us-west-2.neptune.amazonaws.com')) | ||
.toThrow('Cannot parse neptune endpoint db-neptune-abc-def.cluster-xyz.us-west-2.neptune.amazonaws.com because it is not in expected format of host:port'); | ||
}); | ||
|
||
test('parse name from neptune cluster host', () => { | ||
expect(parseNeptuneGraphName('db-neptune-abc-def.cluster-xyz.us-west-2.neptune.amazonaws.com')).toBe('db-neptune-abc-def'); | ||
}); | ||
|
||
test('parse name from neptune analytics host', () => { | ||
expect(parseNeptuneGraphName('g-abcdef.us-west-2.neptune-graph.amazonaws.com')).toBe('g-abcdef'); | ||
}); | ||
|
||
test('parse name from host without enough parts throws error', () => { | ||
expect(() => parseNeptuneGraphName('invalid.com')).toThrow('Cannot parse neptune host invalid.com because it has 2 part(s) delimited by . but expected at least 5'); | ||
test('parse neptune endpoint not enough parts in domain throws error', () => { | ||
expect(() => parseNeptuneEndpoint('invalid.com:1234')) | ||
.toThrow('Cannot parse neptune host invalid.com because it has 2 part(s) delimited by . but expected at least 5'); | ||
}); |
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.
nice