executor: node
resource_class: xlarge
steps:
  - exit-if-branch-does-not-need-test-ui
  - checkout
  - restore_yarn_cache
  - attach_workspace:
      at: .
  - run:
      name: Test UI
      command: |
        # Add ./bin to the PATH so vault binary can be run by Ember tests
        export PATH="${PWD}/bin:${PATH}"

        # Run Ember tests
        cd ui
        mkdir -p test-results/qunit
        yarn test:oss
  - store_artifacts:
      path: ui/test-results
  - store_test_results:
      path: ui/test-results
