Skip to content

Commit

Permalink
Merge pull request #1 from wallarm/feature/less_params
Browse files Browse the repository at this point in the history
Make integration use less params
  • Loading branch information
promix17 authored May 15, 2019
2 parents 0f63d10 + ddef55b commit 70a1fc1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ Create your FAST node here:
https://my.wallarm.com/nodes

```sh
export UUID=<YOUR WALLARM UUID>
export SECRET=<YOUR WALLARM SECRET>
export CLIENTID=<YOUR WALLARM CLIENTID>
export NODEID=<YOUR WALLARM NODEID>
export TOKEN=<YOUR WALLARM NODE TOKEN>

sudo -E docker-compose build
Expand All @@ -29,10 +25,6 @@ sudo -E docker-compose down

Create a project and pass following ENV variables:
```
UUID <YOUR WALLARM UUID>
SECRET <YOUR WALLARM SECRET>
CLIENTID <YOUR WALLARM CLIENTID>
NODEID <YOUR WALLARM NODEID>
TOKEN <YOUR WALLARM NODE TOKEN>
```

Expand Down
6 changes: 2 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ services:
- fast
environment:
CAPYBARA_SERVER_HOST: app-test
WALLARM_UUID: ${UUID}
WALLARM_SECRET: ${SECRET}
CLIENT_ID: ${CLIENTID}
NODE_ID: ${NODEID}
WALLARM_API_TOKEN: ${TOKEN}
WALLARM_API_HOST: api.wallarm.com
ports:
- '3000:3000'
networks:
Expand Down
15 changes: 6 additions & 9 deletions spec/support/fast_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module FastHelper
TEST_RUN_FINAL_STATES = %w[failed passed interrupted].freeze

def create_test_run
url = 'https://api.wallarm.com/v1/test_run'
url = "https://#{ENV['WALLARM_API_HOST']}/v1/test_run"

response = RestClient.post url, test_run_params, auth_headers

Expand All @@ -26,7 +26,7 @@ def stop_test_record
# TODO: check for FAST node exported all recorded baselined
sleep 8

url = "https://api.wallarm.com/v1/test_record/#{@test_record_id}/action/stop"
url = "https://#{ENV['WALLARM_API_HOST']}/v1/test_record/#{@test_record_id}/action/stop"

RestClient.post url, {}, auth_headers
end
Expand Down Expand Up @@ -61,18 +61,15 @@ def wait_test_run_for_finish

def auth_headers
{
'X-WallarmAPI-UUID' => ENV['WALLARM_UUID'],
'X-WallarmAPI-Secret' => ENV['WALLARM_SECRET']
'X-WallarmApi-Token' => ENV['WALLARM_API_TOKEN']
}
end

def test_run_params
{
'name' => 'FAST Rails example',
'desc' => 'rails, rspec, capybara example',
'type' => 'node',
'node_id' => ENV['NODE_ID'],
'clientid' => ENV['CLIENT_ID']
'name' => 'FAST Rails example',
'desc' => 'rails, rspec, capybara example',
'type' => 'node'
}
end
end

0 comments on commit 70a1fc1

Please sign in to comment.