github.com/judwhite/consul@v1.4.4-0.20190315202039-6ef970a191d3/ui-v2/README.md (about)

     1  # consul-ui
     2  
     3  
     4  ## Prerequisites
     5  
     6  You will need the following things properly installed on your computer.
     7  
     8  * [Git](https://git-scm.com/)
     9  * [Node.js](https://nodejs.org/) (with npm)
    10  * [yarn](https://yarnpkg.com)
    11  * [Ember CLI](https://ember-cli.com/)
    12  * [Google Chrome](https://google.com/chrome/)
    13  
    14  ## Installation
    15  
    16  * `git clone https://github.com/hashicorp/consul.git` this repository
    17  * `cd ui-v2`
    18  * `yarn install`
    19  
    20  ## Running / Development
    21  
    22  The source code comes with a small server that runs enough of the consul API
    23  as a set of mocks/fixtures to be able to run the UI without having to run
    24  consul.
    25  
    26  * `make start-api` or `yarn start:api` (this starts a Consul API double running
    27  on http://localhost:3000)
    28  * `make start` or `yarn start` to start the ember app that connects to the
    29  above API double
    30  * Visit your app at [http://localhost:4200](http://localhost:4200).
    31  
    32  To enable ACLs using the mock API, use Web Inspector to set a cookie as follows:
    33  
    34  ```
    35  CONSUL_ACLS_ENABLE=1
    36  ```
    37  
    38  This will enable the ACLs login page, to which you can login with any ACL
    39  token/secret.
    40  
    41  You can also use a number of other cookie key/values to set various things whilst
    42  developing the UI, such as (but not limited to):
    43  
    44  ```
    45  CONSUL_SERVICE_COUNT=1000
    46  CONSUL_NODE_CODE=1000
    47  // etc etc
    48  ```
    49  
    50  See `./node_modules/@hashicorp/consul-api-double` for more details.
    51  
    52  
    53  ### Code Generators
    54  
    55  Make use of the many generators for code, try `ember help generate` for more details
    56  
    57  ### Running Tests
    58  
    59  Please note: You do not need to run `make start-api`/`yarn run start:api` to run the tests, but the same mock consul API is used.
    60  
    61  * `make test` or `yarn run test`
    62  * `make test-view` or `yarn run test:view` to view the tests running in Chrome
    63  
    64  #### Running Tests in Parallel
    65  Alternatively, `ember-exam` can be used to split the tests across multiple browser instances for faster results. Most options are the same as `ember test`. To see a full list of options, run `ember exam --help`.
    66  
    67  **Note:** The `EMBER_EXAM_PARALLEL` environment variable must be set to override the default `parallel` value of `1` browser instance in [testem.js](./testem.js).
    68  
    69  To quickly run the tests across 4 parallel browser instances:
    70  ```sh
    71  yarn test-parallel
    72  ```
    73  
    74  To run manually:
    75  ```sh
    76  $ EMBER_EXAM_PARALLEL=true ember exam --split <num> --parallel
    77  ```
    78  
    79  More ways to split tests can be found in the [ember-exam README.md](https://github.com/trentmwillis/ember-exam/blob/master/README.md).