Skip to content

CI check to verify required exercises files exist. #458

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

Merged
merged 8 commits into from
Dec 29, 2016

Conversation

Insti
Copy link
Contributor

@Insti Insti commented Nov 29, 2016

Adds a bash script and travis configuration update to run it to check that all exercises have both a description.md and a metadata.yml file.

Note: This only checks for existence and does not validate the contents in any way.

Checks to see that all exercises have both a `description.md` and a
`metadata.yml` file.

Note this only checks for existence and does not validate the contents
in any way.
If there are required files missing the return value will be nonzero and
the ci check will fail.
Broken exercise to test missing file verificaton in CI.
@Insti
Copy link
Contributor Author

Insti commented Nov 29, 2016

Example Travis build failure: https://travis-ci.org/exercism/x-common/builds/179865364
Example Travis build success: https://travis-ci.org/exercism/x-common/builds/179864754

Squashing will eliminate the reverted broken exercise commit.

Fixes #457

require_file "$exercise_directory/metadata.yml"
done

exit $MISSING_FILES
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not that I ever expect this to happen (so I don't ask for anything to change), but for completeness...

if the number of missing files is ever an exact multiple of 256, on my machine this would exit with 0

Copy link
Contributor Author

@Insti Insti Nov 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good point.
I should not try to be so clever with return values.
If this PR gets chosen I'll just make it exit 1 (if $MISSING_FILES > 0)

@kytrinyx
Copy link
Member

The links to passing and failing builds is so great—note to self: do stuff like that more!

I really like how clean this is with the require_file function, too.

The exit value could be interpreted as 0 if there were 256 missing
files, so just return 1 in case of any missing files.

If the exact number is relevant in the future, further functionality can
be added to the script to deal with it.
If --progress command line option is provided, progress will be
displayed by outputing a `.` to STDOUT for each directory checked.
Adds progress message on completion if the --progress option is in use.
@ErikSchierboom
Copy link
Member

This has been open for quite a while. Is this ready to be merged?

@Insti
Copy link
Contributor Author

Insti commented Dec 20, 2016

Yes, this is ready to be merged.

There was some confusion between this PR and #459 which did essentially the same thing and were committed at almost the same time.

Either is probably better than nothing but I like this one the best. (I'm definitely biased though.)

I think we either need @tejasbubane to close his request, or have an independent reviewer (@ErikSchierboom?) decide which to merge.

@ErikSchierboom
Copy link
Member

I think #458 has the edge here, as it offers the same functionality as #459 and more.

@Insti Insti merged commit 013d72d into exercism:master Dec 29, 2016
@Insti Insti deleted the verify_exercises branch January 7, 2017 09:46
emcoding pushed a commit that referenced this pull request Nov 19, 2018
Regenerate the test file and update the version number.

see also: #457
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.

4 participants