Connection errors when running functional_test_runner.js

Hello,

I'm having an issue with running tests for kibana. These are the steps I took to run the tests.

  1. cloned the 6.3.4 repo to a directory
  2. ran yarn kbn bootstrap in the kibana directory.
  3. ran node ./script/functional_test_runner.js

it opens up a web browser and does some UI testing with the following output:

$ node ./scripts/functional_test_runner.js 
 info  Config loaded
 info  Starting local chromedriver at port 9515
 info  Remote initialized
 info  Starting tests

 └-: console app
   └-> "before all" hook
   └-> "before all" hook
   └-: console app
     └-> "before all" hook
     └-> "before all" hook

then I get errors stating:

unable to revive connections: http://localhost:9220/

here's the full log: https://pastebin.com/jF1BhDgB

I'm running Kibana 6.3.4 from the github repo on Centos 7.

Let me know if there's a part of the documentation that I missed that might address this.

You either need to run node scripts/functional_tests_server before the test_runner or run directly with node scripts/functional_tests . You can read the description of the functional test suite here: https://www.elastic.co/guide/en/kibana/current/development-functional-tests.html

Ah I see now. I tried running functional_tests.js and this is my output

node ./scripts/functional_tests.js 
 info  Installing from snapshot
   │ info  version: 6.3.2
   │ info  install path: /home/sreynolds/kibana/kibana/.es/test-rwu9yk212d
   │ info  license: oss
   │ info  downloading from https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-oss-6.3.2-SNAPSHOT.tar.gz
Error: Not Found

Running functional_tests_server.js produces the same result. Is there somewhere I can change the URL to a valid URL?

you need to run on master or 6.x, i don't think we have snapshots stored for 6.3.2.

Okay, what I'm trying to do is write some tests for a plugin developed in kibana-6.3.2 and the documentation says to use functional_test_runner. Is there another way to write tests for this plugin without having to change kibana version?

Hmm, you can try to run it with ES from source by adding this as a parameter --esFrom=source to the call.

Alright that got me passed the URL error. Is there a way to use an already running elasticsearch server instead of starting a new one or am I misunderstanding what it's actually doing with elasticsearch?

you don't need to use a new elasticsearch server. just set that setting and restart the browser.

Is the functional tests script not starting a new elasticsearch server to use during the tests?

I tried adding --esFrom=source to the command and it was looking for elasticsearch in the directory below kibana. I cloned elasticsearch in the directory it was expecting to find it in and It failed to build due to some java error. https://pastebin.com/ebzmg1uF

According to https://www.elastic.co/guide/en/kibana/current/development-functional-tests.html the 3rd option looks like I can use a remote instance of elasticsearch for testing. This would be a better option than building elasticsearch locally, but I am a little reluctant using an elasticsearch that contains data that I don't want to lose. Do the Kibana tests have any affect on the elasticsearch data? I cant imagine it would but I figured I'd ask.

You can run a clean ES instance. This will be the safest option. I think even the latest 6.3 release should work with your branch. Just use the environment variables TEST_ES... to set the address for your ES.

Okay, I'll try that out next week. Thanks for the help!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.