Commit bfd5375ba60f93a7fedcf9c8d19c95839d9e7515

Authored by Alessandro Palmeira + Diego Araujo + Eduardo Morais
Committed by Paulo Meireles
1 parent 4b59a860

[Mezuro] Draft to tests with monkey server

features/support/hooks.rb
1 1 Before('@mezuro') do |scenario|
2   - command = "#{RAILS_ROOT}/plugins/mezuro/features/initialize_monkey_server.sh \"#{scenario.name}\""
  2 + command = "#{RAILS_ROOT}/plugins/mezuro/features/monkey-server/call_monkey_server.sh \"#{scenario.name}\""
3 3 system command
4 4 end
... ...
plugins/mezuro/features/call_monkey_server.sh 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +#!/bin/bash
  2 +
  3 +MONKEY_SERVER_ADDRESS="localhost"
  4 +MONKEY_SERVER_PORT=50688
  5 +
  6 +# Ignore errors from all commands
  7 +trap "" ERR
  8 +
  9 +exec 5<>/dev/tcp/$MONKEY_SERVER_ADDRESS/$MONKEY_SERVER_PORT
  10 +echo "SCENARIO $1" >&5
  11 +echo "Calling monkey-server in Scenario $1"
... ...
plugins/mezuro/features/creating_project.feature
  1 +@mezuro
1 2 Feature: Create project
2 3 As a mezuro user
3 4 I want to create a Mezuro project
... ...
plugins/mezuro/features/initialize_monkey_server.sh
... ... @@ -1,9 +0,0 @@
1   -#!/bin/bash
2   -
3   -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4   -MEZURO_HOME="$DIR/.."
5   -
6   -# Ignore errors from all commands
7   -trap "" ERR
8   -
9   -
plugins/mezuro/features/monkey-server/call_monkey_server.sh 0 → 100755
... ... @@ -0,0 +1,11 @@
  1 +#!/bin/bash
  2 +
  3 +MONKEY_SERVER_ADDRESS="localhost"
  4 +MONKEY_SERVER_PORT=50688
  5 +
  6 +# Ignore errors from all commands
  7 +trap "" ERR
  8 +
  9 +exec 5<>/dev/tcp/$MONKEY_SERVER_ADDRESS/$MONKEY_SERVER_PORT
  10 +echo "SCENARIO $1" >&5
  11 +echo "SCENARIO $1"
... ...
plugins/mezuro/features/monkey-server/initialize_monkey_server.sh 0 → 100755
... ... @@ -0,0 +1,5 @@
  1 +#!/bin/bash
  2 +cd $(dirname $0)
  3 +cp ../../service.yml ../../regular-service.yml
  4 +mv ../../acceptance-test.yml.example ../../service.yml
  5 +
... ...
plugins/mezuro/features/monkey-server/terminate_monkey_server.sh 0 → 100755
... ... @@ -0,0 +1,3 @@
  1 +#!/bin/bash
  2 +cd $(dirname $0)
  3 +mv ../../regular-service.yml ../../service.yml
... ...