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

Add automated tests for demo code snippets #7

Merged
merged 10 commits into from
Sep 3, 2019
Merged

Add automated tests for demo code snippets #7

merged 10 commits into from
Sep 3, 2019

Commits on Sep 3, 2019

  1. Add script to run demo code in README

    Add a script that extracts the demo code snippets from README.md
    and runs them in a shell, raising `SystemExit`, if the output is
    not as expected.
    
    This is an automated testing alternative to the existing
    `run_demo.py`, which replicates the commands from the demo
    instructions, with the advantage that the commands don't have to be
    synced.
    
    NOTE: The script requires the in-toto version specified in
    requirements.txt, i.e. 0.2.3 at the moment.
    lukpueh committed Sep 3, 2019
    Configuration menu
    Copy the full SHA
    56681ac View commit details
    Browse the repository at this point in the history
  2. Adopt README.md to work with snippet run script

    Adopt demo instructions to be used with newly created script that
    extracts snippets from fenced code blocks and runs them.
    
    This commit marks to snippets for exclusion, by specifying the
    snippet language, used for syntax highlighting, as `bash`
    (`run_demo_md.py` only extracts `shell` snippets).
    
    Plus some minor cleanup.
    lukpueh committed Sep 3, 2019
    Configuration menu
    Copy the full SHA
    1452b4f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    945cbd8 View commit details
    Browse the repository at this point in the history
  4. Exclude tree from automated demo script

    `tree` behaves (sorts) differently on different platforms, which
    is a problem, when testing against an expected output.
    lukpueh committed Sep 3, 2019
    Configuration menu
    Copy the full SHA
    44a55a0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    bb31968 View commit details
    Browse the repository at this point in the history
  6. Bump in-toto pinned requirement to 0.3.0

    Requires changes in the expected output of the automated demo run
    script.
    lukpueh committed Sep 3, 2019
    Configuration menu
    Copy the full SHA
    0eb5ce8 View commit details
    Browse the repository at this point in the history
  7. Explicitly set xtrace format with PS4

    This is necessary to get the same output in different environments,
    which in turn is necessary to compare it to hardcoded expected
    output.
    lukpueh committed Sep 3, 2019
    Configuration menu
    Copy the full SHA
    636dfa1 View commit details
    Browse the repository at this point in the history
  8. Remove unnecessary quotes around echo argument

    These are treated differently with `set -x` on different systems
    and thus break the build
    E.g. on Travis (ubuntu): `+ echo something evil`
    and locally: `+ echo 'something evil'`
    lukpueh committed Sep 3, 2019
    Configuration menu
    Copy the full SHA
    f59562a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ce12147 View commit details
    Browse the repository at this point in the history
  10. Change "sane" to "genuine" in README.md

    Kudos to @CameronLonsdale and @adityasaky for pointing it out.
    lukpueh committed Sep 3, 2019
    Configuration menu
    Copy the full SHA
    1b78ec7 View commit details
    Browse the repository at this point in the history