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
03b6e3b2
Commit
03b6e3b2
authored
Jun 17, 2016
by
Ben Patterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FEDX-152. Pipe collectstatic results to a file for bok-choy tests.
parent
39c2abdf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
10 deletions
+24
-10
pavelib/assets.py
+9
-3
pavelib/servers.py
+2
-2
pavelib/utils/test/suites/bokchoy_suite.py
+1
-1
pavelib/utils/test/suites/suite.py
+12
-4
No files found.
pavelib/assets.py
View file @
03b6e3b2
...
@@ -641,14 +641,16 @@ def restart_django_servers():
...
@@ -641,14 +641,16 @@ def restart_django_servers():
))
))
def
collect_assets
(
systems
,
settings
):
def
collect_assets
(
systems
,
settings
,
output_file
):
"""
"""
Collect static assets, including Django pipeline processing.
Collect static assets, including Django pipeline processing.
`systems` is a list of systems (e.g. 'lms' or 'studio' or both)
`systems` is a list of systems (e.g. 'lms' or 'studio' or both)
`settings` is the Django settings module to use.
`settings` is the Django settings module to use.
"""
"""
for
sys
in
systems
:
for
sys
in
systems
:
sh
(
django_cmd
(
sys
,
settings
,
"collectstatic --noinput > /dev/null"
))
sh
(
django_cmd
(
sys
,
settings
,
"collectstatic --noinput > {logfile}"
.
format
(
logfile
=
output_file
)))
print
(
"
\t\t
Finished collecting {} assets."
.
format
(
sys
))
print
(
"
\t\t
Finished collecting {} assets."
.
format
(
sys
))
...
@@ -763,6 +765,10 @@ def update_assets(args):
...
@@ -763,6 +765,10 @@ def update_assets(args):
'--themes'
,
type
=
str
,
nargs
=
'+'
,
default
=
None
,
'--themes'
,
type
=
str
,
nargs
=
'+'
,
default
=
None
,
help
=
"list of themes to compile sass for"
,
help
=
"list of themes to compile sass for"
,
)
)
parser
.
add_argument
(
'--collect-log'
,
dest
=
'collect_log_file'
,
default
=
"/dev/null"
,
help
=
"When running collectstatic, direct output to this log file"
,
)
args
=
parser
.
parse_args
(
args
)
args
=
parser
.
parse_args
(
args
)
compile_templated_sass
(
args
.
system
,
args
.
settings
)
compile_templated_sass
(
args
.
system
,
args
.
settings
)
...
@@ -774,7 +780,7 @@ def update_assets(args):
...
@@ -774,7 +780,7 @@ def update_assets(args):
execute_compile_sass
(
args
)
execute_compile_sass
(
args
)
if
args
.
collect
:
if
args
.
collect
:
collect_assets
(
args
.
system
,
args
.
settings
)
collect_assets
(
args
.
system
,
args
.
settings
,
args
.
collect_log_file
)
if
args
.
watch
:
if
args
.
watch
:
call_task
(
call_task
(
...
...
pavelib/servers.py
View file @
03b6e3b2
...
@@ -213,8 +213,8 @@ def run_all_servers(options):
...
@@ -213,8 +213,8 @@ def run_all_servers(options):
# means that the optimized assets are ignored, so we skip collectstatic in that
# means that the optimized assets are ignored, so we skip collectstatic in that
# case to save time.
# case to save time.
if
settings
!=
DEFAULT_SETTINGS
:
if
settings
!=
DEFAULT_SETTINGS
:
collect_assets
([
'lms'
],
asset_settings_lms
)
collect_assets
([
'lms'
],
asset_settings_lms
,
"/dev/null"
)
collect_assets
([
'studio'
],
asset_settings_cms
)
collect_assets
([
'studio'
],
asset_settings_cms
,
"/dev/null"
)
# Install an asset watcher to regenerate files that change
# Install an asset watcher to regenerate files that change
call_task
(
'pavelib.assets.watch_assets'
,
options
=
{
'background'
:
True
})
call_task
(
'pavelib.assets.watch_assets'
,
options
=
{
'background'
:
True
})
...
...
pavelib/utils/test/suites/bokchoy_suite.py
View file @
03b6e3b2
...
@@ -155,7 +155,7 @@ class BokChoyTestSuite(TestSuite):
...
@@ -155,7 +155,7 @@ class BokChoyTestSuite(TestSuite):
sh
(
"{}/scripts/reset-test-db.sh"
.
format
(
Env
.
REPO_ROOT
))
sh
(
"{}/scripts/reset-test-db.sh"
.
format
(
Env
.
REPO_ROOT
))
if
not
self
.
fasttest
:
if
not
self
.
fasttest
:
self
.
generate_optimized_static_assets
()
self
.
generate_optimized_static_assets
(
log_dir
=
self
.
log_dir
)
# Clear any test data already in Mongo or MySQLand invalidate
# Clear any test data already in Mongo or MySQLand invalidate
# the cache
# the cache
...
...
pavelib/utils/test/suites/suite.py
View file @
03b6e3b2
...
@@ -5,7 +5,7 @@ import sys
...
@@ -5,7 +5,7 @@ import sys
import
subprocess
import
subprocess
from
paver
import
tasks
from
paver
import
tasks
from
paver.easy
import
sh
from
paver.easy
import
sh
,
call_task
from
pavelib.utils.process
import
kill_process
from
pavelib.utils.process
import
kill_process
...
@@ -61,13 +61,21 @@ class TestSuite(object):
...
@@ -61,13 +61,21 @@ class TestSuite(object):
"""
"""
return
None
return
None
def
generate_optimized_static_assets
(
self
):
def
generate_optimized_static_assets
(
self
,
log_dir
=
None
):
"""
"""
Collect static assets using test_static_optimized.py which generates
Collect static assets using test_static_optimized.py which generates
optimized files to a dedicated test static root.
optimized files to a dedicated test static root. Optionally use
a log file for collectstatic output.
"""
"""
opts_dict
=
{
'settings'
:
'test_static_optimized'
}
if
log_dir
:
opts_dict
.
update
({
'collect_log_file'
:
log_dir
})
print
colorize
(
'green'
,
"Generating optimized static assets..."
)
print
colorize
(
'green'
,
"Generating optimized static assets..."
)
sh
(
"paver update_assets --settings=test_static_optimized"
)
call_task
(
"pavelib.assets.update_assets"
,
args
=
opts_dict
)
# sh("paver update_assets --settings=test_static_optimized")
def
run_test
(
self
):
def
run_test
(
self
):
"""
"""
...
...
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