Permalink
Browse files

Merge pull request #12593 from aeslaughter/MOOSEDocs-package-test

Moose docs package test
  • Loading branch information...
aeslaughter committed Dec 5, 2018
2 parents b4bbc2d + 18a9f22 commit fac9145542b20bac580488571520b5dcaf24aed0
@@ -35,6 +35,13 @@ def command_line_options(subparser, parent):
default='MooseDocs.base.ParallelBarrier',
help="Select the mode of execution.")
def prepare_content(content):
"""Performs necessary substitutions for consistent comparisions."""
content = insert_moose_dir(content)
content = replace_uuid4(content)
content = replace_package_file(content)
return content
def insert_moose_dir(content):
"""Helper for adding '${MOOSE_DIR}' to content."""
return content.replace(os.getenv('MOOSE_DIR'), '${MOOSE_DIR}')
@@ -44,6 +51,10 @@ def replace_uuid4(content):
return re.sub(r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}',
r'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', content)
def replace_package_file(content):
"""Replace the package filename with something consistent."""
return re.sub(r'(moose-environment\S*\.pkg)', r'moose-environment.pkg', content)
def update_gold_helper(gold, out_content):
"""Update the gold files."""
dirname = os.path.dirname(gold)
@@ -61,7 +72,7 @@ def compare(out_fname, out_dir, gold_dir, update_gold=False):
# Read the content to be tested
with open(out_fname, 'r') as fid:
out_content = insert_moose_dir(replace_uuid4(fid.read()))
out_content = prepare_content(fid.read())
# Update gold content
if update_gold:
@@ -1,2 +1,2 @@
<!DOCTYPE html><head><link href="../contrib/katex/katex.min.css" rel="stylesheet" type="text/css"></link><script src="../contrib/katex/katex.min.js" type="text/javascript"></script><script src="../contrib/plotly/plotly.min.js" type="text/javascript"></script></head><body><h1 id="package-extension">Package Extension</h1><a href="http://www.mooseframework.org/moose_packages/moose-environment_osx-highsierra_20181012_x86_64.pkg">moose-environment_osx-highsierra_20181012_x86_64.pkg</a><pre style="max-height:350px;"><code class="language-bash">/path/to/gcc-7.3.1
<!DOCTYPE html><head><link href="../contrib/katex/katex.min.css" rel="stylesheet" type="text/css"></link><script src="../contrib/katex/katex.min.js" type="text/javascript"></script><script src="../contrib/plotly/plotly.min.js" type="text/javascript"></script></head><body><h1 id="package-extension">Package Extension</h1><a href="http://www.mooseframework.org/moose_packages/moose-environment.pkg</a><pre style="max-height:350px;"><code class="language-bash">/path/to/gcc-7.3.1
</code></pre><p>This is a sentence with gcc-7.3.1 . </p></body>
@@ -51,12 +51,12 @@
"attributes": {
"recursive": true,
"tooltip": true,
"url": "http://www.mooseframework.org/moose_packages/moose-environment_osx-highsierra_20181012_x86_64.pkg"
"url": "http://www.mooseframework.org/moose_packages/moose-environment.pkg"
},
"children": [
{
"attributes": {
"content": "moose-environment_osx-highsierra_20181012_x86_64.pkg",
"content": "moose-environment.pkg",
"recursive": true
},
"children": [],
@@ -1,5 +1,5 @@
\chapter{\label{package-extension}Package Extension}\href{http://www.mooseframework.org/moose\_packages/moose-environment\_osx-highsierra\_20181012\_x86\_64.pkg}{moose-environment\_osx-highsierra\_20181012\_x86\_64.pkg}
\chapter{\label{package-extension}Package Extension}\href{http://www.mooseframework.org/moose\_packages/moose-environment.pkg}
\begin{verbatim}/path/to/gcc-7.3.1
\end{verbatim}
\par This is a sentence with gcc-7.3.1 .
@@ -1,2 +1,2 @@
<!DOCTYPE html><head><link media="screen,projection" href="../contrib/materialize/materialize.min.css" rel="stylesheet" type="text/css"></link><link href="../contrib/prism/prism.min.css" rel="stylesheet" type="text/css"></link><link href="../css/moose.css" rel="stylesheet" type="text/css"></link><link href="../contrib/katex/katex.min.css" rel="stylesheet" type="text/css"></link><script src="../js/google_analytics.js" type="text/javascript"></script><script src="../contrib/jquery/jquery.min.js" type="text/javascript"></script><script src="../contrib/materialize/materialize.min.js" type="text/javascript"></script><script src="../contrib/clipboard/clipboard.min.js" type="text/javascript"></script><script src="../contrib/prism/prism.min.js" type="text/javascript"></script><script src="../js/init.js" type="text/javascript"></script><script src="../contrib/katex/katex.min.js" type="text/javascript"></script><script src="../contrib/plotly/plotly.min.js" type="text/javascript"></script><script src="../js/navigation.js" type="text/javascript"></script><script src="../contrib/fuse/fuse.min.js" type="text/javascript"></script><script src="../js/search_index.js" type="text/javascript"></script><title>Package Extension|MOOSEDocs</title></head><body><div class="page-wrap"><header><nav><div class="nav-wrapper container"><a href="https://www.mooseframework.org" class="left moose-logo hide-on-med-and-down">MOOSEDocs</a><a href="https://github.com/idaholab/moose" class="right"><img src="../media/framework/github-logo.png" class="github-mark"></img><img src="../media/framework/github-mark.png" class="github-logo"></img></a><ul class="right hide-on-med-and-down"><li><a href="core.html">Direct</a></li><li class="moose-mega-menu-trigger" data-target="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"><a>Mega<i class="material-icons right">arrow_drop_down</i></a></li><li><a data-target="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" href="#!" data-constrainWidth="false" class="dropdown-trigger">Dict<i class="material-icons right">arrow_drop_down</i></a></li></ul><a data-target="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" href="#" class="sidenav-trigger"><i class="material-icons">menu</i></a><ul id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" class="sidenav"><li><a href="core.html">Direct</a></li><li><a href="../mega.menu.html">Mega</a></li><li><a data-target="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" href="#!" data-constrainWidth="false" class="dropdown-trigger">Dict<i class="material-icons right">arrow_drop_down</i></a></li></ul><a href="#moose-search" class="modal-trigger"><i class="material-icons">search</i></a></div><ul class="dropdown-content" id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"><li><a href="core.html">Core</a></li><li><a href="autolink.html">AutoLink</a></li></ul><ul class="dropdown-content" id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"><li><a href="core.html">Core</a></li><li><a href="autolink.html">AutoLink</a></li></ul></nav><div id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" class="moose-mega-menu-content"><div class="moose-mega-menu-wrapper"><h2 id="main-extensions">Main Extensions</h2><ul class="browser-default"><li><p><a class="tooltipped" href="core.html" data-tooltip="core.html" data-position="top">Core</a> </p></li><li><p><a class="tooltipped" href="autolink.html" data-tooltip="autolink.html" data-position="top">AutoLink</a></p></li></ul></div></div><div class="modal modal-fixed-footer moose-search-modal" id="moose-search"><div class="modal-content container moose-search-modal-content"><div class="row"><div class="col l12"><div class="input-field"><input id="moose-search-box" type_="text" onkeyup="mooseSearch()" placeholder="https://www.mooseframework.org"></input></div></div><div><div class="col s12" id="moose-search-results"></div></div></div></div><div class="modal-footer"><a href="#!" class="modal-action modal-close btn-flat">Close</a></div></div></header><main class="main"><div class="container"><div class="row"><div class="col hide-on-med-and-down l12"><nav class="breadcrumb-nav"><div class="nav-wrapper"><span class="breadcrumb">extensions</span><a href="#" class="breadcrumb">package</a></div></nav></div></div><div class="row"><div class="moose-content col s12 m12 l10"><section data-section-level="1" id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" data-section-text="Package Extension"><h1 id="package-extension">Package Extension</h1><a class="tooltipped" href="http://www.mooseframework.org/moose_packages/moose-environment_osx-highsierra_20181012_x86_64.pkg" data-tooltip="http://www.mooseframework.org/moose_packages/moose-environment_osx-highsierra_20181012_x86_64.pkg" data-position="top">moose-environment_osx-highsierra_20181012_x86_64.pkg</a><pre style="max-height:350px;"><code class="language-bash">/path/to/gcc-7.3.1
<!DOCTYPE html><head><link media="screen,projection" href="../contrib/materialize/materialize.min.css" rel="stylesheet" type="text/css"></link><link href="../contrib/prism/prism.min.css" rel="stylesheet" type="text/css"></link><link href="../css/moose.css" rel="stylesheet" type="text/css"></link><link href="../contrib/katex/katex.min.css" rel="stylesheet" type="text/css"></link><script src="../js/google_analytics.js" type="text/javascript"></script><script src="../contrib/jquery/jquery.min.js" type="text/javascript"></script><script src="../contrib/materialize/materialize.min.js" type="text/javascript"></script><script src="../contrib/clipboard/clipboard.min.js" type="text/javascript"></script><script src="../contrib/prism/prism.min.js" type="text/javascript"></script><script src="../js/init.js" type="text/javascript"></script><script src="../contrib/katex/katex.min.js" type="text/javascript"></script><script src="../contrib/plotly/plotly.min.js" type="text/javascript"></script><script src="../js/navigation.js" type="text/javascript"></script><script src="../contrib/fuse/fuse.min.js" type="text/javascript"></script><script src="../js/search_index.js" type="text/javascript"></script><title>Package Extension|MOOSEDocs</title></head><body><div class="page-wrap"><header><nav><div class="nav-wrapper container"><a href="https://www.mooseframework.org" class="left moose-logo hide-on-med-and-down">MOOSEDocs</a><a href="https://github.com/idaholab/moose" class="right"><img src="../media/framework/github-logo.png" class="github-mark"></img><img src="../media/framework/github-mark.png" class="github-logo"></img></a><ul class="right hide-on-med-and-down"><li><a href="core.html">Direct</a></li><li class="moose-mega-menu-trigger" data-target="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"><a>Mega<i class="material-icons right">arrow_drop_down</i></a></li><li><a data-target="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" href="#!" data-constrainWidth="false" class="dropdown-trigger">Dict<i class="material-icons right">arrow_drop_down</i></a></li></ul><a data-target="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" href="#" class="sidenav-trigger"><i class="material-icons">menu</i></a><ul id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" class="sidenav"><li><a href="core.html">Direct</a></li><li><a href="../mega.menu.html">Mega</a></li><li><a data-target="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" href="#!" data-constrainWidth="false" class="dropdown-trigger">Dict<i class="material-icons right">arrow_drop_down</i></a></li></ul><a href="#moose-search" class="modal-trigger"><i class="material-icons">search</i></a></div><ul class="dropdown-content" id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"><li><a href="core.html">Core</a></li><li><a href="autolink.html">AutoLink</a></li></ul><ul class="dropdown-content" id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"><li><a href="core.html">Core</a></li><li><a href="autolink.html">AutoLink</a></li></ul></nav><div id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" class="moose-mega-menu-content"><div class="moose-mega-menu-wrapper"><h2 id="main-extensions">Main Extensions</h2><ul class="browser-default"><li><p><a class="tooltipped" href="core.html" data-tooltip="core.html" data-position="top">Core</a> </p></li><li><p><a class="tooltipped" href="autolink.html" data-tooltip="autolink.html" data-position="top">AutoLink</a></p></li></ul></div></div><div class="modal modal-fixed-footer moose-search-modal" id="moose-search"><div class="modal-content container moose-search-modal-content"><div class="row"><div class="col l12"><div class="input-field"><input id="moose-search-box" type_="text" onkeyup="mooseSearch()" placeholder="https://www.mooseframework.org"></input></div></div><div><div class="col s12" id="moose-search-results"></div></div></div></div><div class="modal-footer"><a href="#!" class="modal-action modal-close btn-flat">Close</a></div></div></header><main class="main"><div class="container"><div class="row"><div class="col hide-on-med-and-down l12"><nav class="breadcrumb-nav"><div class="nav-wrapper"><span class="breadcrumb">extensions</span><a href="#" class="breadcrumb">package</a></div></nav></div></div><div class="row"><div class="moose-content col s12 m12 l10"><section data-section-level="1" id="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" data-section-text="Package Extension"><h1 id="package-extension">Package Extension</h1><a class="tooltipped" href="http://www.mooseframework.org/moose_packages/moose-environment.pkg" data-tooltip="http://www.mooseframework.org/moose_packages/moose-environment.pkg" data-position="top">moose-environment.pkg</a><pre style="max-height:350px;"><code class="language-bash">/path/to/gcc-7.3.1
</code></pre><p>This is a sentence with gcc-7.3.1 . </p></section></div><div class="col hide-on-med-and-down l2"><div class="toc-wrapper pin-top"><ul class="section table-of-contents"></ul></div></div></div></div></main></div></body>

0 comments on commit fac9145

Please sign in to comment.