Skip to content

Validate the test data version as part of a travis build #133

Closed
@behrtam

Description

@behrtam

Thanks to the work of @rbasso (see exercism/problem-specifications#602, exercism/problem-specifications#625, exercism/problem-specifications#673, etc) and many more, we now not only have a schema but also a test data version.

In exercism/problem-specifications#524 @robkeim started to think about how to propagate changes from x-common to the tracks. In this issue @ErikSchierboom wrote:

Yes, sending an update each time something changes in x-common can be tiresome, but the alternative (manually keeping track of x-common) is not a whole lot better.

So, I thought about a way that doesn't generate a lot of mails, issues or notifications, but makes sure that at least every time someone actually is working on a test file it is up to date.

I started to work on a script (check-testversion.py) for the python track that checks the versions for all exercises that are part of a travis build against the newest version in the x-common repo, a bit like a linter or stylechecker. It still needs a lot of cleanup and testing, but it at least proves that the basic idea is working.

The basic concept is ...

  1. get a list of changed files git diff --name-only $TRAVIS_COMMIT_RANGE
  2. get the newest version from canonical-data.json through https://api.github.com/repos/...
  3. get the actual version from a comment in the test file # test @ version: 1.0.0
    (maybe it should be excluded into a separate JSON file as part of the exercise directory)
  4. compare the versions and output some infos

As a test I changed the anagram version back from 1.0.1 to 1.0.0 in this commit: behrtam/python@3dc7acd
Which resulted in a failed build as expected: https://travis-ci.org/behrtam/xpython/jobs/219306945#L163

I don't know if this will finally be integrated into the python track or if this is a good idea at all, but I thought maybe some parts of this could also be interesting for other tracks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions