Skip to content

Commit

Permalink
chore: using docker bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
derrandz committed Dec 11, 2017
1 parent 60f949e commit ae5fb87
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ env:
global:
- NODE_ENV=test
- DEEPSTREAMIO_SERVER_GITURL=https://github.com/deepstreamIO/deepstream.io.git
- SELENIUM_NET=172.28.0.0
- SELENIUM_HUB_IP=172.28.0.2
- TEST_PAGE_HOST=172.28.0.1 # required for ci:e2e:test-page
- DEEPSTREAM_HOST=172.28.0.1
- SELENIUM_NET=172.17.0.0
- SELENIUM_HUB_IP=172.17.0.2
- TEST_PAGE_HOST=172.17.0.1 # required for ci:e2e:test-page
- DEEPSTREAM_HOST=172.17.0.1
- STACK_STARTUP_TIMEOUT=30 # in seconds, the time required for deepstream server and selenium grid to go up

before_install:
- docker network create --subnet=$SELENIUM_NET/16 seleniumnet
- docker run -d -p 4444:4444 --name selenium-hub --network seleniumnet --ip $SELENIUM_HUB_IP selenium/hub:3.8.1-aluminum
- docker run -d --link selenium-hub:hub --network seleniumnet selenium/node-chrome:3.8.1-aluminum
- docker run -d --link selenium-hub:hub --network seleniumnet selenium/node-firefox:3.8.1-aluminum
# - docker network create --subnet=$SELENIUM_NET/16 seleniumnet
- docker run -d -p 4444:4444 --name selenium-hub selenium/hub:3.8.1-aluminum
- docker run -d --link selenium-hub:hub selenium/node-chrome:3.8.1-aluminum
- docker run -d --link selenium-hub:hub selenium/node-firefox:3.8.1-aluminum
- mkdir deepstream.io && cd deepstream.io
- git clone $DEEPSTREAMIO_SERVER_GITURL ./
- git submodule update --init --recursive
- npm install && npm run tsc && cd ..
- sudo chmod +x ./deepstream.io/dist/bin/deepstream
- (./deepstream.io/dist/bin/deepstream start --host $DEEPSTREAM_HOST --http-port 3030 > /dev/null 2>&1) & # providing http port to avoid port conflict with test page (uses 8080)
- sleep $STACK_STARTUP_TIMEOUT
- wget -O- http://$SELENIUM_HUB_IP:4444/wd/hub
- wget -O- http://$SELENIUM_HUB_IP:4444/grid/console
- wget -O- http://$DEEPSTREAM_HOST:3030/health-check

script:
Expand Down
10 changes: 5 additions & 5 deletions test-page/test/selenium/conf/local.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
disable_colors: false,
selenium: {
log_path: '',
host: useDockerizedSelenium ? '172.28.0.2' : '127.0.0.1',
host: useDockerizedSelenium ? '172.17.0.2' : '127.0.0.1',
port: 4444,
start_process: !useDockerizedSelenium,
server_path: !useDockerizedSelenium ? seleniumServer.path : undefined,
Expand All @@ -33,9 +33,9 @@ module.exports = {
on_failure : true,
path: 'screenshots/default'
},
launch_url: useDockerizedSelenium ? 'http://172.28.0.1:8080' : 'http://localhost:8080',
launch_url: useDockerizedSelenium ? 'http://172.17.0.1:8080' : 'http://localhost:8080',
selenium_port: 4444,
selenium_host: useDockerizedSelenium ? '172.28.0.2' : '127.0.0.1',
selenium_host: useDockerizedSelenium ? '172.17.0.2' : '127.0.0.1',
desiredCapabilities: {
browserName: 'phantomjs',
javascriptEnabled: true,
Expand All @@ -45,8 +45,8 @@ module.exports = {
},
chrome: {
screenshots : {
enabled : true,
on_failure : true,
enabled : false,
on_failure : false,
path: 'screenshots/chrome'
},
desiredCapabilities: {
Expand Down
2 changes: 1 addition & 1 deletion test-page/test/selenium/features/authentication.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: As test-page user, I want to be able to enter the server address so tha

Background:
Given I am on the test-page
And I add a client with address "172.28.0.1:6020/deepstream"
And I add a client with address "172.17.0.1:6020/deepstream"
And A client component is displayed with id "1"

Scenario: Login with the standard user
Expand Down
2 changes: 1 addition & 1 deletion test-page/test/selenium/features/connection.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Feature: As a test-page user, I want to be able to add a client that connects to
Given I am on the test-page

Scenario: Entering the address and clicking add-client button create a client component
When I enter text "172.28.0.1:6020" in field "input#input-add-client"
When I enter text "172.17.0.1:6020" in field "input#input-add-client"
And I click "button#btn-add-client"
Then A client component is displayed with id "1"
6 changes: 3 additions & 3 deletions test-page/test/selenium/features/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: As test-page user, I want to be able emit an event, subscribe to and li

Background:
Given I am on the test-page
And I add a client with address "172.28.0.1:6020/deepstream"
And I add a client with address "172.17.0.1:6020/deepstream"
And A client component is displayed with id "1"
And I login with standard user
And Connection state becomes "OPEN"
Expand All @@ -21,9 +21,9 @@ Feature: As test-page user, I want to be able emit an event, subscribe to and li
And I receive update "from provider" in event "stock-market"

Scenario: Subscribe to event by two clients and receive emits from a third
Given Client with id "2" and name "elton-mars" logs in to server "172.28.0.1:6020"
Given Client with id "2" and name "elton-mars" logs in to server "172.17.0.1:6020"
And Client with id "2" subscribes to event "universe-news"
And Client with id "3" and name "elton-venus" logs in to server "172.28.0.1:6020"
And Client with id "3" and name "elton-venus" logs in to server "172.17.0.1:6020"
And Client with id "3" subscribes to event "universe-news"
When I emit event "universe-news" with data "Breaking News: Darkmatter is demystified!"
Then Client with id "2" receives event "universe-news" with data "Breaking News: Darkmatter is demystified!"
Expand Down
2 changes: 1 addition & 1 deletion test-page/test/selenium/features/presence.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: As test-page user, I want to be able query users online status so I'd k

Background:
Given I am on the test-page
And I add a client with address "172.28.0.1:6020/deepstream"
And I add a client with address "172.17.0.1:6020/deepstream"
And A client component is displayed with id "1"
And I login with standard user
And Connection state becomes "OPEN"
Expand Down
2 changes: 1 addition & 1 deletion test-page/test/selenium/features/records.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: As test-page user, I want to be able create a record so I can use all r

Background:
Given I am on the test-page
And I add a client with address "172.28.0.1:6020/deepstream"
And I add a client with address "172.17.0.1:6020/deepstream"
And A client component is displayed with id "1"
And I login with standard user
And Connection state becomes "OPEN"
Expand Down
6 changes: 3 additions & 3 deletions test-page/test/selenium/features/rpcs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: As test-page user, I want to be able to call the echo rpc

Background:
Given I am on the test-page
And I add a client with address "172.28.0.1:6020/deepstream"
And I add a client with address "172.17.0.1:6020/deepstream"
And A client component is displayed with id "1"
And I login with standard user
And Connection state becomes "OPEN"
Expand All @@ -13,9 +13,9 @@ Feature: As test-page user, I want to be able to call the echo rpc
Then I receive the response "Hello World" of rpc "echo"

Scenario: Client A provides RPC and Client B is able to use it
Given Client with id "2" and name "elton-mars" logs in to server "172.28.0.1:6020"
Given Client with id "2" and name "elton-mars" logs in to server "172.17.0.1:6020"
And Client with id "2" provides rpc "multiplication"
And Client with id "3" and name "elton-venus" logs in to server "172.28.0.1:6020"
And Client with id "3" and name "elton-venus" logs in to server "172.17.0.1:6020"
And Client with id "3" tries to provide rpc "multiplication" and finds it already provided
When Client with id "3" makes rpc "multiplication" with arguments "1, 2"
Then Client with id "3" receives results "2" from rpc "multiplication"
Expand Down
6 changes: 3 additions & 3 deletions test-page/test/selenium/features/test-page.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Feature: As test-page user, I want to be able to enter the server address so tha
Given I am on the test-page

Scenario: Go to test-page, enter one address, get one client component
When I add a client with address "172.28.0.1:6020/deepstream"
When I add a client with address "172.17.0.1:6020/deepstream"
Then A client component is displayed with id "1"
Then The "connection" component is displayed for client component with id "1"
Then The "error-logger" component is displayed for client component with id "1"
Expand All @@ -15,9 +15,9 @@ Feature: As test-page user, I want to be able to enter the server address so tha
Then The "presence" component is displayed for client component with id "1"

Scenario: Go to test-page, enter one address, get one client, enter a second one and get a second client component
When I add a client with address "172.28.0.1:6020/deepstream"
When I add a client with address "172.17.0.1:6020/deepstream"
Then A client component is displayed with id "1"
When I add a client with address "172.28.0.1:6020/deepstream"
When I add a client with address "172.17.0.1:6020/deepstream"
Then A client component is displayed with id "2"
Then The "connection" component is displayed for client component with id "2"
Then The "error-logger" component is displayed for client component with id "2"
Expand Down

0 comments on commit ae5fb87

Please sign in to comment.