Giter Club home page Giter Club logo

taf's Introduction

TAF

Initial Setup

On Linux

  1. Install Java. sdkman is a very useful tool for this. JDK 11 is preferred as Jython doesn't seem to like JDK8 on Ubuntu 18+.

  2. Install Jython and add submodule dependency. Download Jython Installer from here

jython_path=/opt/jython
mkdir $jython_path
java -jar jython-installer-2.7.2.jar -d $jython_path -s

# Installing dependency packages
cat requirements.txt | xargs | xargs $jython_path/bin/easy_install

# Adding a submodule to the Git repository
git submodule init
git submodule update --init --force --remote

On Mac

# Installs Jython 2.7.3
brew install jython

# Installing dependency packages
cat requirements.txt | xargs | xargs jython -m pip install

# Adding a submodule to the Git repository
git submodule init
git submodule update --init --force --remote

Test Environment Requirement

- Set of VMs with Couchbase-Server running with correct version. General practice: Keep Couchbase credentials as Administrator:password.
- ssh access for root user on the VMs.

One way of setting this up is: Clone vagrants

git clone https://github.com/couchbaselabs/vagrants.git

Choose one of those sub-folders, and run vagrant up in it.

Get the ip addresses of the node as we need to later in ini file. vagrant status

Change the password of the nodes for root user to password:

vagrant ssh node1
sudo passwd

Enable root login

cd /etc/ssh
vi sshd_config

Enable root login for the vagrant boxes. To do that, change this setting(It may be different on various linus flavors):

PermitRootLogin yes

Restart sshd:

sudo systemctl restart sshd or sudo service restart sshd, depending on your vagrant's Linux flavour.

Running

When running Jython, you have to supply the CLASSPATH. For a typical Java program this is long, and typically project management tools like Gradle and Maven are used to automatically pull in all dependencies, produce the CLASSPATH, and run the Java app.

So a gradle project is included with a task, "testrunner", that runs Jython on the testrunner.py script, sorting out the CLASSPATH automatically (including downloading all dependencies). A Gradle Wrapper of the correct version is also provided.

Execute:

./gradlew --refresh-dependencies testrunner -P jython="/path/to/jython" -P args="-i <ini file path> -t <absolute path of test case>"```

Examples:
  ./gradlew --refresh-dependencies testrunner -P jython="/path/to/jython" -P args="-i tmp/local.ini -t rebalance_new.rebalance_in.RebalanceInTests.test_rebalance_in_with_ops,nodes_in=3,GROUP=IN;P0;default -m rest"

(Replace gradlew with gradlew.bat on Windows).

The above command will run the test mentioned using -t option on the cluster defined in local.ini file.

NOTE: (The --refresh-dependencies isn't strictly required every run. It makes sure that the latest versions of any SNAPSHOT dependencies have been loaded - e.g. for transactions.)

Sample ini file for 4 node cluster

[global]
username:root <ssh user>
password:couchbase <password>
index_port:9102
n1ql_port:8093

[membase]
rest_username:Administrator <Couchbase server console user>
rest_password:password <Couchbase server console password>

[servers]
1:_1
2:_2
3:_3
4:_4

[_1]
ip:<IP>
port:8091
services:kv

[_2]
ip:<IP>
port:8091
services:kv

[_3]
ip:<IP>
port:8091
services:kv

[_4]
ip:<IP>
port:8091
services:kv

Cluster_run support

TAF supports cluster_run with following additional params under the specified sections, Note: Make sure your rest_password is 'password'

[global]
username:Administrator
password:password
# Base directory of the CB Server repo checkout, used to locate cli tools
cli:/path/to/couchbase/server/source/dir

[membase]
rest_username:Administrator
rest_password:password

[servers]
1:_1
2:_2
3:_3

[_1]
ip:127.0.0.1
port:9000
memcached_port:12000

[_2]
ip:127.0.0.1
port:9001
memcached_port:12002

[_3]
ip:127.0.0.1
port:9002
memcached_port:12004

Jython Issues

If Jython reports Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;

Jython appears to be broken on Ubuntu 18+: https://bugs.launchpad.net/ubuntu/+source/jython/+bug/1771476

Resolved by changing to OpenJDK 11. With sdkman installed:

sdk use java 11.0.3-zulu

taf's People

Contributors

ashwin2002 avatar ritalrw avatar bkumaran avatar ankushsharma29 avatar sumedhpb avatar umang-cb avatar anithakuberan avatar raghavsake avatar pulkitm1 avatar vipbhardwaj avatar bharath-gp avatar shaazin19 avatar vibhavshiras1 avatar koushalsharma avatar codingminions avatar sanjitchauhan avatar mohsin-couchbase avatar sreebhargava143 avatar ritamcouchbase avatar pavithra-mahamani avatar cgghali avatar ajaybhullar avatar pierrecouch avatar abhayayay avatar pavan-couchbase avatar akshat-jain1811 avatar sujay2611 avatar abhiksahu avatar jrawsthorne avatar arod1987 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.