Parcourir la source

HUE-8737 [core] Remove windwill tests

Test never ran for 8+ years and for Hue 1 only.
Last pypy release in 2011 and not Python 3 compatible.

Windmill is no lnonger actively maintained, it has been eclipsed by Webdriver/Selenium 2.
- I suggest, http://webdriver.io

Windmill is an Open Source AJAX Web UI Testing framework.

Windmill implements cross browser testing, in-browser recording and playback, and functionality for fast accurate debugging and test environment integration.
Romain il y a 5 ans
Parent
commit
312b6adcc9

+ 0 - 25
apps/about/src/about/windmilltests.py

@@ -1,25 +0,0 @@
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from desktop.lib.windmill_util import logged_in_client
-
-def test_launch_about_app():
-  """
-    launches the about app
-  """
-  client = logged_in_client()
-  client.click(jquery='("img.hue-swoosh")[0]')
-  client.waits.forElement(classname='Hue-ABOUT', timeout='2000')

+ 0 - 24
apps/jobbrowser/src/jobbrowser/windmilltests.py

@@ -1,24 +0,0 @@
-# Generated by the windmill services transformer
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-from desktop.lib.windmill_util import logged_in_client
-
-def test_launch():
-  """ Simply opens and closes JobBrowser. """
-  client = logged_in_client()
-  client.click(id='hue-jobbrowser-menu')
-  client.waits.forElement(jquery='(".close")[0]', timeout='300')
-  client.click(jquery='(".close")[0]')

+ 0 - 55
apps/useradmin/src/useradmin/windmilltests.py

@@ -1,55 +0,0 @@
-#!/usr/bin/env python
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from desktop.lib.windmill_util import logged_in_client, logout
-
-def test_user_creation():
-  client = logged_in_client()
-
-  # launch useradmin
-  client.click(id='hue-useradmin-menu')
-  client.waits.forElement(jquery='(".useradmin")[0]', timeout='2000')
-
-  # click add user and add "windmill_joe" user
-  client.click(jquery="('.useradmin_add_user')[0]")
-  client.type(text='windmill_joe', id='id_username')
-  client.type(text='windmill', id='id_password1')
-  client.type(text='windmill', id='id_password2')
-  client.click(value='Save')
-  # verify user is in list
-  client.waits.forElement(classname='useradmin_userlist', timeout='2000')
-  client.asserts.assertTextIn(classname='useradmin_userlist', validator='windmill_joe')
-
-  # log in as windmill_joe
-  logout(client)
-
-  client = logged_in_client(user='windmill_joe', passwd='windmill')
-  logout(client)
-
-  client = logged_in_client()
-
-  # launch useradmin
-  client.click(id='hue-useradmin-menu')
-  client.waits.forElement(jquery='(".useradmin")[0]', timeout='2000')
-
-  # delete the user
-  client.click(jquery="('tr:contains(windmill_joe) .delete:last')[0]")
-  client.click(jquery="('.useradmin .closeWin')[1]")
-
-  # verify user is NOT in list
-  client.waits.forElement(classname='useradmin_userlist', timeout='2000')
-  client.asserts.assertNotTextIn(classname='useradmin_userlist', validator='windmill_joe')

+ 0 - 25
apps/zookeeper/src/zookeeper/windmilltests.py

@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from desktop.lib.windmill_util import logged_in_client
-
-
-def test_zookeeper():
-  """ launches the default view for zookeeper """
-  client = logged_in_client()
-  client.click(id='ccs-zookeeper-menu')
-  client.waits.forElement(classname='CCS-zookeeper', timeout='2000')

+ 0 - 54
desktop/core/src/desktop/lib/windmill_util.py

@@ -1,54 +0,0 @@
-#!/usr/bin/env python
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from windmill.authoring import WindmillTestClient
-import windmill
-import time
-
-def logged_in_client(user='test', passwd='test', client=None):
-  """
-  Opens up the root URL.  If user is not logged in, logs him in.
-  """
-  if client is None:
-    client = WindmillTestClient(__name__)
-  client.open(url=windmill.settings['TEST_URL'] + '?clearSession=true')
-  client.waits.forPageLoad()
-  client.waits.forElement(classname='hue-loaded')
-  if client.execJS(js="!!$('hue-login')")["output"]:
-    client.waits.forElement(classname='hue-username')
-    client.click(jquery='(".hue-username")[0]')
-    client.type(classname='hue-username', text=user)
-    client.click(classname='hue-password')
-    client.type(classname='hue-password', text=passwd)
-    client.click(classname='hue-continue')
-  # Health dashboard launches at login; ideally we'd have a 
-  # better "ready" notification.
-  time.sleep(2.0) # TODO: Hacky sleep!
-  client.waits.forElement(classname='loggedIn', timeout='20000')
-  return client
-
-def logout(client):
-  """
-    logs the user out of desktop
-  """
-  client.click(jquery='("#hue-logout a")[0]')
-  # TODO(philip,nutron): Occasional bug.
-  # We've seen the login box never show up.  This doesn't
-  # trigger test failures, because we open the first page
-  # at every test, but ideally we should assert that the login
-  # box appears again.
-  # client.waits.forElement(timeout='2000', classname='hue-username')

+ 0 - 140
desktop/core/src/desktop/management/commands/run_windmill.py

@@ -1,140 +0,0 @@
-#!/usr/bin/env python
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-"""
-Django management command that invokes windmill tests,
-after appropriate setup.
-"""
-from builtins import object
-import sys
-import time
-from optparse import make_option
-
-from windmill.authoring import djangotest
-
-from django.core.management.base import BaseCommand
-
-import logging
-
-LOG = logging.getLogger(__name__)
-
-DEFAULT_PORT=8999
-
-class ServerContainer(object):
-  """
-  This monkey-patch of djangotest's ServerContainer allows a custom port number.
-  """
-  port = DEFAULT_PORT
-
-  def start_test_server(self):
-    djangotest.start_test_server(self, "127.0.0.1", self.port)
-
-  stop_test_server = djangotest.stop_test_server
-
-class Command(BaseCommand):
-  """Runs windmill tests."""
-
-  def add_arguments(self, parser):
-    parser.add_argument('-p', '--port', type=int, default=DEFAULT_PORT, dest='port',
-        help='Port number to use for server.')
-
-  def setup_test_db(self):
-    """
-    Windmill only sets up the db if it's in-memory, but it ought to do it always.
-    We have to adapt a bit for South as well.
-    """
-    # South:
-    import south.management.commands
-    south.management.commands.patch_for_test_db_setup()
-
-    # Create the test database
-    from django.db import connection
-    connection.creation.create_test_db(0)
-
-  def start_helper_servers(self):
-    """
-    Starts Hadoop daemons.
-
-    This currently doesn't start app-specific
-    other servers.
-    """
-    pass
-
-  def stop_helper_servers(self):
-    self.cluster.shutdown()
-
-  def handle(self, *args, **options):
-    """
-    This is a rewrite of windmill.management.commands.test_windmill
-    that uses nose instead of functest.
-    """
-    from windmill.bin import admin_lib
-    from windmill.conf import global_settings
-    import nose
-
-    self.port = options['port']
-
-    # Setup DB
-    self.setup_test_db()
-
-    # Start a servers (django web server & Hadoop)
-    server_container = ServerContainer()
-    server_container.start_test_server()
-    LOG.info("Server running on %d" % server_container.server_thread.port)
-    self.start_helper_servers()
-
-
-    # Configure windmill
-    global_settings.TEST_URL = 'http://127.0.0.1:%d' % server_container.server_thread.port
-    # For now, we only handle Firefox.
-    global_settings.START_FIREFOX = True
-    admin_lib.configure_global_settings(logging_on=False)
-
-    # Start windmill proxy server
-    windmill_obj = admin_lib.setup()
-
-    # Run tests with nose
-    nose_args = self.find_modules()
-    LOG.info("Testing modules: " + repr(nose_args))
-    if "--" in sys.argv:
-      nose_args.extend(sys.argv[sys.argv.index("--") + 1:])
-    res = nose.run(argv=nose_args)
-
-    # Stop servers
-    self.stop_helper_servers()
-    server_container.stop_test_server()
-
-    # Stop windmill
-    admin_lib.teardown(windmill_obj)
-    time.sleep(0.25)
-
-    if res:
-      sys.exit(0)
-    else:
-      sys.exit(1)
-
-  def find_modules(self):
-    """Find modules ending in windmilltests within installed apps."""
-    import django.conf
-    names = []
-    for app in django.conf.settings.INSTALLED_APPS:
-      name = app + "." + "windmilltests"
-      try:
-        __import__(name)
-        names.append(name)
-      except ImportError:
-        pass
-    return names

+ 0 - 6
desktop/core/src/desktop/management/commands/test.py

@@ -107,8 +107,6 @@ class Command(BaseCommand):
                        test specific useradmin.tests:test_user_admin
                     All additional arguments are passed directly to nose.
 
-      windmill      Runs windmill tests
-
       list_modules  List test modules for all desktop applications and libraries
 
     Common useful extra arguments for nose:
@@ -148,10 +146,6 @@ class Command(BaseCommand):
       nose_args = args + all_apps + ["-a", "!requires_hadoop"]
     elif args[0] == "unit":
       nose_args = args + all_apps + ["-a", "!integration"]
-    elif args[0] == "windmill":
-      from desktop.management.commands import test_windmill
-      args = args[1:]
-      ret = test_windmill.Command().handle(*args)
     elif args[0] in ("specific", "nose"):
       nose_args = args
     elif args[0] == "list_modules":

+ 0 - 24
desktop/core/src/desktop/windmilltests.py

@@ -1,24 +0,0 @@
-# Generated by the windmill services transformer
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-from desktop.lib.windmill_util import logged_in_client, logout
-import time
-
-def test_login_and_logout():
-    client = logged_in_client()
-    # TODO: there's some race condition here :(
-    time.sleep(2.5)
-    logout(client)

+ 1 - 2
desktop/devtools.mk

@@ -24,8 +24,7 @@ DEVTOOLS += \
 	nose[1.3.7] \
 	coverage[4.4.2] \
 	nosetty[0.4] \
-	werkzeug[0.14.1] \
-	windmill[1.6]
+	werkzeug[0.14.1]
 
 PYPI_MIRROR ?= https://pypi.python.org/simple/
 

+ 0 - 2
docs/gethue/content/en/posts/2015-02-08-hue-api-execute-some-builtin-commands.md

@@ -211,8 +211,6 @@ sync_documents
 
 test
 
-test_windmill
-
 version
 
 [django]

+ 2 - 3
docs/gethue/content/jp/posts/2015-02-26-hue-api-execute-some-builtin-commands-2.md

@@ -63,7 +63,7 @@ CMを使用していない場合、通常はHueのホームのルートを追加
 <pre><code class="bash">/usr/lib/hue</pre>
 
 注意:
-  
+
 あなたは、コマンドのログのためにローカルディレクトリへのアクセス権が必要になることがあります。例:
 
 <pre><code class="bash">cd /tmp</pre>
@@ -98,7 +98,6 @@ CMを使用していない場合、通常はHueのホームのルートを追加
  runpylint
  sync_documents
  test
- test_windmill
  version
 
 [django]
@@ -266,4 +265,4 @@ Hiveの場合、sample\_07とsample\_08テーブルとSQLのクエリをイン
  [6]: https://gethue.com/tutorial-how-to-run-the-hue-integration-tests/
  [7]: https://gethue.com/how-to-manage-the-hue-database-with-the-shell/
  [8]: http://groups.google.com/a/cloudera.org/group/hue-user
- [9]: https://twitter.com/gethue
+ [9]: https://twitter.com/gethue

+ 0 - 1
ext/thirdparty/README.md

@@ -98,7 +98,6 @@ Downloaded third party dependencies during build
 |Y|nosetty|0.4|LGPL|http://code.google.com/p/nosetty/|
 |N|pylint|0.19.0|GPL|http://www.logilab.org/project/pylint|
 |Y|Werkzeug|0.6|BSD|http://werkzeug.pocoo.org/|
-|Y|windmill|1.3|Apache2|http://www.getwindmill.com/|
 
 
 ---

+ 0 - 2
tools/jenkins/jenkins.sh

@@ -55,8 +55,6 @@ done;
 
 if [ "$1" == "slow" ]; then
   make test-slow
-elif [ "$1" == "windmill" ]; then
-  xvfb-run -a -s '-screen 0 1024x768x16' tools/hudson/hudson_windmill_in_X.sh
 else
   make test docs
 fi

+ 0 - 27
tools/jenkins/jenkins_windmill_in_X.sh

@@ -1,27 +0,0 @@
-#!/bin/bash
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-set -x
-# Fluxbox does not need to be killed; it'll fall away when the X server dies.
-fluxbox 2&>1 > /dev/null &
-recordmydesktop --on-the-fly-encoding -v_quality 15 --no-sound -o recording.ogv &
-RECORDER_PID=$!
-rm -f desktop/desktop-test.db
-build/env/bin/hue test windmill --with-xunit -v --nologcapture
-EXIT=$?
-kill $RECORDER_PID || true
-sleep 20 # Wait for recording to finish
-exit $EXIT