Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Riak Test v1.1.0 #786

Open
wants to merge 157 commits into
base: master
Choose a base branch
from
Open

Riak Test v1.1.0 #786

wants to merge 157 commits into from

Conversation

jburwell
Copy link
Contributor

This PR is not intended to be merged at this time. It is being used to review the work done thus far, and begin the process of cleanup for merge into master.

Riak Test v1.1.0 ... more writeup to come.

/cc @javajolt

@@ -0,0 +1,38 @@
#!/bin/bash
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove this script prior to merge? We had always intended to remove it, but it may prove useful until for verifying changes until the v1 wrapper is dropped in v2.0.0.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's still useful for now. Easy to remove later.

@jburwell
Copy link
Contributor Author

Notes on the planner design

rt_planner and rt_reporter are good starts towards the pipeline design I have in mind for r_t. After reviewing the initial implementation, I have the following observations:

  • The GiddyUp dependency can be further isolated in the codebase
  • The riak_test_escript module contains more test planning work than necessary
  • Isolate the use of rt_config to the riak_test_escript module as much as possible to simplify component unit testing

Ideally, we have a pipeline constructed with the following stages:

planner->scheduler->runner

Each of these stages can emit a test_result event that is broadcast to a list of reporters (e.g. console, giddyup).

A planner stage accepts a list of tests, backends, and groups and creates a set of test plans to be scheduled for execution. The following is (roughly) the test planner API I have in mind:

-spec start_link(pid(), [pid()], proplists:proplist() -> rt_util:result().
start_link(SchedulerPid, ReporterPids, Options) -> %% the options are implementation dependent

-spec plan([atom()], [backend()], [atom()]) -> {ok, non_neg_integer()} | rt_util:error().
plan(Tests, Backends, Groups) ->  %% When the test list is empty, run all available tests

A scheduler stage accepts a test plan, reserves the quantity of nodes requested by the plan, and submits the schedule to an executor stage for execution. The following is (roughly) the test scheduler API I have in mind:

-spec start_link(pid(), [pid()], proplists:proplist()).
start_link(ExecutorPid, ReporterPids, Options) -> %% Options are implementation dependent

-spec schedule(#rt_planner:test_plan()) -> rt_util:result().
schedule(TestPlan) ->

Finally, a Runner stage provisions the nodes allocated in the test schedule, executes the test specified in the test schedule, and reports the results of the test run the to reporters. The following is (roughly) the API I have in mind:

-spec start_link([pids()], proplists:proplist()) -> rt_util:result().
start_link(ReporterPids, Options) ->

-spec run(rt_scheduler:test_schedule) -> rt_util:result().
run(TestSchedule) ->

Based on this (high-level) design, I propose the following refactorings:

  1. Convert the giddyup module to a gen_server that has the giddyup configuration information passed into its start_link function. In addition to encapsulating the GiddyUp configuration, it will also allow asynchronous communication with GiddyUp to prevent blocking of the pipeline if/when we have a slow connection.
  2. Refine the rt_planner module to define the planner behavior and any common functions used by all planners
  3. Move all GiddyUp related planning functions into a new rt_giddyup_planner module -- removing the notion of wrapping test plans in the escript module. If a list of tests, backends, and/or groups is provided to this planner, they will be used to filter the list of test plans retrieved from GiddyUp.
  4. Create an rt_simple_planner module which is used when a list of tests is specified on the command line.
  5. Add a build_test_pipeline function to the riak_test_escript that selects and starts the planner, scheduler, and reporter(s) and ties them together for execution.

/cc @javajolt

kellymclaughlin and others added 20 commits April 22, 2015 13:40
* Change riak_test API to add a properties and setup function in
  addition to confirm. The goal is to remove test environment
  specification from actual test case logic.
* Change confirm/0 to confirm/2 to accept data about the test
  environment as input.
* Add capability for any test to be run as a rolling upgrade test.
* Add rt_cluster module with some supporting functions.
* Change verify_build_cluster and secondary_index_tests modules to
  conform to the new API in order to demonstrate the changes.
- functions include set_conf/2, set_advanced_conf/2, and
  update_app_config/2.
- Move rt module functions to new rt_http module.
- Convert http_bucket_types to new test convention.
Brett Hazen added 5 commits April 22, 2015 14:37
- Have lager fire up an extra handler for each test run
- Place lager output in riak_test.log and upload to GiddyUp
- Remove rt.hrl and move the rt_webhook record into giddyup.erl
- Remove unused GiddyUp code from escript
- Let the test_runner know the name of the log directory so it knows where to put the riak_test.log
- Add separate flag to rt_reporter to indicate the need to upload files to GiddyUp
- Always copy log files to local directory before uploading to GiddyUp
- Always copy log files to local directory
- Removed unused command-line options in escript
- Get rid of extraneous commented-out code
- Move as much GiddyUp-specific logic into `giddyup'
- Correctly upload config files
- Upload files asynchronously to scheduler can reclaim used nodes
@hazen hazen force-pushed the feature/mixed-mode-riak-test branch from 15a7493 to d50506c Compare April 22, 2015 20:45
Brett Hazen added 15 commits April 22, 2015 14:49
Add a few notes about debugging and version info
Add comment and example of `continue_on_fail'
rt_harness_util:deploy_nodes/5 to handle cuttlefish
- Default backend in rt_planner is now undefined
- All lists of backends are now atoms
- Command-line limits backends when using GiddyUp
- Command-line now properly generates multiple tests when a list of
  backends is specified
- "multi" backend added for verify_2i_aae-multi for GiddyUp
@hazen hazen force-pushed the feature/mixed-mode-riak-test branch from 7edbe91 to deebded Compare May 13, 2015 21:22
Brett Hazen and others added 8 commits May 14, 2015 14:51
        - rt_host defines a protocol for performing operations on a host
          (e.g. exec, mkdir, etc).  Adds rt_local_host for working on a
          local host
        - Moves various general purpose functions to rt_util
        - Introduces rt_driver to define extension points for product
          specific test planning and scheduling activities
- Required to get legacy upgrade tests to pass (e.g. BTA-231, BTA-232)
- Upgrade path name is in rt_test_plan currently for execution
- Fix get_node_logs/0 for verify_handoff_mixed (BTA-75),
  yz_rs_migration_test and yz_solr_start_timeout
- Fix rtdev:node_id/0 for kv679_dataloss (BTA-218) and verify_riak_stats
  (BTA-174)
- Changed hard-coded devrel path in test
- Update relpath/1 to resolve new version paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants