From 36bc1825adcfa48c257d44bbd2e41c98480a8bd0 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> Date: Mon, 18 Mar 2024 10:49:57 -0500 Subject: [PATCH] UI: Update README and localhost (#25959) * Update readme and localhost * finish the thought --- ui/README.md | 31 ++++++++++++++++--------------- ui/package.json | 6 +++--- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/ui/README.md b/ui/README.md index 89a9b097de..794b5dcf25 100644 --- a/ui/README.md +++ b/ui/README.md @@ -16,7 +16,7 @@ - [Running Tests](#running-tests) - [Linting](#linting) - [Contributing / Best Practices](#contributing--best-practices) - - [Further Reading / Useful Links](#further-reading--useful-links) + - [Further Reading / Useful Links](#further-reading--useful-links) @@ -109,14 +109,15 @@ setting `VAULT_UI` environment variable. ### Quick commands -| Command | Description | -| ------------------------------------- | ----------------------------------------------------------------------- | -| `yarn start` | start the app with live reloading | -| `yarn start:mirage ` | start the app with the mocked mirage backend, with handler provided | -| `make static-dist && make dev-ui` | build a Vault binary with UI assets (run from root directory not `/ui`) | -| `ember g component foo -ir core` | generate a component in the /addon engine | -| `yarn test:quick -f=''` -s | run tests in the browser, filtering by test name | -| `yarn lint:js` | lint javascript files | +| Command | Description | +| ------------------------------------------------- | ----------------------------------------------------------------------- | +| `yarn start` | start the app with live reloading (vault must be running on port :8200) | +| `export MIRAGE_DEV_HANDLER=; yarn start` | start the app with the mocked mirage backend, with handler provided | +| `make static-dist && make dev-ui` | build a Vault binary with UI assets (run from root directory not `/ui`) | +| `ember g component foo -ir core` | generate a component in the /addon engine | +| `yarn test:filter` | run non-enterprise in the browser | +| `yarn test:filter -f=''` | run tests in the browser, filtering by test name | +| `yarn lint:js` | lint javascript files | ### Code Generators @@ -132,13 +133,13 @@ The above command creates a template-only component by default. If you'd like to ### Running Tests -Running tests will spin up a Vault dev server on port :9200 via a -pretest script that testem (the test runner) executes. All of the -acceptance tests then run, which proxy requests back to that server. +Running tests will spin up a Vault dev server on port :9200 via a pretest script that testem (the test runner) executes. All of the acceptance tests then run, which proxy requests back to that server. The normal test scripts use `ember-exam` which split into parallel runs, which is excellent for speed but makes it harder to debug. So we have a custom yarn script that automatically opens all the tests in a browser, and we can pass the `-f` flag to target the test(s) we're debugging. -- `yarn run test:oss` -- `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 +- `yarn run test` lint & run all the tests (CI uses this) +- `yarn run test:oss` lint & run all the non-enterprise tests (CI uses this) +- `yarn run test:quick` run all the tests without linting +- `yarn run test:quick-oss` run all the non-enterprise tests without linting +- `yarn run test:filter -f="policies"` run the filtered test in the browser with no splitting. `-f` is set to `!enterprise` by default [QUnit's `filter` config](https://api.qunitjs.com/config/QUnit.config#qunitconfigfilter-string--default-undefined) ### Linting diff --git a/ui/package.json b/ui/package.json index 6ecb206c4e..a3bac7db3d 100644 --- a/ui/package.json +++ b/ui/package.json @@ -24,9 +24,9 @@ "fmt:js": "prettier --config .prettierrc.js --write '{app,tests,config,lib}/**/*.js'", "fmt:hbs": "prettier --config .prettierrc.js --write '**/*.hbs'", "fmt:styles": "prettier --write app/styles/**/*.*", - "start": "VAULT_ADDR=http://localhost:8200; ember server --proxy=$VAULT_ADDR", - "start2": "ember server --proxy=http://localhost:8202 --port=4202", - "start:chroot": "ember server --proxy=http://localhost:8300 --port=4300", + "start": "VAULT_ADDR=http://127.0.0.1:8200; ember server --proxy=$VAULT_ADDR", + "start2": "ember server --proxy=http://127.0.0.1:8202 --port=4202", + "start:chroot": "ember server --proxy=http://127.0.0.1:8300 --port=4300", "start:mirage": "start () { MIRAGE_DEV_HANDLER=$1 yarn run start; }; start", "test": "concurrently --kill-others-on-fail -P -c \"auto\" -n lint:js,lint:hbs,vault \"yarn:lint:js:quiet\" \"yarn:lint:hbs:quiet\" \"node scripts/start-vault.js {@}\" --", "test:enos": "concurrently --kill-others-on-fail -P -c \"auto\" -n lint:js,lint:hbs,enos \"yarn:lint:js:quiet\" \"yarn:lint:hbs:quiet\" \"node scripts/enos-test-ember.js {@}\" --",