machinetranslate/machinetranslate.org

Feature: Add tests (CI)

Closed this issue · 3 comments

Problem [optional]: Sometimes we break things, and we don't notice til it's live.

Request: Add basic tests

Additional context:

CI:

We need to get something basic in place. We can use GitHub Actions.

Then we can create separate issues.

For example:

Code:

  • Make sure there is no 404 where we totally fail to serve the homepage (like #550).

Data (i.e. for auto-generated pages):

  • Make sure that there are no pages with a conflicting path (e.g. a TMS and an API with the same slug)

Content:

  • Make sure the served paths are only one level deep (e.g. /swahili not /language/swahili).
  • Make sure links to pages are not broken (e.g. missing .md, relative path...)
  • Make terms are linked to their pages where possible.
  • Enforce the style guide.
    • No abbreviations
    • No US-specific spellings
    • Newline after each sentence, 2 after space.

CD:

We basically already have this, thanks to GitHub Pages.

There is one exception, but maybe it's fine.

  • [] Run generate.py automatically.
    If we decide to do that, we should create a separate issue.

@bittlingmayer - Can we add other items to the Enforce the style guide check?

  • Curly quotes instead of straight quotes
  • Internal paths contain extension .md
  • Article subject matter in bold
  • No Title Case.
  • Delete layout: coming_soon when editing a coming soon article.

@bittlingmayer Ceci jan sure, feel free to even just update my comment, but we should all just realize that some are very hard to enforce with rules (e.g. Title Case is acceptable in the case of product names or even other named entities like the Transformer or events), rather than ML (:-D).

For example, the 2-sentences after a period rule - it becomes another NP-hard NLU task. But we can at least detect if there are whole paragraphs without it.

Also, whoever adds this style "linter" is going to be faced with hundreds of violations at first, and will need to understand which are actually real.

The typical solution with code linters is to add something to allow exceptions.