-
Notifications
You must be signed in to change notification settings - Fork 11
Conversation
client/browser-app/test/test.ts
Outdated
import { Selector } from "testcafe"; | ||
|
||
// Insert the Path to the default Workbench here | ||
const absPathToWorkspace = "D:/Users/Uni/Dokumente/workspaces/EclipseSource/ecore-glsp/client/workspace"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To run the tests the path to the default Workspace needs to be set at the top of the file.
Absolute paths must absolutely be avoided, as it is not possible for each developer to adjust the path to his own local setup. We should maybe consider passing the workspace path programmatically, as an argument, when running the test (Something similar to the start:debug script, with --root=../workspace
Even localhost:3000
is probably an unreliable value, as it's just the default port on which the server is started, when nothing else is specified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the problem. But i am not quite sure how to handle it. Right now there seems to be no way to create custom parameters for testcafe tests. Do you have an idea on how we could work around that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could simply resolve the relative path "../../workspace" with the help of the path
library? Similar to how the jarpath is resolved in the coffee editor:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the Path relative. However i am not quite sure how and if we should handle the problem with the port, that @CamilleLetavernier mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how would one start the tests? must this be added to the package.json ? can we pass the port there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no don't touch the package.json, just adapt the code to check for the variable and otherwise read the value from the config file as shown in the SO link. In the config you set the port to 3000 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok i did that. I did not use the config file i just created a const in the test, that takes the enviroment variable and if that is not available just calls 3000.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the config file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config file only works, if you call the run command in the directory the config is in, so in our case browser-app/test
. This would prevent the developer from calling the tests in the client directory. If we are fine with that I can add it to the config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this in the documentation. Aren't you simply importing the config file via a path in your test?
Could you update the commit message by applying some of the tips from this blog. |
acda4f8
to
64566ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to move the new test files from the browser-app
folder to a new tests
or e2e-tests
.
Further add a .testcaferc.json
and add a tsConfigPath property. The referenced tsconfig should also be part of the new folder. The tsconfig should be something like this:
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true
}
}
Ideally it should enable the strict
property.
The .testcaferc.json
would be something like this:
{
"tsConfigPath": "./tests/tsconfig.json"
}
With this the config can be imported: import * as config from "./config.json";
.
Besides this refactorings and code improvements, the tests didn't work for me.
The relPathToWorkspace is not working for me, I needed to remove one '..'
.
I also needed to change the fixture to fixture`Ecore-glsp E2E-Testing`// declare the fixture .page`http://localhost:${port}/#${relPathToWorkspace}
.
In order to ease the test execution I suggest to add an entry to the package.json in the client folder which would start theia and start the tests.
It might make sense to squash all commits into one after the requested changes. |
@eneufeld What would be the best way to start theia from the client folder package.json? The way that i do it is by |
@simongraband I would do it just as you suggest |
@eneufeld Ok i tried to do that, however since the Do you know any way to supress the log messages of |
Sorry I don't know any option. Did you try the different options described here: https://github.com/mysticatea/npm-run-all/blob/master/docs/npm-run-all.md ? |
I think the best option would be |
0ffdb97
to
6e31d44
Compare
Commits are now squashed. |
@CamilleLetavernier could you recheck |
6e31d44
to
6ff4175
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look really good! A few more comments:
- Currently, each developer needs to install testcafe. I would add it to the dev-dependencies of the project, so it would be installed automatically
- Since the Ecore GLSP Server also has to be started separately, I would add a short section about how to run the tests in the README (Start the Ecore server, then run yarn..)
Now I can run the tests and a lot of things happen, but I still get 13 failures out of 18 tests
I couldn´t add testcafe to the dependencies using Regarding the 13 failures. I realized, that there is currently a bug, that does not update the workbench view, when the filesystem is updated. It only works after reloading. This leads to the failures in the tests. Also there are some tests which are failing since the tested feature is not working properly. |
FYI: since we are using yarn you can install devdependencies with |
29b4a66
to
ed85e9b
Compare
Ok so i found some problems with the tests and fixed them. Now only 5/18 tests should fail. Those are
@CamilleLetavernier could you quickly confirm that these are the errors you encounter as well? |
@eneufeld seems like the python bug appeared again. Could you maybe re-run the build again? |
I initially had 9/18 failures, but 4 of them are related to a dirty workspace (Containing uncommitted ecore models). Maybe we should consider using a different workspace specifically for the tests to avoid this; but this can be ignored for now. For reference, the tests that fail on a dirty workspace are:
After running a full clean/rebuild, I still have 6 failures (Or 5 in the first run):
3 of these errors seem to be expected; I'm not sure about the
May be expected as well (But ENTF should probably be renamed to DEL :) )
Is this an unexpected failure? Also, one of the expected failures seems to work for me:
Even though #89 is now fixed on master, the fix isn't included in this branch, so I'm not sure if that's really expected. In general, the waiting times are a bit long. It took 5~6 minutes to run the tests, because many assertions have a 5 seconds wait time. It's not always easy to avoid wait times completely, so let's ignore this for now. We can investigate a better solution later on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking issues have been solved; I think it's OK to merge this now. Follow-up tickets should be created for the remaining issues (When such tickets don't exist already)
@CamilleLetavernier regarding your testresults: The Fail with the with ENTF-deletion(i will refactor that :)) has a ticket(#103) and is expected. The only tests that do not behave like expected are |
7d39316
to
48925de
Compare
Should the tests be updated to match the recent changes? I get errors such as:
But PR #105 changed the label "Composition" to "Containment". There may be other outdated tests, as I now have 8/18 failures |
I fixed the tests so that only the expected tests are failing.
Also updated the README, since the server, client and tests can now be started with one command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! :)
I would like to solve the issue with the build before merging this, maybe the whole issue is solved when we update theia to the latest version which uses node 10, I talk with @tortmayr |
@simongraband I talked with @tortmayr and we are sure the build issue would be solved with an update of glsp and theia |
@eneufeld do you have a link to the issue? Also node 8 seems not to work... |
weird that node 8 is not working, that used to work, I clean the cache .. |
b8f9b8d
to
2623a3f
Compare
Signed-off-by: simonGraband <[email protected]>
2623a3f
to
857d3f9
Compare
Looks like it was a cache issue |
To run the tests run `testcafe chrome browser-app/test/test.ts´ in the client folder.yarn e2etest
in the client folder starts theia and the tests.Part of Issue #17
Signed-off-by: simonGraband [email protected]