Skip to content

Gigasecond: Schema Compliance #679

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 1 commit into from
Mar 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 46 additions & 33 deletions exercises/gigasecond/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,58 @@
{
"#": [
"The basic test is to add one gigasecond to a few ordinary dates.",
"Most test programs currently check only the date and ignore the time.",
"For languages with a native date-time type though, expected times",
"here show the correct seconds, ignoring leap seconds.",
"The date and time formats here are per",
"http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15.",
"",
"Finally, as a demonstration but not really a test,",
"some languages demonstrate the add function by inviting the",
"solver to include their birthdate in either the solution code",
"or test program. The test program then shows or tests their",
"gigasecond anniversay."
],
"add": {
"description": [
"Add one gigasecond to the input."
],
"cases": [
{
"exercise": "gigasecond",
"version": "1.0.0",
"comments": [
"The basic test is to add one gigasecond to a few ordinary dates.",
"Most test programs currently check only the date and ignore the time.",
"For languages with a native date-time type though, expected times",
"here show the correct seconds, ignoring leap seconds.",
"The date and time formats here are per",
"http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15.",
"",
"Finally, as a demonstration but not really a test,",
"some languages demonstrate the add function by inviting the",
"solver to include their birthdate in either the solution code",
"or test program. The test program then shows or tests their",
"gigasecond anniversary."
],
"cases": [
{
"add":
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't merge it yet. It certainly isn't compliant!

Copy link
Contributor

Choose a reason for hiding this comment

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

Too late!

Copy link
Member

Choose a reason for hiding this comment

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

@rbasso Shall I revert?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if it is needed. We can add another commit soon.

Copy link
Member

Choose a reason for hiding this comment

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

It is why we need #658

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm... yeah, I did check the travis-ci result, it was passing the local test... revert it, and let's see what I missed.

Copy link
Contributor

Choose a reason for hiding this comment

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

This one was trick. It needed:

  • Descriptions for each test case - ☑️
  • Properties for each test case (I would have used add instead of integer) ☑️
  • Transforming the list of strings in the group description in a single string. ❌ (you did it, but you changed it to a comment.
  • Remove the add object. ❌

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. please check #685

Copy link
Member

Choose a reason for hiding this comment

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

I did check the travis-ci result, it was passing the local test

This link can be used to verify schema compliance until #658 is merged.

Copy link
Member Author

@kotp kotp Mar 10, 2017

Choose a reason for hiding this comment

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

I verified what happened locally, I did stash, changed my local $EXERCISE value to review a different exercise, and verified it, merged it, grabbed the changes, went back to my branch, rebased it on master, unstashed my changes, forgot to reassign my exercise environment variable and then had it pass... of course...

So process error.

"comments": "Add one gigasecond to the input.",
"cases": [
{
"description": "date only specification of time",
"property": "integer",
"input": "2011-04-25",
"expected": "2043-01-01T01:46:40"
},
{
},
{
"description": "second test for date only specification of time",
"property": "integer",
"input": "1977-06-13",
"expected": "2009-02-19T01:46:40"
},
{
},
{
"description": "third test for date only specification of time",
"property": "integer",
"input": "1959-07-19",
"expected": "1991-03-27T01:46:40"
},
{
"#": "full time specified",
},
{
"description": "full time specified",
"property": "integer",
"input": "2015-01-24T22:00:00",
"expected": "2046-10-02T23:46:40"
},
{
"#": "full time with day roll-over",
},
{
"description": "full time with day roll-over",
"property": "integer",
"input": "2015-01-24T23:59:59",
"expected": "2046-10-03T01:46:39"
}
]
}
}
]
}
}
]
}