Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
persona
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hexang 息壤平台
persona
Commits
2a069f63
Commit
2a069f63
authored
12 years ago
by
Jared Hirsch
Browse files
Options
Downloads
Patches
Plain Diff
first primitive test runner is working
parent
27c74e31
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
automation-tests/run.py
+48
-0
48 additions, 0 deletions
automation-tests/run.py
with
48 additions
and
0 deletions
automation-tests/run.py
0 → 100644
+
48
−
0
View file @
2a069f63
#!/usr/bin/python
import
optparse
import
os
import
platform
import
subprocess
def
main
():
# virtualenv location differs on windows
# TODO platform detection is brittle. is there a better way?
if
platform
.
system
()
==
'
Windows
'
:
env_path
=
'
bid_selenium\Scripts
\\
'
else
:
env_path
=
'
bid_selenium/bin/
'
env_py
=
env_path
+
'
python
'
# parse command line options
# TODO actually parse and use options
p
=
optparse
.
OptionParser
()
# p.add_option('--person', '-p', default='world', help='some helpful text')
# ... add other options
options
,
arguments
=
p
.
parse_args
()
# 1. TODO check that python exists and is the right version.
# 2. TODO check that virtualenv and pip exist. if not, have to install as sudo.
# 3. if the virtualenv isn't found, create it
if
not
os
.
path
.
exists
(
env_py
):
# TODO: will this work?
subprocess
.
call
(
'
virtualenv bid_selenium
'
,
shell
=
True
)
# 4. pip install requirements (or verify they're installed).
# TODO make this an optional '--first-run' arg?
subprocess
.
call
(
env_path
+
'
pip install -Ur requirements.txt
'
,
shell
=
True
)
# 5. run the tests
# TODO the user has to create test credentials. tell them this and pause
# to give them time to do it manually. or we have to have credentials
# in a public repo, which is an awful idea.
# TODO here's where you parse arguments to know which tests to run
subprocess
.
call
(
env_py
+
'
-m py.test --destructive --credentials=credentials.yaml --baseurl=http://dev.123done.org --driver=firefox -q 123done
'
,
shell
=
True
);
subprocess
.
call
(
env_py
+
'
-m py.test --destructive --credentials=credentials.yaml --baseurl=http://dev.123done.org --driver=firefox -q browserid
'
,
shell
=
True
);
subprocess
.
call
(
env_py
+
'
-m py.test --destructive --credentials=credentials.yaml --baseurl=http://dev.myfavoritebeer.org --driver=firefox -q myfavoritebeer
'
,
shell
=
True
);
# 6. TODO deactivate/destroy virtualenv?? maybe '--cleanup' argument or something?
if
__name__
==
'
__main__
'
:
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment