question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change canonical-data reference to improve version checking

See original GitHub issue

From @AnAccountForReportingBugs in https://github.com/exercism/python/issues/1726#issuecomment-475787036

[referencing these changes] This one took a bit to figure out. May want to loosen the regex or change how the comment looks.

Another idea is to you use a module level doc string or a global variable in the various _test.py files. This would allow direct access to the string using various techniques.

And from @cmccandless in https://github.com/exercism/python/issues/1726#issuecomment-476205579

I’ve run into this before where the ‘v’ was missing on the version reference in a test suite. I’d rather add a check somewhere that enforces one of the following than allow too much variation in the reference:

  • Tests based on problem-specifications//canonical-data.json @ v1.2.3`
  • No canonical-data.json for this exercise

I like the docstring idea. It would simplify some things.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
yawpitchcommented, Mar 5, 2020

The intent here I think is to avoid contributors editing the test files directly; it might be best to point them instead to the Contributing Guide or, more specifically, the Generator docs. We’ve gotten away without this sort of notice so far because it is recommended that all first-time contributors read the Contributing Guide before beginning work (this is quite normal for Open Source projects), and the Guide does point at these docs, so contributors are already being instructed on the correct method to add/edit tests.

Ahh, hadn’t considered that this was a contributor-facing bit of boilerplate. I’ll rescind that point for any future PR, but maybe if it said “CONTRIBUTORS: this file was automatically generated from {path to .meta/template.j2}: please do not edit this file directly” or something similar?

Either way, closing this one … from the above I’m not aware of a specific offending script in our repo to remove.

1reaction
yawpitchcommented, Mar 1, 2020

I don’t dislike the idea of a bit of “Automatically generated” boilerplate on tests, though I’d maybe drop the admonition not to edit the file… we don’t actually mind them adding new tests, if it helps them. I’m not sure any of the other languages add licensure or copyright boilerplate to any of the files usually distributed through the exercism CLI … that would really be a call for @kytrinyx and @iHiD to make. But I’d be happy to get a PR adding something about automatic generation to the config/master_template.j2 or config/generator_macros.j2 files.

That said, that’s a separate discussion from this issue’s concerns, which I think have been mooted by the move of (virtually all) exercises to automatic generation … we no longer need to do any sort of work to parse the version for an explicit check, we just need to generate from latest and see if there’s a diff, plus if we do need to parse it there’s now a consistent string to do that from, since it’s generated via the template.

So personally I think we can just close this, since it was created before we did the big push towards generation. @cmccandless ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

readiness tool report error; CSI Missing Deployment Key
Method 1: I would suggest you to refer the link and check. System Update Readiness Tool fixes Windows Update errors in Windows 8,...
Read more >
What Is a Canonical Data Model? CDMs Explained
Integrating and sharing data across all your systems is complicated. The Canonical Data Model might be your solution. Learn more here.
Read more >
Any easy way to upgrade netsuite connector version in Boomi?
Hi, currently around 50 processes running in production uses netsuite connector version 2015.1 with pwd authentication.
Read more >
Benefits of a Canonical Data Model (CDM) in a SOA ...
This blog explains what a Canonical Data Model (CDM) is and what the benefits are of using it in an integration layer or...
Read more >
Version History - Concrete CMS
new 'Optimize' tab for posts with powerful SEO tools; canonical data URL added ... checking "send subscribe email" option on blog entry save...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found