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

WIP [poc] frontend api tests #5654

Closed
wants to merge 1 commit into from
Closed

Conversation

akosyakov
Copy link
Member

not to merge, only to test travis integration

@akosyakov akosyakov force-pushed the ak/frontend-api-tests branch 10 times, most recently from 00d55bf to e4029b4 Compare July 7, 2019 20:20
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
@akosyakov
Copy link
Member Author

akosyakov commented Jul 8, 2019

Generally it is easy to setup for development mode:

  • there is a mocha widget with test results
  • one can debug with dev tools
  • rerun a single test from the mocha widget
  • use grep query param to filter out tests

But integration into Electron and CI is tricky.

I like an approach though it would force us also write more client code for our APIs. An example of a test here: https://github.com/theia-ide/theia/pull/5654/files#diff-ca8616a6aeb302a3499225248b5c82bc

cc @marechal-p @marcdumais-work @svenefftinge

@akosyakov
Copy link
Member Author

Ideally i would like to have something like inversify/InversifyJS#1104 But it is not trivial i would leave it out for first attempt.

@akosyakov akosyakov added the test issues related to unit and api tests label Jul 8, 2019
Copy link
Member

@paul-marechal paul-marechal left a comment

Choose a reason for hiding this comment

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

Looking good! I don't get everything 100% straight yet, but I'll definitely look into it next week. The test you added looks really simple already.

});

it("should show 'Explorer' and 'SCM'", () => {
assert.ok(false);
Copy link
Member

Choose a reason for hiding this comment

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

I imagine that you added this line to see if the test would fail?

Does it work without this line? Right now we can see errors in travis.

Copy link
Member Author

Choose a reason for hiding this comment

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

right :) but:

  • results are duplicated, once reported by headless chrome and second time by backend logging frontend console
  • it does not look properly formatted i.e. %d %s are not replaced

describe('files tab', () => {
it('should open/close the files tab', async () => {
shell.leftPanelHandler.activate('files');
await new Promise(resolve => window.requestAnimationFrame(resolve));
Copy link
Member

Choose a reason for hiding this comment

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

In this case, is this related to the missing client APIs you were talking about? Would it be a good idea to make .activate return a promise for when it is activated?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, we should do. We have code already in WidgetOpenHandler. Need to move it into the shell.

@@ -0,0 +1,113 @@
// @ts-check
const path = require('path');
Copy link
Member Author

Choose a reason for hiding this comment

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

it should not be here

@akosyakov akosyakov added the quality issues related to code and application quality label Jul 10, 2019
@akosyakov
Copy link
Member Author

this approach was discarded since it requires building tests as part of the application, see #6409 (comment)

@akosyakov akosyakov closed this Jan 8, 2020
@akosyakov akosyakov deleted the ak/frontend-api-tests branch January 16, 2020 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quality issues related to code and application quality test issues related to unit and api tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants