Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Generate stable test output #31

Merged
merged 5 commits into from
Jun 28, 2014

Conversation

florentx
Copy link
Contributor

Currently the output of the tests is not stable when running in different environments:

  • some absolute file paths are printed, which depend on the path of the build directory
  • Last updated timestamp is printed in the output of many tests

This PR removes the above glitches. It is a prerequisite for fixing issue #30

Details of the changes:

@florentx
Copy link
Contributor Author

Additional fixes to avoid depending on version numbers for the expected output:

-<div class="content"><!-- Generator: GNU source-highlight 3.1.7
+<div class="content"><!-- Generator: GNU source-highlight
-<meta name="generator" content="AsciiDoc 8.6.9">
+<meta name="generator" content="AsciiDoc test-0.1.1">

_frozentime = 0X3DE170D6
_frozentz = 'Pacific/Auckland'

def _fake_localtime(t=_frozentime + 1):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be named _frozen_localtime instead of _fake_localtime to be consistent.

@michel-kraemer
Copy link
Contributor

+1

What about your comments? Are you still working on this PR or should we merge it?

Cheers,
Michel

@florentx
Copy link
Contributor Author

I think I will apply the 2 suggestions I've proposed in comments : re-reading them after some days, I am +1 with myself 😄

Then this PR is ready for merging, and I could work to finish #30.

@aerostitch
Copy link
Contributor

Hi,

For the Last updated field, you could also use the footer-style attribute to none as default in the tests. This would remove the last updated field in the html pages for the tests.
This attribute is introduced by #9 .

Joseph

@@ -58,7 +58,7 @@ endif::basebackend-docbook[]
ifdef::basebackend-html[]
[source-filter-style]
ifeval::["{source-highlighter}"=="source-highlight"]
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f xhtml -s {language} {src_numbered?--line-number=' '} {src_tab?--tab={src_tab}} {args=}"
source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight --gen-version -f xhtml -s {language} {src_numbered?--line-number=' '} {src_tab?--tab={src_tab}} {args=}"
endif::[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does adding the generated version help to produce stable output?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually the switch --gen-version toggle off the version number

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, makes sense (well your change does, the option doesn't, should be --no-gen-version).

@elextr
Copy link
Contributor

elextr commented Jun 9, 2014

Are you able to squash the commits correcting previous commits? Leaving 4 commits.

@florentx
Copy link
Contributor Author

florentx commented Jun 9, 2014

ok, I'll try to rewrite the history

@florentx
Copy link
Contributor Author

florentx commented Jun 9, 2014

I've rebased and merged the commits.
Build passes.

michel-kraemer added a commit that referenced this pull request Jun 28, 2014
@michel-kraemer michel-kraemer merged commit b4e2e1d into asciidoc-py:master Jun 28, 2014
@florentx florentx deleted the stable-output branch June 29, 2014 10:07
@elextr elextr mentioned this pull request Mar 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants