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

Code excerpts should be auto-updated and tested #407

Closed
15 of 20 tasks
chalin opened this issue Oct 23, 2017 · 4 comments
Closed
15 of 20 tasks

Code excerpts should be auto-updated and tested #407

chalin opened this issue Oct 23, 2017 · 4 comments
Labels
e2-days Can complete in < 5 days of normal, not dedicated, work e3-weeks Complete in < 4 weeks of normal, not dedicated, work fix.examples Adds or changes example infra.structure Relates to the tools that create dart.dev p2-medium Necessary but not urgent concern. Resolve when possible. test.general Relates to unit, integration, perf testing

Comments

@chalin
Copy link
Contributor

chalin commented Oct 23, 2017

... and ideally, as part of every build, similar to what is done for https://github.com/dart-lang/site-webdev.

Eventually, all code excerpts in the site should be subject to testing. We'll be progressively covering site pages (so that the code excerpts they contain are tested). Here is an ordered list provided by @kwalrath in a separate thread:

Possibly related issues:

@chalin chalin added the infra.structure Relates to the tools that create dart.dev label Oct 23, 2017
@chalin chalin self-assigned this Oct 23, 2017
chalin added a commit to chalin/site-www that referenced this issue Oct 26, 2017
These are the original source files, unchanged, from up-and-running repo's `code` folder. These are the source files used in the language and library tours.

Contributes to dart-lang#407
chalin added a commit that referenced this issue Oct 26, 2017
These are the original source files, unchanged, from up-and-running repo's code folder. These are the sources of the language and library tours.

