parent
29aa85bdff
commit
4762806f16
28
.circleci/config.yml
generated
28
.circleci/config.yml
generated
@ -71,27 +71,6 @@ jobs:
|
||||
path: ui/test-results
|
||||
- store_test_results:
|
||||
path: ui/test-results
|
||||
test-ui-browserstack:
|
||||
docker:
|
||||
- environment:
|
||||
JOBS: 2
|
||||
image: docker.mirror.hashicorp.services/circleci/node:14-browsers
|
||||
shell: /usr/bin/env bash -euo pipefail -c
|
||||
working_directory: /home/circleci/go/src/github.com/hashicorp/vault
|
||||
resource_class: xlarge
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: yarn-lock-v7-{{ checksum "ui/yarn.lock" }}
|
||||
name: Restore yarn cache
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
command: |
|
||||
# Add ./bin to the PATH so vault binary can be found.
|
||||
export PATH="${PWD}"/bin:${PATH}
|
||||
make test-ui-browserstack
|
||||
name: Run Browserstack Tests
|
||||
build-go-dev:
|
||||
machine:
|
||||
image: ubuntu-2004:202201-02
|
||||
@ -1085,13 +1064,6 @@ workflows:
|
||||
requires:
|
||||
- install-ui-dependencies
|
||||
- build-go-dev
|
||||
- test-ui-browserstack:
|
||||
filters:
|
||||
branches:
|
||||
ignore: /pull\/[0-9]+/
|
||||
requires:
|
||||
- install-ui-dependencies
|
||||
- build-go-dev
|
||||
- test-go:
|
||||
requires:
|
||||
- pre-flight-checks
|
||||
|
@ -1,13 +0,0 @@
|
||||
executor: node
|
||||
resource_class: xlarge
|
||||
steps:
|
||||
- checkout
|
||||
- restore_yarn_cache
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Run Browserstack Tests
|
||||
command: |
|
||||
# Add ./bin to the PATH so vault binary can be found.
|
||||
export PATH="${PWD}"/bin:${PATH}
|
||||
make test-ui-browserstack
|
@ -14,14 +14,6 @@ jobs:
|
||||
# Only main, UI, release and merge branches need to run UI tests.
|
||||
# We don't filter here however because test-ui is configured in github as
|
||||
# required so it must run, instead we short-circuit within test-ui.
|
||||
- test-ui-browserstack:
|
||||
requires:
|
||||
- install-ui-dependencies
|
||||
- build-go-dev
|
||||
filters:
|
||||
branches:
|
||||
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
|
||||
ignore: /pull\/[0-9]+/
|
||||
- test-go:
|
||||
requires:
|
||||
- pre-flight-checks
|
||||
@ -39,5 +31,5 @@ jobs:
|
||||
requires:
|
||||
- pre-flight-checks
|
||||
- semgrep:
|
||||
requires:
|
||||
- pre-flight-checks
|
||||
requires:
|
||||
- pre-flight-checks
|
||||
|
14
Makefile
14
Makefile
@ -151,23 +151,11 @@ test-ember-enos: install-ui-dependencies
|
||||
@echo "--> Running ember tests with a real backend"
|
||||
@cd ui && yarn run test:enos
|
||||
|
||||
ember-ci-test: # Deprecated, to be removed soon.
|
||||
@echo "ember-ci-test is deprecated in favour of test-ui-browserstack"
|
||||
@exit 1
|
||||
|
||||
check-vault-in-path:
|
||||
@VAULT_BIN=$$(command -v vault) || { echo "vault command not found"; exit 1; }; \
|
||||
[ -x "$$VAULT_BIN" ] || { echo "$$VAULT_BIN not executable"; exit 1; }; \
|
||||
printf "Using Vault at %s:\n\$$ vault version\n%s\n" "$$VAULT_BIN" "$$(vault version)"
|
||||
|
||||
check-browserstack-creds:
|
||||
@[ -n "$$BROWSERSTACK_ACCESS_KEY" ] || { echo "BROWSERSTACK_ACCESS_KEY not set"; exit 1; }
|
||||
@[ -n "$$BROWSERSTACK_USERNAME" ] || { echo "BROWSERSTACK_USERNAME not set"; exit 1; }
|
||||
|
||||
test-ui-browserstack: check-vault-in-path check-browserstack-creds install-ui-dependencies
|
||||
@echo "--> Running ember tests in Browserstack"
|
||||
@cd ui && yarn run test:browserstack
|
||||
|
||||
ember-dist: install-ui-dependencies
|
||||
@cd ui && npm rebuild node-sass
|
||||
@echo "--> Building Ember application"
|
||||
@ -259,7 +247,7 @@ ci-config:
|
||||
ci-verify:
|
||||
@$(MAKE) -C .circleci ci-verify
|
||||
|
||||
.PHONY: bin default prep test vet bootstrap ci-bootstrap fmt fmtcheck mysql-database-plugin mysql-legacy-database-plugin cassandra-database-plugin influxdb-database-plugin postgresql-database-plugin mssql-database-plugin hana-database-plugin mongodb-database-plugin ember-dist ember-dist-dev static-dist static-dist-dev assetcheck check-vault-in-path check-browserstack-creds test-ui-browserstack packages build build-ci semgrep semgrep-ci
|
||||
.PHONY: bin default prep test vet bootstrap ci-bootstrap fmt fmtcheck mysql-database-plugin mysql-legacy-database-plugin cassandra-database-plugin influxdb-database-plugin postgresql-database-plugin mssql-database-plugin hana-database-plugin mongodb-database-plugin ember-dist ember-dist-dev static-dist static-dist-dev assetcheck check-vault-in-path packages build build-ci semgrep semgrep-ci
|
||||
|
||||
.NOTPARALLEL: ember-dist ember-dist-dev
|
||||
|
||||
|
20
ui/README.md
20
ui/README.md
@ -1,15 +1,15 @@
|
||||
**Table of Contents**
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
- [Vault UI](#vault-ui)
|
||||
- [Ember CLI Version Matrix](#ember-cli-version-matrix)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Running a Vault Server](#running-a-vault-server)
|
||||
- [Running / Development](#running--development)
|
||||
- [Code Generators](#code-generators)
|
||||
- [Running Tests](#running-tests)
|
||||
- [Automated Cross-Browser Testing](#automated-cross-browser-testing)
|
||||
- [Running Browserstack Locally](#running-browserstack-locally)
|
||||
- [Linting](#linting)
|
||||
- [Building Vault UI into a Vault Binary](#building-vault-ui-into-a-vault-binary)
|
||||
- [Further Reading / Useful Links](#further-reading--useful-links)
|
||||
@ -106,17 +106,6 @@ acceptance tests then run, proxing requests back to that server.
|
||||
- `yarn run test:oss -s` to keep the test server running after the initial run.
|
||||
- `yarn run test -f="policies"` to filter the tests that are run. `-f` gets passed into
|
||||
[QUnit's `filter` config](https://api.qunitjs.com/config/QUnit.config#qunitconfigfilter-string--default-undefined)
|
||||
- `yarn run test:browserstack` to run the kv acceptance tests in Browserstack
|
||||
|
||||
#### Automated Cross-Browser Testing
|
||||
|
||||
Vault uses [Browserstack Automate](https://automate.browserstack.com/) to run all the kv acceptance tests on various browsers. You can view the list of browsers we test by viewing `testem.browserstack.js`.
|
||||
|
||||
##### Running Browserstack Locally
|
||||
|
||||
To run the Browserstack tests locally you will need to add your `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` to your environment. Then run `yarn run test:browserstack`. You can view the currently running tests at `localhost:7357` or log in to [Browserstack Automate](https://automate.browserstack.com/) to view a previous build.
|
||||
|
||||
To run the tests locally in a browser other than IE11, swap out `launch_in_ci: ['BS_IE_11']` inside `testem.browserstack.js`.
|
||||
|
||||
### Linting
|
||||
|
||||
@ -143,4 +132,3 @@ setting `VAULT_UI` environment variable.
|
||||
- Development Browser Extensions
|
||||
- [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
|
||||
- [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)
|
||||
- [Browserstack Automate](https://automate.browserstack.com/)
|
||||
|
@ -28,7 +28,6 @@
|
||||
"test": "npm-run-all lint:js:quiet lint:hbs:quiet && node scripts/start-vault.js",
|
||||
"test:enos": "npm-run-all lint:js:quiet lint:hbs:quiet && node scripts/enos-test-ember.js",
|
||||
"test:oss": "yarn run test -f='!enterprise'",
|
||||
"test:browserstack": "export CI=true; node scripts/start-vault.js --browserstack",
|
||||
"test:quick": "node scripts/start-vault.js",
|
||||
"test:quick-oss": "yarn test:quick -f='!enterprise'",
|
||||
"vault": "VAULT_REDIRECT_ADDR=http://127.0.0.1:8200 vault server -log-level=error -dev -dev-root-token-id=root -dev-ha -dev-transactional",
|
||||
@ -84,14 +83,13 @@
|
||||
"date-fns": "^2.16.1",
|
||||
"date-fns-tz": "^1.2.2",
|
||||
"deepmerge": "^4.0.0",
|
||||
"doctoc": "^1.4.0",
|
||||
"doctoc": "^2.2.0",
|
||||
"ember-api-actions": "^0.2.8",
|
||||
"ember-auto-import": "2.4.2",
|
||||
"ember-basic-dropdown": "4.0.3",
|
||||
"ember-cli": "~3.28.5",
|
||||
"ember-cli-autoprefixer": "^0.8.1",
|
||||
"ember-cli-babel": "^7.26.10",
|
||||
"ember-cli-browserstack": "2.0.1",
|
||||
"ember-cli-clipboard": "^0.13.0",
|
||||
"ember-cli-content-security-policy": "^1.0.0",
|
||||
"ember-cli-dependency-checker": "^3.2.0",
|
||||
|
@ -64,22 +64,7 @@ async function processLines(input, eachLine = () => {}) {
|
||||
}
|
||||
});
|
||||
try {
|
||||
if (process.argv[2] === '--browserstack') {
|
||||
await testHelper.run('ember', ['browserstack:connect']);
|
||||
try {
|
||||
await testHelper.run('ember', ['test', '-f=secrets/secret/create', '-c', 'testem.browserstack.js']);
|
||||
|
||||
console.log('success');
|
||||
process.exit(0);
|
||||
} finally {
|
||||
if (process.env.CI === 'true') {
|
||||
await testHelper.run('ember', ['browserstack:results']);
|
||||
}
|
||||
await testHelper.run('ember', ['browserstack:disconnect']);
|
||||
}
|
||||
} else {
|
||||
await testHelper.run('ember', ['test', ...process.argv.slice(2)]);
|
||||
}
|
||||
await testHelper.run('ember', ['test', ...process.argv.slice(2)]);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
process.exit(1);
|
||||
|
@ -1,92 +0,0 @@
|
||||
/* eslint-env node */
|
||||
|
||||
module.exports = {
|
||||
framework: 'qunit',
|
||||
test_page: 'tests/index.html?hidepassed&nolint',
|
||||
tap_quiet_logs: true,
|
||||
disable_watching: true,
|
||||
timeout: 1200,
|
||||
browser_start_timeout: 2000,
|
||||
parallel: 4,
|
||||
launchers: {
|
||||
BS_Chrome_Current: {
|
||||
exe: 'node_modules/.bin/browserstack-launch',
|
||||
args: [
|
||||
'--os',
|
||||
'Windows',
|
||||
'--osv',
|
||||
'10',
|
||||
'--b',
|
||||
'chrome',
|
||||
'--bv',
|
||||
'latest',
|
||||
'-t',
|
||||
'1200',
|
||||
'--u',
|
||||
'<url>',
|
||||
],
|
||||
protocol: 'browser',
|
||||
},
|
||||
BS_Firefox_Current: {
|
||||
exe: 'node_modules/.bin/browserstack-launch',
|
||||
args: [
|
||||
'--os',
|
||||
'Windows',
|
||||
'--osv',
|
||||
'10',
|
||||
'--b',
|
||||
'firefox',
|
||||
'--bv',
|
||||
'latest',
|
||||
'-t',
|
||||
'1200',
|
||||
'--u',
|
||||
'<url>',
|
||||
],
|
||||
protocol: 'browser',
|
||||
},
|
||||
BS_Safari_Current: {
|
||||
exe: 'node_modules/.bin/browserstack-launch',
|
||||
args: [
|
||||
'--os',
|
||||
'OS X',
|
||||
'--osv',
|
||||
'Mojave',
|
||||
'--b',
|
||||
'safari',
|
||||
'--bv',
|
||||
'latest',
|
||||
'-t',
|
||||
'1200',
|
||||
'--u',
|
||||
'<url>',
|
||||
],
|
||||
protocol: 'browser',
|
||||
},
|
||||
BS_IE_11: {
|
||||
exe: 'node_modules/.bin/browserstack-launch',
|
||||
args: [
|
||||
'--os',
|
||||
'Windows',
|
||||
'--osv',
|
||||
'8.1',
|
||||
'--b',
|
||||
'ie',
|
||||
'--bv',
|
||||
'11.0',
|
||||
'-t',
|
||||
'1200',
|
||||
'--u',
|
||||
'<url>&legacy=true',
|
||||
],
|
||||
protocol: 'browser',
|
||||
},
|
||||
},
|
||||
launch_in_dev: [],
|
||||
launch_in_ci: ['BS_Firefox_Current'],
|
||||
proxies: {
|
||||
'/v1': {
|
||||
target: 'http://localhost:9200',
|
||||
},
|
||||
},
|
||||
};
|
@ -614,7 +614,6 @@ module('Acceptance | secrets/secret/create', function (hooks) {
|
||||
'They do not have list access so when logged in under the restricted policy they see the get-credentials-card'
|
||||
);
|
||||
|
||||
// this fails in IE11 on browserstack so going directly to URL
|
||||
await visit(`/vault/secrets/${enginePath}/show/${secretPath}`);
|
||||
|
||||
await assert
|
||||
|
676
ui/yarn.lock
676
ui/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user