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

Introduced tasks and configuration for testing releases. #299

Closed
wants to merge 11 commits into from
Closed

Conversation

pomek
Copy link
Member

@pomek pomek commented Aug 16, 2016

Fixes: #260

Requires: https://github.com/ckeditor/ckeditor5-dev-compiler/pull/23

This PR will introduce new tasks:

  • test:samples:local - building tests with local modules,
  • test:samples:bundled - building tests with bundled editor,
  • test:samples - an alias for above tasks,
  • compile:samples - building editors (needed for test:samples:bundled),
  • compile:samples:clean - removes built editors.

For testing it, you need to create some sample files:

ckeditor5-typing/docs/samples/typing.js

/**
 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md.
 */

/* global console:false, bender: false */

import ClassicEditor from '/ckeditor5/editor-classic/classic.js'; // editor:module

const done = bender.defer();

// sample:start
ClassicEditor.create( document.querySelector( '#editor' ), { // editor:name
    features: [ 'enter', 'typing', 'paragraph', 'undo', 'basic-styles/bold', 'basic-styles/italic' ], // sample:remove|editor:features
    toolbar: [ 'bold', 'italic', 'undo', 'redo' ]
} )
.then( editor => {
    window.editor = editor;
    done(); // sample:remove
}, err => {
    console.error( err.stack );
} );
// sample:end

describe( 'Typing sample', () => {
    it( 'contains default value', () => {
        const output = '<p><em>This</em> is an <strong>editor</strong> instance...</p>';

        expect( editor.getData() ).to.equal( output );
    } );
} );

ckeditor5-typing/docs/samples/typing.html

<div id="editor">
    <p><em>This</em> is an <strong>editor</strong> instance...</p>
</div>

ckeditor5-basic-samples/docs/samples/basic-styles.js

/**
 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md.
 */

/* global console:false, bender: false */

import ClassicEditor from '/ckeditor5/editor-classic/classic.js'; // editor:module

const done = bender.defer();

// sample:start
ClassicEditor.create( document.querySelector( '#editor' ), { // editor:name
    features: [ 'enter', 'typing', 'paragraph', 'undo', 'basic-styles/bold', 'basic-styles/italic' ], // sample:remove|editor:features
    toolbar: [ 'bold', 'italic', 'undo', 'redo' ]
} )
.then( editor => {
    window.editor = editor;
    done(); // sample:remove
}, err => {
    console.error( err.stack );
} );
// sample:end

describe( 'Basic Styles sample', () => {
    it( 'contains default value', () => {
        const output = '<p><em>This</em> is an <strong>editor</strong> instance...</p>';

        expect( editor.getData() ).to.equal( output );
    } );
} );

ckeditor5-basic-samples/docs/samples/basic-styles.html

<div id="editor">
    <p><em>This</em> is an <strong>editor</strong> instance...</p>
</div>

@pomek
Copy link
Member Author

pomek commented Aug 16, 2016

r- because there is still one bug. It will be fixed tomorrow (probably).

@pomek pomek modified the milestone: iteration 3 Aug 17, 2016
@@ -24,6 +24,15 @@ const config = {
// Path to the default configuration file for bundler.
BUNDLE_DEFAULT_CONFIG: 'dev/bundles/build-config-standard.js',

DOCUMENTATION: {
// Path to the built editors for samples.
EDITORS_DIST: '.docs/assets/scripts/samples',
Copy link
Member

Choose a reason for hiding this comment

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

.docs looks like a mistake.

Copy link
Member

Choose a reason for hiding this comment

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

OK, I can see that you meant to use .docs. Then this is bad. You should use some directory inside build/docs/. Also, aren't those files needed only temporarily?

Copy link
Member Author

Choose a reason for hiding this comment

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

During this issue, those editors aren't needed. But, in the future we will introduce docs-builder and that tool will need to have the editors (for sample pages).

Kamil Piechaczek and others added 2 commits August 19, 2016 10:06
@Reinmar
Copy link
Member

Reinmar commented Aug 19, 2016

There are couple of things that I noticed already:

  1. The sample tests (not bundled) should be generated together with all other tests (so when using gulp compile [--watch]). The goal is to use sample tests as part of integration tests. This, however, may require more coding, so we don't have to work on this in this PR.
  2. In the bundled scenario, the editor package is injected directly to test JS file. It should be saved on a disk as a separate file and loaded using bender-include directive (like here).
  3. When marking lines (// sample:remove|editor:features), I think that comma (followed by a space of course!) would be more suitable than | to separate directives.

@pomek
Copy link
Member Author

pomek commented Aug 19, 2016

I agree with all the points and I will fix those issues.

@Reinmar
Copy link
Member

Reinmar commented Aug 22, 2016

One thing that I want to think through is the naming of the commands. Right now there's lack of consistency and a lack of plan visible, because the tasks were created by many devs at different stages.

@Reinmar
Copy link
Member

Reinmar commented Aug 22, 2016

I extracted the first point from #299 (comment) to https://github.com/ckeditor/ckeditor5-dev-compiler/issues/24.

@Reinmar
Copy link
Member

Reinmar commented Aug 22, 2016

I pushed one more commit which cleans up few things in the gulpfile. I also reported a few tickets:

@Reinmar
Copy link
Member

Reinmar commented Aug 22, 2016

There are couple of things that still need to be taken care of:

  • Some garbage is left in build/dist/ after running gulp compile:bundled-sample-tests.
  • There's an inconsistency in config options – there's DOCS_DIR and DOCUMENTATION. Do I understand correctly that the first option will be removed soon? If so, then it can stay there for a while.
  • compiler.compile.tests should be renamed to compiler.compile.sampleTests.

Also, I start to think that we need a new repository for the docs things or something, because the code which bundles editors for release tests don't match any repository that we have now... We should think about this after closing these PRs.

@pomek
Copy link
Member Author

pomek commented Aug 23, 2016

@Reinmar,

  1. Done.
  2. Right, docs-builder will unify it.
  3. Done.

I start to think that we need a new repository for the docs things or something

@oskarwrobel mentioned about it. I also thought about it.

@Reinmar
Copy link
Member

Reinmar commented Aug 24, 2016

OK, I've done some refactoring here and there, moved some code from dependent PRs to this one (temporarily) and merged this code to branch docs. I changed deps to use GH links so running npm i after cleaning up node_modules/@ckeditor should switch all deps correctly.

Let's keep this code out of master until we have the documentation ready.

@Reinmar Reinmar closed this Aug 24, 2016
@Reinmar Reinmar deleted the t/260 branch August 24, 2016 15:17
@Reinmar Reinmar added this to the iteration 3 milestone Aug 24, 2016
@Reinmar Reinmar added type:feature This issue reports a feature request (an idea for a new functionality or a missing option). status:confirmed and removed module:docs type:feature This issue reports a feature request (an idea for a new functionality or a missing option). labels Aug 24, 2016
@Reinmar Reinmar removed this from the iteration 3 milestone Aug 24, 2016
mlewand pushed a commit that referenced this pull request May 1, 2020
Feature: Implemented a button that merges table cells directly from the table toolbar. Closes #6486.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants