Просмотр исходного кода

Unbreak test scripts to download python virtualenv and set it up properly.

Nikita Lutsenko 9 лет назад
Родитель
Сommit
c25405ec4b

+ 7 - 0
TestSupport/autobahn_fuzzingserver.json

@@ -0,0 +1,7 @@
+{
+   "url": "ws://127.0.0.1:9001",
+   "outdir": "./pages/results",
+   "cases": ["*"],
+   "exclude-cases": [],
+   "exclude-agent-cases": {}
+}

+ 0 - 21
TestSupport/ensure_virtualenv.sh

@@ -1,21 +0,0 @@
-#
-# Copyright 2012 Square Inc.
-# Portions Copyright (c) 2016-present, Facebook, Inc.
-# All rights reserved.
-#
-# This source code is licensed under the license found in the
-# LICENSE-examples file in the root directory of this source tree.
-#
-
-VIRTUALENV_PATH=$1
-
-if [ -d "$VIRTUALENV_PATH" ]; then 
-	echo "Virtual Env already installed"
-else
-	python extern/virtualenv/virtualenv.py $VIRTUALENV_PATH
-	source $VIRTUALENV_PATH/bin/activate
-	pushd TestSupport/sr-testharness/
-  env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography
-	python setup.py develop
-	popd
-fi

+ 0 - 37
TestSupport/run_test.sh

@@ -1,37 +0,0 @@
-#
-# Copyright 2012 Square Inc.
-# Portions Copyright (c) 2016-present, Facebook, Inc.
-# All rights reserved.
-#
-# This source code is licensed under the license found in the
-# LICENSE-examples file in the root directory of this source tree.
-#
-
-TEST_SCENARIOS=$1
-TEST_URL=$2
-CONFIGURATION=$3
-
-
-export SR_TEST_URL=$TEST_URL
-
-bash TestSupport/ensure_virtualenv.sh .env
-
-pushd TestSupport/sr-testharness/
-python setup.py develop
-popd
-
-source .env/bin/activate
-sr-testharness -i '' -c "$TEST_SCENARIOS" &
-
-CHILD_PID=$!
-
-DESTINATION="OS=9.2,name=iPhone 6s"
-SDK="iphonesimulator"
-SHARED_ARGS="-configuration $CONFIGURATION -sdk $SDK"
-
-xcodebuild -scheme SocketRocketTests -destination "$DESTINATION" $SHARED_ARGS TEST_AFTER_BUILD=YES clean build
-RESULT=$?
-
-kill $CHILD_PID
-
-exit $RESULT

+ 18 - 0
TestSupport/run_test_server.sh

@@ -0,0 +1,18 @@
+#
+# Copyright (c) 2016-present, Facebook, Inc.
+# All rights reserved.
+#
+# This source code is licensed under the license found in the
+# LICENSE-examples file in the root directory of this source tree.
+#
+
+PYENV_PATH=$(pwd)/.env
+
+echo $PYENV_PATH
+if [ -d "$PYENV_PATH" ]; then 
+  source $PYENV_PATH/bin/activate
+  $PYENV_PATH/bin/wstest -m fuzzingserver -s TestSupport/autobahn_fuzzingserver.json
+else
+  echo "Python Virtualenv not set up. Please run './TestSupport/setup_env.sh .env' first."
+fi
+

+ 35 - 0
TestSupport/setup_env.sh

@@ -0,0 +1,35 @@
+#
+# Copyright (c) 2016-present, Facebook, Inc.
+# All rights reserved.
+#
+# This source code is licensed under the license found in the
+# LICENSE-examples file in the root directory of this source tree.
+#
+
+VIRTUALENV_PATH=$1
+VIRTUALENV_VERSION=15.0.1
+
+if [ -d "$VIRTUALENV_PATH" ]; then 
+	echo "Virtual Env already installed"
+else
+  mkdir $VIRTUALENV_PATH
+
+  pushd $VIRTUALENV_PATH  
+  
+  curl -L -o virtualenv.tar.gz https://pypi.python.org/packages/source/v/virtualenv/virtualenv-$VIRTUALENV_VERSION.tar.gz
+  tar xvfz virtualenv.tar.gz
+  
+  pushd virtualenv-$VIRTUALENV_VERSION
+  python setup.py develop
+  popd
+  
+  popd
+  
+  python $VIRTUALENV_PATH/virtualenv-$VIRTUALENV_VERSION/virtualenv.py $VIRTUALENV_PATH
+  
+  source $VIRTUALENV_PATH/bin/activate
+  env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography
+  
+  pip install unittest2
+	pip install autobahntestsuite
+fi