Problem/Motivation

Currently, there are absolutely no tests for this project.

This is/was, in part, due to time constraints and the need to get a stable release out the door.

It is also in part due to the requirements of external libraries and PECL extensions that will make setting up DrupalCI... challenging (the latter not, yet, supported #2949210: Drupalci Roadmap).

We can, however, start to implement tests for the Drupal side of things (i.e. plugin managers, plugins, etc.).

Proposed resolution

Split out areas where tests are needed and create sub-tasks for implementing them.

Issue fork markdown-3135359

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

markcarver created an issue. See original summary.

  • markcarver committed 8957804 on 8.x-2.x
    Issue #3135359 by markcarver: Add drupalci.yml
    
    Signed-off-by: Mark...

  • markcarver committed 6dff4e1 on 8.x-2.x
    Issue #3135359 by markcarver: Add drupalci.yml
    
    Signed-off-by: Mark...

  • markcarver committed c04189d on 8.x-2.x
    Issue #3135359 by markcarver: Add drupalci.yml
    
    Signed-off-by: Mark...

MegaChriz made their first commit to this issue’s fork.

megachriz’s picture

Status: Active » Needs work

A useful first start would be to specify all possible libraries that the Markdown module can work with as dev dependencies. These can be listed in the "require-dev" section in the composer.json file. These dependencies are then only downloaded by the testbot, not when requiring the module using the command "require drupal/markdown".

See the issue branch for this change. I based it on the 8.x-2.x branch for now, because it looks like that one is ahead of 3.0.x.

Note: in #3222716: Error: Call to a member function getId() on bool in markdown_preprocess_installable_library() (line 179 of markdown.module) I added a base class for Markdown kernel tests.

  • markhalliwell committed 6dff4e1 on 3.0.x
    Issue #3135359 by markcarver: Add drupalci.yml
    
    Signed-off-by: Mark...
  • markhalliwell committed 8957804 on 3.0.x
    Issue #3135359 by markcarver: Add drupalci.yml
    
    Signed-off-by: Mark...
  • markhalliwell committed c04189d on 3.0.x
    Issue #3135359 by markcarver: Add drupalci.yml
    
    Signed-off-by: Mark...

megachriz’s picture

I've written a few tests to render a text with each markdown parser. Only for the CommonMark PECL parser I marked the test as incomplete because that one requires a PECL extension. Without the markTestIncomplete() call, the fails with the error Call to undefined function CommonMark\Parse().

megachriz’s picture

Status: Needs work » Needs review

I think that we have enough tests to start with.

joelpittet made their first commit to this issue’s fork.

joelpittet’s picture

Status: Needs review » Fixed

Thanks @megachriz for taking this on. I am committing this to the dev branch.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • joelpittet committed 07cb53d1 on 3.0.x authored by megachriz
    feat: #3135359 [markdown] Add Tests
    
    By: @megachriz
    By: @joelpittet
    By...
megachriz’s picture

@joelpittet
Ah, thanks for merging! That work project that I talked with you about on Slack last week has been demanding all my work time in the past 6+ months, so I wasn't able to continue with Markdown during office hours.

megachriz’s picture

For your interest, in 3135359-temp I made an attempt to run tests for both CommonMark v1 and v2, so that we could get test coverage for #3283349: Add support for Commonmark v2. Since the tests weren't merged before, I temporarily experimented with it in this issue instead.

So ideally, the commits from that temp branch that are worth it, should move to #3283349: Add support for Commonmark v2.

joelpittet’s picture

Thanks @megachriz I will try to move the commits over there.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.