Skip to content

MimicTwoHourWorkshop

Glyph edited this page Feb 2, 2015 · 8 revisions

part 1: 30m: is mimic, how to run it, how to use it from the command line and your tests

  • short (~5min) talk introducing mimic:
    • give everybody the URL for the slides so they can re-watch videos, instructions
    • requirements for this workshop: python, virtualenv, pip
    • what is mimic
    • who uses it
    • how much does it implement
  • (~5 min) 2 video demos from openstack: show how to install and run mimic, how to run python-novaclient against it
  • 6 minutes: ask the audience to do what is shown in the video (from pip install mimic onward), make sure everyone has managed to create a fake server
  • 6 minutes: emphasize the importance of negative-path testing, how back-end services will fail, and how you really need to make sure that the thing calling that service can recover from that failure
  • (~5min) ask the audience to generate a metadata-based error with the nova command line, watch it fail (3rd demo from openstack)
  • ~3min - explain --realtime option, note that the fake server was created in 1970, show the difference with the option set, explain clock-advance endpoint

part 2, 1hr (65min including break): how to write a plugin

  • basic dev setup: prerequisite, show up with a working 'tox'; live demo of running mimic's tests (~5m)
  • quick web framework tutorial (~10m):
  • 5 minute break, calisthenics
  • create a plugin (~15m):
    • create a fork of mimic! (2 min)
    • create file in plugin directory (2 min)
    • add plugin to mimic.test.CoreBuildingTests.test_from_plugin_includes_all_plugins and make sure the test passes to ensure the plugin is loaded properly (10 min)
  • implement a plugin that returns static data (23m)
    • add a request()-based test to a test file (2m to explain, 3m for audience to follow)
    • add a root resource (2m to explain, 4m for audience to follow)
    • use REST client to inspect service catalog and extract the URL (2m,4m)
    • hit the URL to see the response (2m,4m)
    • leave 15 minutes for people to catch up, to do something beyond static data; 1 on 1 introduce folks to the object-model stuff if they have gotten far enough

part 3: 20m: wrap-up

  • (~5 minutes) what can you do with mimic?

  • (~5 minutes) how can you contribute to mimic? (survey of some existing github issues, mention "new contributors" label)

  • (~10 minutes) what can mimic do for you? what features do you need, how much proof-of-concept would you need to convince your (boss / director / SVP) that you should be spending some of your time on Mimic?

Clone this wiki locally