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

Capture and playback of events for testing #32

Merged
merged 7 commits into from
May 19, 2021
Merged

Capture and playback of events for testing #32

merged 7 commits into from
May 19, 2021

Commits on May 18, 2021

  1. Allow time to be mocked

    Add a small package `mtime` which will return a defined value in place
    of `time.Now()`, so that tests which depend on timing can be repeated.
    bboreham committed May 18, 2021
    Configuration menu
    Copy the full SHA
    df64935 View commit details
    Browse the repository at this point in the history
  2. Add scheme to controller

    Needed for object capture used in testing
    bboreham committed May 18, 2021
    Configuration menu
    Copy the full SHA
    eba2104 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2021

  1. Capture events and dump to file

    So we can record a sequence of inputs then create unit tests by
    playing them back.
    bboreham committed May 19, 2021
    Configuration menu
    Copy the full SHA
    3d089e5 View commit details
    Browse the repository at this point in the history
  2. Capture initial state of objects, for testing

    Actually it is capturing every version fetched.
    
    This code is temporary; will be replaced in a subsequent commit
    with a version that only outputs the first version seen as 'initial'.
    bboreham committed May 19, 2021
    Configuration menu
    Copy the full SHA
    e862c65 View commit details
    Browse the repository at this point in the history
  3. Playback of events for testing

    Read object updates and events from a file and play them back as if
    they came from Kubernetes, for testing.
    bboreham committed May 19, 2021
    Configuration menu
    Copy the full SHA
    76b60a2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4073d07 View commit details
    Browse the repository at this point in the history
  5. Update 2-pod test to use playback

    Essentially the test is the same, but with data captured using the
    new framework. Test data is now in a yaml file rather than Go code.
    bboreham committed May 19, 2021
    Configuration menu
    Copy the full SHA
    5fbe3ac View commit details
    Browse the repository at this point in the history