Skip to content

Latest commit

 

History

History

hopsworks-IT

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Setup Testing VM

  1. Install ruby
  1. Ensure correct PATH:
  1. Clone hopsworks-ee repository git clone https://${GIT_TOKEN}@github.com/${GIT_USER}/hopsworks-ee hopsworks
  2. Setup ruby env:
  • cd hopsworks/hopsworks-IT/src/test/ruby
  • cp .env.example .env
  • .env setup - PROJECT_DIR=/home/vagrant/hopsworks
  • .env setup - OS=centos or ubuntu as necessary
  • Setup as root
    • sudo su
    • apt install ruby-dev libmysqlclient-dev
    • bundle install
  • If step above fails
    • ubuntu - apt-get install bundler
    • centos - gem install bundler
  • Rerun step above
  1. To run a single test
  • rspec ./spec/some_spec.rb:60
  1. If test uses hdfs and it fails on copy files
  • chmod 705 /home/vagrant

Testing Guide

The following steps must be taken to run Hopsworks integration tests:

-Warning: This test will clean hdfs and drop Hopsworks database. So it should only be used on a test machine.

First create a .env file by copying the .env.example file. Then edit the .env file by providing your specific configuration.

   cd hopsworks/hopsworks-IT/src/test/ruby/
   cp .env.example .env

Then export environments to match the server you are deploying to:

   GLASSFISH_HOST_NAME=localhost
   GLASSFISH_HTTP_PORT=8181
   GLASSFISH_ADMIN_PORT=4848

Change the server login credentials in hopsworks-IT/pom.xml

  <properties>
    ...
    <glassfish.admin>{username}</glassfish.admin>
    <glassfish.passwd>{password}</glassfish.passwd>
    ...
  </properties>

Export environments for Selenium integration test:

   HOPSWORKS_URL=http://localhost:8181/hopsworks
   HEADLESS=[true|false]
   BROWSER=[chrome|firefox]

To compile, deploy and run the integration test:

   cd hopsworks/
   mvn clean install -Pjruby-tests

If you have already deployed hopsworks-ear and just want to run the integration test:

   cd hopsworks/hopsworks-IT/src/test/ruby/
   bundle install
   rspec --format html --out ../target/test-report.html

To run a single test

   cd hopsworks/hopsworks-IT/src/test/ruby/
   rspec ./spec/session_spec.rb:60

To skip tests that need to run inside a vm

   cd hopsworks/hopsworks-IT/src/test/ruby/
   rspec --format html --out ../target/test-report.html --tag ~vm:true

When the test is done if LAUNCH_BROWSER is set to true in .env, it will open the test report in a browser.