Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

libero/reviewer-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reviewer-client

The client for "libero reviewer".

Requirements

The project contains a Makefile which uses Docker for development.

Browsertest Results

Testing Powered By SauceLabs

Development

  1. make setup

  2. Run client options:
    Test: mock everything with reviewer-mocks

    make start_test

    Dev: run against local reviewer-submission and continuum-adaptor, only mock continuum

    # start local instances of submission and adaptor
    cd ../reviewer-submission ; make setup ; make start_dev
    cd ../continuum-adaptor ; make setup ; make start
    
    cd ../reviewer-client
    make start_dev

    CI: lint, test and browsertest akin to pipeline

    make run_ci

    CI-localhost: same as CI but exposed on localhost

    make build_prod
    make start_ci_localhost
  3. Run tests:

    • make lint: lint code
    • make test: unittests
    • make test_browser: locally executed browsertests, use with start_test, start_dev or start_ci_localhost
    • make test_browser_containerized: use with build_prod ; start_ci
    • make test_browser_saucelabs: browsertests run against saucelabs, use with start_test, start_dev or start_ci_localhost

To use saucelabs you need an account and have to set SAUCE_USERNAME and SAUCE_ACCESS_KEY env vars.

  1. make stop to teardown

Adding Browsertests

Browsertests will be run against SauceLabs for a variety of browsers but we also create a container that runs them against Chrome. Having containerized browsertests lets us run them easily in the umbrella repo or as part of a helm release.

SauceLabs kindly grants us test capacity as part of their OpenSauce program.

  • enable saucelabs on a PR by adding [run-saucelabs] to your PR description
  • browsers to run are set in .github/workflows/ci.yml
  • all test results are publically available
  • testcafe prints link to saucelabs test result to stdout
  • to allow browsertest containerization we need to inject a BASE_URL from an environment variable

Make sure to include something like this for all browsertests:

import { DashboardPage, FilesPage, LoginPage, AuthorDetailsPage, DetailsPage, NavigationPane } from '../page-objects';
import { BASE_URL } from '../../test-utils/baseUrl';

fixture`Getting Started`.page`${BASE_URL}`;

test('assert nav bar', async() => {
  ...

Use of reviewer-mocks

The compose files use liberoadmin/reviewer-mocks:latest.

  • make sure you have the current image with:
    docker pull liberoadmin/reviewer-mocks:latest
  • when changing mocks locally, tag it accordingly:
    cd ../reviewer-mocks
    make build
    docker tag \
      libero/reviewer-mocks:local \
      liberoadmin/reviewer-mocks:latest