Use a template to generate the 'whereto' testing data
As we add more branches and tags we don't want to manually add tests for them (and we'd need to or the docs build will fail with an 'Untested Rule'. Use the redirections data that we use to generate the htaccess file to also generate the tests. Also I removed the debug output as it it's assertion is incorrect we can actually get the .htaccess file from the docs job \o/ Change-Id: Ib5d35169e68cd92b666a35705d8e36942bd28b89
This commit is contained in:
@@ -472,17 +472,25 @@ def build_finished(app, exception):
|
||||
if exception is not None:
|
||||
return
|
||||
|
||||
redirections = generate_constraints_redirections(_deliverables)
|
||||
rendered_output = app.builder.templates.render(
|
||||
'htaccess',
|
||||
dict(redirections=generate_constraints_redirections(_deliverables))
|
||||
dict(redirections=redirections)
|
||||
)
|
||||
output_full_name = os.path.join(app.builder.outdir, '.htaccess')
|
||||
with open(output_full_name, "w") as f:
|
||||
f.write(rendered_output)
|
||||
LOG.info('Wrote Redirections to %s' % (output_full_name))
|
||||
# NOTE(tonyb): We want to output this here because we won't be able to
|
||||
# get to it via http{,s} so this helps debugging.
|
||||
LOG.debug(rendered_output)
|
||||
|
||||
rendered_output = app.builder.templates.render(
|
||||
'redirect-tests',
|
||||
dict(redirections=redirections)
|
||||
)
|
||||
output_full_name = os.path.join(app.builder.outdir,
|
||||
'..',
|
||||
'redirect-tests.txt')
|
||||
with open(output_full_name, "w") as f:
|
||||
f.write(rendered_output)
|
||||
|
||||
|
||||
def setup(app):
|
||||
|
||||
Reference in New Issue
Block a user