Contributes to #407
chalin added a commit that referenced this issue Nov 8, 2017
…our sources (#414)

**Reviewers**:

You'll probably want to focus your review efforts on **[`src/_guides/language/language-tour.md` while ignoring whitespace diffs](https://github.com/dart-lang/site-www/pull/414/files?w=1#diff-cd4b0043d2416c7c2db7fe09bba74060)**:
- The code diffs that you will see are the result of having refreshed the code excerpts from their originating sources. (After this PR is merged, I'll set this up so that it happens automatically.)
- In very few places I adjusted the Tour prose and/or examples -- but usually only after discussing the proposed change with you via email.

TL;DR

The purpose of this PR has been to adapt the **Language Tour**, and its example sources, so that we can use the [code_excerpt_updater](https://github.com/chalin/code_excerpt_updater) to auto-refresh code excerpts in the Language Tour markdown.

For the most part, the language tour markdown already contained embedded paths to the source files it uses, and the source files contained some form of code excerpt markers. Consequently, most changes made in this PR are "lexical" and minor:

- Sources under `examples/language-tour`: changed code excerpt marker syntax from
  - `BEGIN`/`END` to 
  - `#docregion`/`#enddocregion`.
- `src/_guides/language/language-tour.md`: changed inline code excerpt comments
  - `<!-- path/to/source -->` to 
  - `<?code-excerpt? "path/to/source"?>` processing instructions.

Doc regions were manually adjusted to ensure that the code excerpts remained unchanged (except for genuine updates done to the code since the markdown was written).

In a few cases files were relocated because they were in a wrong folder (e.g., deprecated was moved to metadata).

Contributes to #407

What is left to do: I haven't touched code excepts that are in the Gists used with DartPad.
chalin added a commit to chalin/site-www that referenced this issue Nov 9, 2017
chalin added a commit that referenced this issue Nov 9, 2017
* chore: adjust Travis setup in preparation for example testing

Contributes to #407

* Get SDK channel from data file (don't assume that it is `stable`)

* Update link to API pages in the docs
chalin added a commit that referenced this issue Nov 13, 2017
- See `examples/README.md` for details. Essentially, `examples` is now a Dart package from which all sample tests will be run.
- A few tests are run in chrome, so Travis setup has been adapted so that chrome is installed and configured to run tests.
- Also added highlights to some code excerpts (more will be added later).

**Note**: Eventually the "original" example sources (`examples/language_tour ` and `examples/library_tour `) will be deleted, once we are sure that all relevant parts (including some that are only in Gists) have been integrated into the new package.

Contributes to #407 and #416.
chalin added a commit that referenced this issue Nov 13, 2017
- See `examples/README.md` for details. Essentially, `examples` is now a Dart package from which all sample tests will be run.
- A few tests are run in chrome, so Travis setup has been adapted so that chrome is installed and configured to run tests.
- Also added highlights to some code excerpts (more will be added later).

**Note**: Eventually the "original" example sources (`examples/language_tour ` and `examples/library_tour `) will be deleted, once we are sure that all relevant parts (including some that are only in Gists) have been integrated into the new package.

Contributes to #407 and #416.
chalin added a commit that referenced this issue Nov 13, 2017
- See `examples/README.md` for details. Essentially, `examples` is now a Dart package from which all sample tests will be run.
- A few tests are run in chrome, so Travis setup has been adapted so that chrome is installed and configured to run tests.
- Also added highlights to some code excerpts (more will be added later).

**Note**: Eventually the "original" example sources (`examples/language_tour ` and `examples/library_tour `) will be deleted, once we are sure that all relevant parts (including some that are only in Gists) have been integrated into the new package.

Contributes to #407 and #416.
chalin added a commit that referenced this issue Nov 13, 2017
- See `examples/README.md` for details. Essentially, `examples` is now a Dart package from which all sample tests will be run.
- A few tests are run in chrome, so Travis setup has been adapted so that chrome is installed and configured to run tests.
- Also added highlights to some code excerpts (more will be added later).

**Note**: Eventually the "original" example sources (`examples/language_tour ` and `examples/library_tour `) will be deleted, once we are sure that all relevant parts (including some that are only in Gists) have been integrated into the new package.

Contributes to #407 and #416.
chalin added a commit that referenced this issue Nov 14, 2017
- See `examples/README.md` for details. Essentially, `examples` is now a Dart package from which all sample tests will be run.
- A few tests are run in chrome, so Travis setup has been adapted so that chrome is installed and configured to run tests.
- Also added highlights to some code excerpts (more will be added later).

**Note**: Eventually the "original" example sources (`examples/language_tour ` and `examples/library_tour `) will be deleted, once we are sure that all relevant parts (including some that are only in Gists) have been integrated into the new package.

Contributes to #407 and #416.
chalin added a commit that referenced this issue Nov 15, 2017
* Language tour example tests + Travis test job setup

- See `examples/README.md` for details. Essentially, `examples` is now a Dart package from which all sample tests will be run.
- A few tests are run in chrome, so Travis setup has been adapted so that chrome is installed and configured to run tests.
- Also added highlights to some code excerpts (more will be added later).

**Note**: Eventually the "original" example sources (`examples/language_tour ` and `examples/library_tour `) will be deleted, once we are sure that all relevant parts (including some that are only in Gists) have been integrated into the new package.

Contributes to #407 and #416.

* Post-review edits
@chalin chalin added fix.examples Adds or changes example test.general Relates to unit, integration, perf testing labels Nov 19, 2017
chalin added a commit to chalin/site-www that referenced this issue Nov 20, 2017
chalin added a commit that referenced this issue Nov 21, 2017
* Library tour example tests, up to but excluding dart:html

Contributes to #407 and #416.

* Post-review edits
chalin added a commit to chalin/site-www that referenced this issue Nov 21, 2017
chalin added a commit to chalin/site-www that referenced this issue Nov 22, 2017
chalin added a commit to chalin/site-www that referenced this issue Nov 22, 2017
chalin added a commit that referenced this issue Feb 23, 2018
* Strong mode code excerpt tests for fix-it page

Contributes to #407

Staged at https://dartlang-org-staging-0.firebaseapp.com/guides/language/sound-problems

* Don't make "Fix" bold

* Tweak canvas example code; add dynamic example

* Section title change

* Other misc post-review edits
@kwalrath
Copy link
Contributor

kwalrath commented Mar 1, 2018

I just took a look at analytics for the past week, when we've gotten a lot of new visitors, and here are my conclusions:

  • The VM Get Started tutorial should probably be tested, given its relatively high(er) readership.
  • We should consider adding tests for the following pages, which have small amounts of code:
    • /dart-2 (prominent page, so it'd be embarrassing if the code broke)
    • /guides/libraries/useful-libraries (not sure this is testable, but it mentions so many classes...)
    • /tools/dartpad (39th most viewed page)
    • /tools/pub/get-started (41st most viewed page)
  • The remaining pages with code snippets have low enough readership that we should probably skip them (for now, at least).

Here are the details on how things have changed (look for the bold font):

@chalin
Copy link
Contributor Author

chalin commented Mar 1, 2018

Thanks for the updated analytics!

chalin added a commit that referenced this issue Mar 1, 2018
chalin added a commit that referenced this issue Mar 1, 2018
@kwalrath
Copy link
Contributor

Somehow we missed Synonyms. At no.99, however, it's probably not a high priority, and it's complicated because we'd only be testing the Dart excerpts, not the other languages.

chalin added a commit that referenced this issue Apr 4, 2018
chalin added a commit that referenced this issue Apr 4, 2018
chalin added a commit that referenced this issue Apr 5, 2018
chalin added a commit that referenced this issue Apr 5, 2018
* Updates to Dart VM, Get Started

Contributes to #407

* Feedback from Kathy
chalin added a commit that referenced this issue Apr 23, 2018
chalin added a commit that referenced this issue Apr 23, 2018
chalin added a commit that referenced this issue Apr 27, 2018
chalin added a commit that referenced this issue Apr 27, 2018
* Fix "What's the point?" mini-toc

* Tutorial(streams): update for Dart 2 and analayze/test code

Contributes to #407, #637, #664

* Edits following Kathy's review
@kwalrath kwalrath added p2-medium Necessary but not urgent concern. Resolve when possible. and removed p1-high Major but not urgent concern: Resolve in months. Update each month. labels Nov 15, 2018
@kwalrath kwalrath added e2-days Can complete in < 5 days of normal, not dedicated, work e3-weeks Complete in < 4 weeks of normal, not dedicated, work labels Feb 1, 2019
@kwalrath kwalrath mentioned this issue Jul 31, 2019
23 tasks
@kwalrath
Copy link
Contributor

Closed in favor of #1803.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2-days Can complete in < 5 days of normal, not dedicated, work e3-weeks Complete in < 4 weeks of normal, not dedicated, work fix.examples Adds or changes example infra.structure Relates to the tools that create dart.dev p2-medium Necessary but not urgent concern. Resolve when possible. test.general Relates to unit, integration, perf testing
Projects
None yet
Development

No branches or pull requests

2 participants