-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
UI/ Add PostgreSQL DB #12945
UI/ Add PostgreSQL DB #12945
Changes from all commits
77fd9d4
7936a65
058ebc1
ae6d90b
6d297a8
8e203a6
4616dd0
c9acbeb
60d2c7d
34d0b53
ed3ddb2
cd6204f
85afe1c
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:feature | ||
**Postgres in the UI**: Postgres DB is now supported by the UI | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,6 +185,31 @@ const connectionTests = [ | |
.exists(`Root rotation statements exists for ${name}`); | ||
}, | ||
}, | ||
{ | ||
name: 'postgresql-connection', | ||
plugin: 'postgresql-database-plugin', | ||
url: `postgresql://{{username}}:{{password}}@localhost:5432/postgres?sslmode=disable`, | ||
requiredFields: async (assert, name) => { | ||
assert.dom('[data-test-input="username"]').exists(`Username field exists for ${name}`); | ||
assert.dom('[data-test-input="password"]').exists(`Password field exists for ${name}`); | ||
assert | ||
.dom('[data-test-input="max_open_connections"]') | ||
.exists(`Max open connections exists for ${name}`); | ||
assert | ||
.dom('[data-test-input="max_idle_connections"]') | ||
.exists(`Max idle connections exists for ${name}`); | ||
assert | ||
.dom('[data-test-input="max_connection_lifetime"]') | ||
.exists(`Max connection lifetime exists for ${name}`); | ||
assert | ||
.dom('[data-test-input="root_rotation_statements"]') | ||
.exists(`Root rotation statements exists for ${name}`); | ||
assert | ||
.dom('[data-test-toggle-input="show-username_template"]') | ||
.exists(`Username template toggle exists for ${name}`); | ||
}, | ||
}, | ||
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. Tests fail when Oracle isn't the last database - since actually connecting Oracle is skipped after checking that the fields exist, the test doesn't redirect to the connection list page and start the connecting a database process over. (And the test checks for an empty state when no DB is selected) |
||
// keep oracle as last DB because it is skipped in some tests (line 285) the UI doesn't return to empty state after | ||
{ | ||
name: 'oracle-connection', | ||
plugin: 'oracle-database-plugin', | ||
|
@@ -256,17 +281,17 @@ module('Acceptance | secrets/database/*', function(hooks) { | |
} else { | ||
await connectionPage.connectionUrl(testCase.url); | ||
} | ||
// skip adding oracle db connection since plugin doesn't exists | ||
// skip adding oracle db connection since plugin doesn't exist | ||
if (testCase.plugin === 'oracle-database-plugin') { | ||
testCase.requiredFields(assert, testCase.name); | ||
continue; | ||
} | ||
testCase.requiredFields(assert, testCase.name); | ||
await connectionPage.toggleVerify(); | ||
await connectionPage.save(); | ||
await connectionPage.enable(); | ||
await settled(); | ||
assert | ||
.dom('[data-test-modal-title]') | ||
.dom('.modal.is-active .title') | ||
.hasText('Rotate your root credentials?', 'Modal appears asking to rotate root credentials'); | ||
await connectionPage.enable(); | ||
assert.ok( | ||
|
@@ -335,8 +360,9 @@ module('Acceptance | secrets/database/*', function(hooks) { | |
// uncheck verify for the save step to work | ||
await connectionPage.toggleVerify(); | ||
await connectionPage.save(); | ||
await settled(); | ||
assert | ||
.dom('[data-test-modal-title]') | ||
.dom('.modal.is-active .title') | ||
.hasText('Rotate your root credentials?', 'Modal appears asking to '); | ||
await connectionPage.enable(); | ||
assert.equal( | ||
|
@@ -356,6 +382,13 @@ module('Acceptance | secrets/database/*', function(hooks) { | |
} | ||
}); | ||
await connectionPage.delete(); | ||
assert | ||
.dom('.modal.is-active .title') | ||
.hasText('Delete connection?', 'Modal appears asking to confirm delete action'); | ||
await fillIn('[data-test-confirmation-modal-input="delete"]', connectionDetails.id); | ||
await click('[data-test-confirm-button]'); | ||
await settled(); | ||
|
||
assert.equal(currentURL(), `/vault/secrets/${backend}/list`, 'Redirects to connection list page'); | ||
assert | ||
.dom('[data-test-empty-state-title') | ||
|
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.
Moved elasticsearch to the top because alphabetized plugin list