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

Update documentation to specify semver 2.0.0 #30

Merged
merged 4 commits into from
Oct 7, 2019
Merged

Update documentation to specify semver 2.0.0 #30

merged 4 commits into from
Oct 7, 2019

Conversation

qyanu
Copy link
Contributor

@qyanu qyanu commented Aug 1, 2019

Fixes #29

  • add TODO: test/documentation-test should also allow testing error-cases.
  • add TODO: validation-version does not fully implement semver2.x with regards to numerical prerel identifiers
  • fix code comments: prerel and build also allow dots.
  • document that semver 2.x is implemented as opposed to semver 1.x or a future version.

@ranger6
Copy link
Collaborator

ranger6 commented Oct 1, 2019

This PR has been sitting around awhile. Seems it is rather blocked due to the lack of a testing scheme that covers error-case results. One idea was to fiddle a bit with the documentation-test by adding an error token.

I would suggest that:

  1. The documentation-test scheme is fine as it is. It does some testing, but mostly it assures that the published examples actually work!
  2. It would be better to use an established testing framework for building a complete test suite because:
  • we don't spend the effort creating a special purpose framework and take advantage of software that has been worked out, tested, used for many years.
  • make it easy to introduce tests that fail so that bugs can be demonstrated without touching the documentation.
  • make it easy to test error-cases.
  • provides the ability to check things other than the results on stdout plus return value. These can still easily be tested, but also more complicated things if need be.

I have pushed a branch to my forked repo that uses "bats" to test semver. The tests can run natively (be careful with MacOS install of bats), or in Docker. The changes in this commit are a new target in the Makefile (runs very much like the "lint" target) plus the test script in the test directory (semver.bats). Just type "make bats".

Even without reading the bats docs, you can see how simple it is to run and write the tests. You should be able to add tests with a bit of copy/paste in the script.

Keeping with semver-tool, "bats" is written in bash and is targeted at testing commands run in the bash shell. Exactly the case here.

If there is interest here, I can make this prototype into a PR. With the test framework in place, moving forward on the PR (#30) should be facilitated. You can even remove one of the "TODO's".

Let me know.

@fsaintjacques fsaintjacques changed the title Develop Update documentation to specify semver 2.0.0 Oct 7, 2019
@fsaintjacques
Copy link
Owner

@ranger6 please open a PR with bats :)

@fsaintjacques fsaintjacques merged commit b722cae into fsaintjacques:master Oct 7, 2019
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 this pull request may close these issues.

definition for PRERELEASE and BUILD doesn't conform to semver 2.0.0
3 participants