CSC/ECE 517 Fall 2016/E1701. Accelerate RSpec testing

From Expertiza_Wiki
Revision as of 21:57, 8 November 2016 by Nzlu (talk | contribs)
Jump to navigation Jump to search

Problem Statement

Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. Unfortunately, Expertiza tests are really slow. If you check the TravisCI, it needs more than 9 min to run all tests. One reason is that we use fixture to create records in test DB each time running tests.

Related Work

  • Classes involved: All RSpec test files in Expertiza.
  • Database involved: Expertiza_test

Task

Formally, you need to:

  • Create the records in test DB according to the content in fixtures.
  • Check each test file and delete certain DB records creation code that insert default records (eg. create(:deadline_type))
  • And keep all the test cases passing when using test DB and make sure the time running test cases is shorter than before.
  • You should submit the sql file of test DB to expertiza.

Design

Database design

factories design