Skip to content

track x-common version somewhere in xrust #281

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

Closed
petertseng opened this issue May 6, 2017 · 1 comment · Fixed by #282
Closed

track x-common version somewhere in xrust #281

petertseng opened this issue May 6, 2017 · 1 comment · Fixed by #282

Comments

@petertseng
Copy link
Member

petertseng commented May 6, 2017

Ever since x-common started versioning their canonical-data.json files (see exercism/problem-specifications#673), it becomes possible for xrust to keep track of which version of the x-common JSON file was used to write the current tests. If we keep track of this, then we would easily be able to determine whether the xrust tests are out-of-date.

Let's discuss a few questions before doing this:

Do we need an additional version component?

Let's pretend that for a given exercise, x-common's version is 1.0.0, and we note this. Let's then decide that even though x-common's version hasn't changed, we need to change something about the tests anyway. It wouldn't make sense to change the version to 1.0.1 because that's not x-common's version. Do we need to change the version to 1.0.0.1 or something? The alternative is to leave the version at 1.0.0.

Note that this wouldn't matter for the goal of determining whether we are out of date with x-common. It only matters so the student can quickly determine whether the tests may have changed in some way. So it is not necessary for the goals of this issue. Do we want it anyway?

I don't really care so if nobody says anything I'm assuming no (leave the version at 1.0.0).

Where should we keep the version?

Note that all Cargo.toml files have a version, as we see in https://github.com/exercism/xrust/blob/master/exercises/acronym/Cargo.toml#L3. That is one possibility of where to put it. Disadvantage: we would need to remember to update Cargo.toml plus the test file, so that's two files.

Another choice that might be reasonable is in the tests/*.rs file so that we don't have to update two files. Disadvantage: we would need a standard version comment so it can be easily found, like ``// x-common test version 1.0.0`, so it's less stuctured.

Personally I think putting it in Cargo.toml would be nice.

@ijanos
Copy link
Contributor

ijanos commented May 7, 2017

Do we need an additional version component?

No. Keep things simple and only use this version to track x-common.

Additional versioning is useful for somebody who wants to keep their solutions up to date, I don't have numbers to back this up but I feel only a small part of users do that, most of them finish the actual version of an exercise and then move on. Those who are curious can always look at our github page, which provides per-file level history.

Where should we keep the version?

Cargo.toml is fine.

petertseng added a commit that referenced this issue May 8, 2017
declare compliance with x-common, where applicable

closes #281

Where our exercise already matches the x-common tests, this is now noted
in the Cargo.* files.

Where there were small differences but I still deemed the exercise to be
up to date, I noted this in a commit comment, so take note of those
differences.

Out of scope for this PR: Actually changing any test suites. This PR is
only for figuring out where we are already compliant. Changing test
suites will come in other PRs for the respective exercises.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants