Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
9cba2232
Commit
9cba2232
authored
Aug 07, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run all tests all the way through before quitting on errors
parent
258b9eb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
7 deletions
+25
-7
rakefile
+25
-7
No files found.
rakefile
View file @
9cba2232
...
...
@@ -83,13 +83,20 @@ end
task
:pylint
=>
"pylint_
#{
system
}
"
end
$failed_tests
=
0
def
run_tests
(
system
,
report_dir
)
def
run_tests
(
system
,
report_dir
,
stop_on_failure
=
true
)
ENV
[
'NOSE_XUNIT_FILE'
]
=
File
.
join
(
report_dir
,
"nosetests.xml"
)
ENV
[
'NOSE_COVER_HTML_DIR'
]
=
File
.
join
(
report_dir
,
"cover"
)
sh
(
django_admin
(
system
,
:test
,
'test'
,
*
Dir
[
"
#{
system
}
/djangoapps/*"
].
each
))
sh
(
django_admin
(
system
,
:test
,
'test'
,
*
Dir
[
"
#{
system
}
/djangoapps/*"
].
each
))
do
|
ok
,
res
|
if
!
ok
and
stop_on_failure
abort
"Test failed!"
end
$failed_tests
+=
1
unless
ok
end
end
TEST_TASKS
=
[]
[
:lms
,
:cms
].
each
do
|
system
|
report_dir
=
File
.
join
(
REPORT_DIR
,
system
.
to_s
)
...
...
@@ -97,15 +104,16 @@ end
# Per System tasks
desc
"Run all django tests on our djangoapps for the
#{
system
}
"
task
"test_
#{
system
}
"
=>
[
"clean_test_files"
,
"
#{
system
}
:collectstatic:test"
,
"fasttest_
#{
system
}
"
]
task
"test_
#{
system
}
"
,
[
:stop_on_failure
]
=>
[
"clean_test_files"
,
"
#{
system
}
:collectstatic:test"
,
"fasttest_
#{
system
}
"
]
# Have a way to run the tests without running collectstatic -- useful when debugging without
# messing with static files.
task
"fasttest_
#{
system
}
"
=>
[
report_dir
,
:predjango
]
do
run_tests
(
system
,
report_dir
)
task
"fasttest_
#{
system
}
"
,
[
:stop_on_failure
]
=>
[
report_dir
,
:predjango
]
do
|
t
,
args
|
args
.
with_defaults
(
:stop_on_failure
=>
'true'
)
run_tests
(
system
,
report_dir
,
args
.
stop_on_failure
)
end
task
:test
=>
"test_
#{
system
}
"
TEST_TASKS
<<
"test_
#{
system
}
"
desc
<<-
desc
Start the
#{
system
}
locally with the specified environment (defaults to dev).
...
...
@@ -142,7 +150,17 @@ Dir["common/lib/*"].each do |lib|
ENV
[
'NOSE_XUNIT_FILE'
]
=
File
.
join
(
report_dir
,
"nosetests.xml"
)
sh
(
"nosetests
#{
lib
}
--cover-erase --with-xunit --with-xcoverage --cover-html --cover-inclusive --cover-package
#{
File
.
basename
(
lib
)
}
--cover-html-dir
#{
File
.
join
(
report_dir
,
"cover"
)
}
"
)
end
task
:test
=>
task_name
TEST_TASKS
<<
task_name
end
task
:test
do
TEST_TASKS
.
each
do
|
task
|
Rake
::
Task
[
task
].
invoke
(
false
)
end
if
$failed_tests
>
0
abort
"Tests failed!"
end
end
task
:runserver
=>
:lms
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment