eeditiones / tei-publisher-app

The main TEI Publisher app
https://teipublisher.com
GNU General Public License v3.0
68 stars 34 forks source link

Problem building integration tests #20

Closed adamretter closed 4 years ago

adamretter commented 4 years ago

Hi there,

I am following your instructions here https://github.com/eeditiones/tei-publisher-app/blob/master/webtest/README.md to try and build and run the integration tests.

I am on macOS Catalina, and node 12.18.3.

When I reach the npm install step, the build fails with the error:

❯ cd webtest
❯ npm install

> fibers@2.0.2 install /Users/aretter/tmp-code/tei-publisher-app/webtest/node_modules/fibers
> node build.js || nodejs build.js

  CXX(target) Release/obj.target/fibers/src/fibers.o
../src/fibers.cc:68:2: error: no template named 'Handle'
        Handle<String> NewLatin1String(Isolate* isolate, const char* string) {
        ^
../src/fibers.cc:69:10: error: no viable conversion from returned value of type 'Local<v8::String>' to function return type 'int'
                return String::NewFromOneByte(isolate, (const uint8_t*)string, NewStringType::kNormal).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:72:2: error: no template named 'Handle'
        Handle<String> NewLatin1Symbol(Isolate* isolate, const char* string) {
        ^
../src/fibers.cc:73:10: error: no viable conversion from returned value of type 'Local<v8::String>' to function return type 'int'
                return String::NewFromOneByte(isolate, (const uint8_t*)string, NewStringType::kNormal).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:94:2: error: no template named 'Handle'
        Handle<Object> NewInstance(Isolate* isolate, Local<Function> fn, int argc, Local<Value> argv[]) {
        ^
../src/fibers.cc:95:10: error: no viable conversion from returned value of type 'Local<v8::Object>' to function return type 'int'
                return fn->NewInstance(isolate->GetCurrentContext(), argc, argv).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:104:2: error: no template named 'Handle'
        Handle<Number> ToNumber(Local<Value> value) {
        ^
../src/fibers.cc:105:10: error: no viable conversion from returned value of type 'Local<v8::Number>' to function return type 'int'
                return value->ToNumber(Isolate::GetCurrent()->GetCurrentContext()).ToLocalChecked();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:126:58: error: no template named 'Handle'
        void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
                                                                ^
../src/fibers.cc:139:26: error: no template named 'Handle'
        void SetInternalPointer(Handle<T> handle, int index, void* val) {
                                ^
../src/fibers.cc:143:27: error: no template named 'Handle'
        void* GetInternalPointer(Handle<T> handle, int index) {
                                 ^
../src/fibers.cc:148:2: error: no template named 'Handle'
        Handle<T> Deref(Isolate* isolate, Persistent<T>& handle) {
        ^
../src/fibers.cc:153:14: error: no template named 'Handle'
        void Return(Handle<T> handle, const Arguments& args) {
                    ^
../src/fibers.cc:157:14: error: no template named 'Handle'
        void Return(Handle<T> handle, GetterCallbackInfo info) {
                    ^
../src/fibers.cc:165:2: error: no template named 'Handle'
        Handle<Value> ThrowException(Isolate* isolate, Handle<Value> exception) {
        ^
../src/fibers.cc:165:49: error: no template named 'Handle'
        Handle<Value> ThrowException(Isolate* isolate, Handle<Value> exception) {
                                                       ^
../src/fibers.cc:169:2: error: no template named 'Handle'
        Handle<Context> GetCurrentContext(Isolate* isolate) {
        ^
../src/fibers.cc:170:10: error: no viable conversion from returned value of type 'Local<v8::Context>' to function return type 'int'
                return isolate->GetCurrentContext();
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/fibers.cc:173:2: error: no template named 'Handle'
        Handle<Primitive> Undefined(Isolate* isolate) {
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/fibers/src/fibers.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/aretter/.nvm/versions/node/v12.18.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/aretter/.nvm/versions/node/v12.18.3/bin/node" "/Users/aretter/.nvm/versions/node/v12.18.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /Users/aretter/tmp-code/tei-publisher-app/webtest/node_modules/fibers
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
Alpine users please run: `sudo apk add python make g++`
sh: nodejs: command not found
npm WARN worker-loader@1.1.1 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! fibers@2.0.2 install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fibers@2.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aretter/.npm/_logs/2020-09-03T16_16_21_780Z-debug.log

We use node-gyp in several other projects, so I fairly sure my build environment is correct. Please advise...

joewiz commented 4 years ago

I wonder if the webtests are still current. Judging by the history of the webtest directory, the last work on the npm aspect of the tests was done by Tasmo in 2018, and surely the major changes to TEI Publisher 6 would've necessitated adjustments to these.

@windauer Is the continuous integration with Jenkins described at https://github.com/eeditiones/tei-publisher-app/tree/master/webtest#continuous-integration-with-jenkins still enabled?

adamretter commented 4 years ago

@joewiz These were the only tests that I could find. Also the https://jenkins.existsolutions.com/login?from=%2Fview%2FTei-Publisher%2Fjob%2Fteipublisher-web-components-test%2F appears to be a private CI with password protection.

If there are other tests elsewhere that anyone could point me to, I would be interested to run them...

windauer commented 4 years ago

@adamretter, @joewiz I fear the integration tests are outdated and won't work with TEI Publisher 6 anymore due to the web components. I just had a look at Jenkins and the tests have not been running for > 1 1/2 year. I guess we should remove them but thats something we should discuss with @wolfgangmm and @tuurma first.

We have a test suite in place for the TEI Publisher Webcomponents which can be executed by running npm run test:watch in the cloned tei-publisher-components repo (https://github.com/eeditiones/tei-publisher-components).

adamretter commented 4 years ago

@windauer I am not overly familiar with WebComponents, so please excuse any daft questions!

I took a look at the GitHub CI config for the tei-publisher-components. It appears that the tests for the WebComponents are executed against an older version 6.0.0-RC1 of the TEI-Publisher running on eXist-db 5.2.0.

Am I correct in thinking that the WebComponents are just the front-end? i.e. there are no integration tests there for any of the TEI code (XQuery, XSLT, etc.) running on eXist-db?

windauer commented 4 years ago

@adamretter yes, afaik this are only front-end and only unit tests. Currentlly there are no integration tests available since the old ones don't work anymore with Publisher 6. I plan to look into this issue in the near future. I'm quite new to this topic as well thats why I mentioned @wolfgangmm cause he did set up the Github Actions and current tests. Sorry if I can't help more.

adamretter commented 4 years ago

@windauer Okay understood. Thanks for your help so far. I just wanted to verify FusionDB compatibility with TEI Publisher, but without an integration test-suite that is a bit tricky...

wolfgangmm commented 4 years ago

New test suites are available in two places:

  1. tests for the UI webcomponents were moved to tei-publisher-components, in part copying the tests which were available here
  2. tests for the server-side functionality of TEI Publisher are currently in the branch for the next iteration: https://github.com/eeditiones/tei-publisher-app/tree/feature/open-api/test. They are up to date and cover the whole API.

To check compatibility on the XQuery and database level, 2) is what you want.

wolfgangmm commented 4 years ago

Note: running the tests from the branch currently requires development builds of oas-router and tei-publisher-lib. I'll send a message once we have reached a state when those dependencies can be pulled automatically.

adamretter commented 4 years ago

Thanks @wolfgangmm that's helpful. Can we keep the issue open until it's possible to do on the main branch

adamretter commented 3 years ago

@wolfgangmm @windauer I don't think this issue should be closed! It is still outstanding... I would still like to know how to build and test TEI Publisher so I can confirm it works on various platforms on-behalf of TEI Publisher users.

wolfgangmm commented 3 years ago

@adamretter I closed the issue because I already announced above that the tests will be available once the next version is released, so close means: done.

The test suite automatically runs via GitHub actions and you can launch it locally in the normal way, i.e. npm install, npm test after building (ant) and installing the TEI Publisher xar.

adamretter commented 3 years ago

@wolfgangmm I think something must be missing. I looked in the new test/ folder and there are very few tests. Are there some more tests elsewhere?

Also I checked GitHub Actions (CI workflow) and it says that the last launch was some 22 days ago, and that the tests failed; they also failed several times before (see the attached). Is there somewhere else I should be looking?

Screenshot 2021-01-05 at 12 02 55
wolfgangmm commented 3 years ago

@adamretter there are 62 tests and they should cover the entire API. Thanks to Open API, we can use existing libraries for testing API compliance. Since TEI Publisher 7, clients must communicate through the API, so if those tests pass, you can be pretty sure that the server side functionality is ok.

The TEI Publisher CI github workflow is old and disabled. The one which runs on every push or PR is TEI Publisher Docker Snapshots, which includes the test suite. Unfortunately github won't let me remove the old workflow results.

adamretter commented 3 years ago

Thanks, that's helpful. Along with the API, can you point me to where I can find the tests for the UI?

wolfgangmm commented 3 years ago

The UI tests are part of tei-publisher-components and are run via GitHub actions as well. Because the entire UI is built with web components, the tests concentrate on the correctness of the interface each component provides and are less interesting with respect to client-server communication.

adamretter commented 3 years ago

@wolfgangmm I see about ~20 tests in tei-publisher-components/test is that the correct place?

Assuming so, I will get it tested and certified for Elemental and FusionDB.