Skip to content

Commit ad6b2fc

Browse files
committed
Filling out STR
1 parent e3f8e60 commit ad6b2fc

File tree

5 files changed

+250
-103
lines changed

5 files changed

+250
-103
lines changed

.github/workflows/docs.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ jobs:
3333
- name: Make HTML Docs
3434
run: |
3535
pip install -e .[memprof,mpi,test,docs]
36-
pytest --junit-xml=test_results.xml -n 4 armi
36+
python -c "from armi.bookkeeping.report.reportingUtils import getSystemInfo;print(getSystemInfo()) > system_info.log
37+
date > python_details.log
38+
python --version >> python_details.log
39+
pip freeze >> python_details.log
40+
pytest --junit-xml=test_results.xml -v -n 4 armi > pytest_verbose.log
3741
cd doc
3842
git submodule init
3943
git submodule update

doc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33

44
# You can set these variables from the command line.
5-
SPHINXOPTS = -v
5+
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
SOURCEDIR = .
88
BUILDDIR = _build

doc/conf.py

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
from docutils.parsers.rst import Directive, directives
4141
from sphinx.domains.python import PythonDomain
4242

43-
# from sphinx_needs.api import add_dynamic_function # TODO: JOHN
44-
4543
# handle python import locations for this execution
4644
PYTHONPATH = os.path.abspath("..")
4745
sys.path.insert(0, PYTHONPATH)
@@ -67,66 +65,6 @@
6765
_TUTORIAL_FILES = [
6866
fName for fName in bookkeepingTests.TUTORIAL_FILES if "ipynb" not in fName
6967
]
70-
TEST_RESULTS = []
71-
72-
73-
def getTestResult(app, need, needs):
74-
"""Dynamic function used by sphinx-needs to gather the result of a test tag."""
75-
if not need["signature"]:
76-
return "none"
77-
78-
# Get all the tests that match the method signature
79-
results = [
80-
test_case["result"]
81-
for test_case in TEST_RESULTS
82-
if need["signature"] == test_case["method"]
83-
]
84-
# Logic is as follows if there are multiple matches:
85-
# - If one is a "failure", then return "failure"
86-
# - If all are "skipped", then return "skipped"
87-
# - Otherwise, return "passed"
88-
if results:
89-
if "failure" in results:
90-
return "failure"
91-
elif "passed" in results:
92-
return "passed"
93-
else:
94-
return "skipped"
95-
96-
# Things get a little more complicated when the test tag has a class-level signature.
97-
# Basically we have to determine if all the methods in the class passed or if any of skipped/failed.
98-
# First, gather all the results related to the class signature from the tag and categorize by method
99-
results = {}
100-
for test_case in TEST_RESULTS:
101-
if need["signature"] == test_case["class"]:
102-
if test_case["method"] in results:
103-
results[test_case["method"]].append(test_case["result"])
104-
else:
105-
results[test_case["method"]] = [test_case["result"]]
106-
107-
# If we haven't found the test by now, we never will
108-
if not results:
109-
return "none"
110-
111-
# Apply logic from before for each method in the class
112-
for m, r in results.items():
113-
if "failure" in r:
114-
results[m] = "failure"
115-
elif "passed" in r:
116-
results[m] = "passed"
117-
else:
118-
results[m] = "skipped"
119-
120-
# Now for the class logic
121-
# - If any of the methods failed, return "failure"
122-
# - If any of the methods skipped, return "skipped"
123-
# - If all of the methods passed, return "passed"
124-
if "failure" in results.values():
125-
return "failure"
126-
elif "skipped" in results.values():
127-
return "skipped"
128-
else:
129-
return "passed"
13068

13169

13270
class PatchedPythonDomain(PythonDomain):
@@ -287,31 +225,12 @@ def autodoc_skip_member_handler(app, what, name, obj, skip, options):
287225
return name.startswith("_") or name in excludes
288226

289227

290-
def getTestAcceptanceCriteria(app, need, needs):
291-
# Return title if there is not just one requirement or the linked requirement doesn't exist
292-
if len(need.get("tests", [])) != 1 or need["tests"][0] not in needs:
293-
ac = need["title"].strip()
294-
295-
req = needs[need["tests"][0]]
296-
# Return title if there is not just one test in the requirement
297-
if len(req.get("tests_back", [])) != 1:
298-
ac = need["title"].strip()
299-
else:
300-
ac = req["acceptance_criteria"].strip()
301-
302-
# For some reason sphinx is adding another period at the end of this, so we'll just remove it
303-
return ac[:-1] if ac[-1] == "." else ac
304-
305-
306228
def setup(app):
307229
"""Method to make `make html` generate api documentation."""
308230
app.connect("autodoc-skip-member", autodoc_skip_member_handler)
309231
app.add_domain(PatchedPythonDomain, override=True)
310232
app.add_directive("exec", ExecDirective)
311233
app.add_directive("pyreverse", PyReverse)
312-
# add_dynamic_function(app, getTestAcceptanceCriteria, "get_test_acceptance_criteria") # TODO: JOHN
313-
# add_dynamic_function(app, getTestResult, "get_test_result")
314-
# add_dynamic_function(app, getTestAcceptanceCriteria, "get_test_acceptance_criteria")
315234

316235
# making tutorial data dir
317236
dataDir = pathlib.Path("user") / ".." / "anl-afci-177"
@@ -645,20 +564,6 @@ def setup(app):
645564
},
646565
}
647566

648-
# TODO: JOHN
649-
"""
650-
needs_global_options = {
651-
# Defaults for test tags
652-
"acceptance_criteria": (
653-
":ndf:`get_test_acceptance_criteria()`.",
654-
"type=='test'",
655-
),
656-
"template": ("test", "type=='test'"),
657-
"layout": ("test_layout", "type=='test'"),
658-
"result": ("[[get_test_result()]]", "type=='test'"),
659-
}
660-
"""
661-
662567

663568
# Formats need roles (reference to a req in text) as just the req ID
664569
needs_role_need_template = "{id}"

doc/qa_docs/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
QA Documentation
33
################
44

5-
This is the documentation for the Advanced Reactor Modeling Interface (ARMI) framework. This
6-
document includes the Software Requirements Specification Document (SRSD), the Software Design and
7-
Implementation Document (SDID), and the Software Test Report (STR).
5+
This is the Quality Assurance (QA) documentation for the Advanced Reactor Modeling Interface (ARMI)
6+
framework. This document includes the Software Requirements Specification Document (SRSD), the
7+
Software Design and Implementation Document (SDID), and the Software Test Report (STR).
88

99
-------------
1010

@@ -14,4 +14,4 @@ Implementation Document (SDID), and the Software Test Report (STR).
1414

1515
srsd
1616
sdid
17-
str
17+
str

0 commit comments

Comments
 (0)