nT Test Interface

Test Interface

The Test Interface essentially is a set of URLs which invoke special functionality that allows your nanoTwitter to be tested from a browser, and is the foundation of the scalability testing we will be doing.

The Test user

There’s a user that we use as part of many of the tests. We refer to the user as “testuser”. When you create that user use the following attributes:

  • name: testuser
  • email: testuser@sample.com
  • password: “password”

Test Data

  • Url to reset and load the standard seed is: /test/reset/standard?tweets=n&users=u&follows=u
  • Dataset is the standard Seed Data
  • If necessary, you may modify the creation dates of tweets, but all the other data should be intact
  • Our tests will require the complete set of records
Here are the URLs of the test interface
  • POST /test/reset/all
    • If needed deletes all users, tweets, follows
    • Recreates TestUser
    • Example: test/reset/all
  • POST /test/reset/standard?users=u
    • Deletes all users, tweets and follows
    • Recreate TestUser
    • Imports data from standard seed data, see: Seed Data
      • ?users=n means to import n users from the seed data…
      • Including all the related follows (i.e. both users need to be present)
      • And all the related tweets
    • Example: `/test/reset/standard?users=100&tweets=100
  • GET /test/tweet?user_id=x&count=y
    • {x} can be the user id of some user, or the keyword testuser
    • n is how many randomly generated tweets are submitted on that users behalf
    • Returns a page that just says “OK”
  • GET /test/status
    • One page “report”:
      • How many users, follows, and tweets are there
      • What is the TestUser’s id
    • Example: /test/status
  • GET /?user_id=x
    • When user_id is added to the normal root url, NanoTwitter will quietly and automatically log in that user.