Skip to content

Admin UI Release Preflight

Mika ∆ edited this page Apr 6, 2017 · 7 revisions

Admin UI Release Preflight

To ensure that the full functionality of the CrateDB Admin UI is tested the person who is doing the Admin UI release needs to go through this preflight checklist.

If one or more tests fail, the Admin UI must not be released.

Setup

To be able to run the tests you need to start 3 instances of CrateDB locally. Since the Admin UI is bound to a specific CrateDB version, Crate needs to be built from source from the correspoding version branch (e.g. 0.56).

The easies way to do this is adding a Bash function to your bashrc (or zshrc, or whatever other shell you're using).

function run_crate() {
  echo "Running crate from local checkout: $(git rev-parse --abbrev-ref HEAD)"
	local JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
	./gradlew installDist && \
      JAVA_OPTS=$JAVA_OPTS ./app/build/install/crate/bin/crate \
          -Ccluster.name=admin-ui-test \
          -Cdiscovery.zen.multicast.enabled=false \
          -Cdiscovery.zen.ping.unicast.hosts=localhost:4300 \
          -Cnetwork.bind_host=0.0.0.0 \
          -Chttp.cors.enabled=true \
          -Chttp.cors.allow-origin="*" \
          -Ces.api.enabled=true \
          -Cpsql.enabled=true \
          -Cstats.enabled=true
}

Then run 3 times run_crate in the console and open the Admin UI on http://localhost:4200/admin.

Tests

Toolbar

  • Cluster name must be ADMIN-UI-TEST
  • Version must correspond to branch version from which Crate was started

Overview

  • Toggle Load 1, Load 5, Load 15 in Cluster Load graph
  • Resizing the window must not throw any d3.js errors

Get Started

  • Import tweets for testing and and stop it again after ~ 10000 imported tweets
  • The Overview page should have updated the Total Records field to reflect this imported data.

Console

  • Type SELECT * FROM tweets; in the console and hit the execute button. LIMIT 100 must be applied automatically.
  • Type SELECT * FROM sys.summits; in the console and hit SHIFT+ENTER LIMIT 100 must be applied automatically.
  • Hit ARROW-UP key in console input field. SELECT * FROM sys.summits; must be loaded into console. Another ARROW-UP reveals SELECT * FROM tweets;
  • Test ARROW-DOWN functionality to test browsing the console history.
  • Uncheck Show error Trace in the console options if it is checked. Run SELECT * incorrect_statement from non.existent_table; and check that an error message is displayed but no error trace is shown.
  • Check Show error Trace and run the above statement again. Check that the error trace is output this time.

Tables

  • tweets table must appear in Docs Tables section.
  • Open up crash or the Admin UI console in another tab. Run:
  create table x.test_table(id integer);

Without refreshing the page, check that the new table is added to the list. Run:

  drop table x.test_table;

Without refreshing the page, check that the new table is removed from the list.

Cluster

  • The master node must be indicated with a blue square.
  • End one of the cluster processes (not the master). The terminated node should then be removed from the nodelist. Start up another crateDB process and check that the new process is correctly added to the nodelist.

Results Formatting

Create the results formatting testing table:

CREATE TABLE preflight (
  bool boolean,
  str string,
  i integer,
  doub double,
  ip_addr ip,
  ts timestamp,
  gp geo_point,
  gs geo_shape,
  strs array(string),
  obj object(strict) as (
    name string,
    age integer,
    location object(strict) as (
      num integer,
      street string
    ),
    friends array(object(strict) as (age integer, name string)),
    fav_numbers array(integer)
  )
);

Insert the dummy data into the preflight table:

INSERT INTO preflight VALUES (
  true,
  3.14,
  [9.72,47.39],
  {
    type = 'Polygon',
    coordinates = [
       [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
    ]
  },
  42,
  '127.0.0.1',
  {name = 'Test Subject', age = 24, location = {num = 10, street = 'Nowhere'}, friends = [{name = 'Friend 1', age = 22}, {name = 'Friend 2', age = 31}], fav_numbers = [1, 2, 3, 4, 5]},
  'hello world',
  ['hello', 'is', 'it', 'me', 'youre', 'looking', 'for'],
  '1970-01-01T00:00:00'
);

And then select this data via:

SELECT * FROM preflight;

Toggle the Format Results button and check that the data is formatted correctly. Check that arrays and objects (including nested objects/arrays) can be expanded and collapsed correctly.