Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Add "--minimal-test" CLI option #765

Merged
merged 4 commits into from
Oct 1, 2024
Merged

[TASK] Add "--minimal-test" CLI option #765

merged 4 commits into from
Oct 1, 2024

Conversation

garvinhicking
Copy link
Contributor

@garvinhicking garvinhicking commented Sep 24, 2024

This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

Closes #764

@linawolf
Copy link
Member

I was testing this out both with

docker run --rm -v ${PWD}:/project -it typo3-docs:local --progress --config=Documentation --minimal-test

and ddev

ddev exec vendor/bin/guides Documentation --config=Documentation --minimal-test

In both cases all 3 versions got rendered:

docker run --rm -v ${PWD}:/project -it typo3-docs:local --progress --config=Documentation --minimal-test
Parsing: 13/13 [============================] 100% Parsed 13 files in 0.67 seconds
Rendering: 13/13 [============================] 100% Output format html: Rendered 13 documents in 2.99 seconds                                                                                                                      
Rendering: 13/13 [============================] 100% Output format singlepage: Rendered 13 documents in 0.03 seconds                                                                                                                
Rendering: 13/13 [============================] 100% Output format interlink: Rendered 13 documents in 0.00 seconds
Successfully placed 13 rendered HTML, SINGLEPAGE, and INTERLINK files into /project/Documentation-GENERATED-temp

@linawolf
Copy link
Member

This might be due to the fact, that the main guides.xml also defines the output formats and these probably overrule the command? Not sure

@garvinhicking
Copy link
Contributor Author

You are probably right. I tested it without the 'config' directive. Need to inspect.

@garvinhicking
Copy link
Contributor Author

OK, this is too complex, I sadly have to give up. The guides.xml is loaded by guides after our decorator, there are dozens of config loaders and processors involved and I could not find a possibility to hook into it with for example an event listener, where I also would be able to get the original CLI input arguments.

We might need to first add this to guides to be able to override guides.xml options. I've asked Jaap and begged for help :D

@garvinhicking
Copy link
Contributor Author

@linawolf Jaap hinted me at the PostProjectNodeCreated event in which I can hook into. It's not very beautiful code because I natively parse argv here, because the event doesn't seem to offer access to the original InputInterface from Symfony nor the InputDefinition.

Since we only access that single "--minimal-test" option I don't feel too bad about it.

However, I'm unsure what the 'fail-on-log' config option would do. I only can access 'setFailOnError()' on the projects settings, to 'Fail-on-log' seems to be something else. Do we need it? If so, we would probably need to set that one in the RunDecorator, but if that option is then part of a 'guides.xml' we cannot override it.

@linawolf
Copy link
Member

I am not really sure what fail on log did

@garvinhicking
Copy link
Contributor Author

Then I would suggest to continue ignoring it for the time being. The important flags (fail on error, singlepage output format) should work with the updated patch.

@linawolf
Copy link
Member

Did you test if we also fail on warning?

@garvinhicking
Copy link
Contributor Author

I only tested if the option was set and implied it should work. Needs testing/verification, you are right.

@linawolf
Copy link
Member

I just tested this and adjusted the make files to use the flag. How ever, once I use --minimal-test no matter if I additionally --fail-on-log or not the runs are not returning a non-null status

@linawolf
Copy link
Member

I build one warning into the docs so we can test this

@garvinhicking
Copy link
Contributor Author

@linawolf Hm, the return status should be unaffected by this?! And "fail-on-log" is also unaffected. The only thing the patch at this point should do is adjust the output format, and enforce "fail-on-error" (NOT on warning).

I think warnings already have a success return code. Only errors would have another return code. Is the thing you added an error or a warning?

@linawolf
Copy link
Member

The thing I added is a warning. you can try this out by calling "make test-docs" locally. If you you remove "--minimal-test" from the command in the makefile the command fails due to the warning an the "fail on log". If you add "--minimal-test" it does not fail.

@garvinhicking
Copy link
Contributor Author

Alright, found it, I think.

'--fail-on-error' sets 'failOnError=error'
'--fail-on-log' sets 'failOnError=warning'

Thus I changed the logic for the 'minimal-test' case to set failonError('warning').

@garvinhicking garvinhicking merged commit 5ed82d4 into main Oct 1, 2024
7 checks passed
@garvinhicking garvinhicking deleted the minimal-test branch October 1, 2024 16:15
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Reference-Typoscript that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Reference-Typoscript that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Guide-HowToDocument that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-SitePackage that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Guide-Installation that referenced this pull request Oct 1, 2024
…n tests (#400)

* [TASK] Use --minimal-test CLI option for documentation tests

This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

* [TASK] Use --minimal-test CLI option for documentation tests

This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

---------

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Guide-Installation that referenced this pull request Oct 1, 2024
…n tests (#399)

* [TASK] Use --minimal-test CLI option for documentation tests

This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

* [TASK] Use --minimal-test CLI option for documentation tests

This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

---------

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-SitePackage that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5
github-actions bot pushed a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-SitePackage that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-Editors that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-SitePackage that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-Editors that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5
github-actions bot pushed a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-Editors that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5
github-actions bot pushed a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-Editors that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-SitePackage that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-Editors that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-Editors that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Guide-FrontendLocalization that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Guide-FrontendLocalization that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Reference-TSconfig that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

(cherry picked from commit 6ae38ac)
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Reference-TSconfig that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

(cherry picked from commit 6ae38ac)
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Reference-TCA that referenced this pull request Oct 1, 2024
…n tests (#1180)

[TASK] Use --minimal-test CLI option for documentation tests

This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Reference-TCA that referenced this pull request Oct 1, 2024
…n tests (#1180)

[TASK] Use --minimal-test CLI option for documentation tests

This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-GettingStarted that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

(cherry picked from commit 25e71c4)
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Tutorial-GettingStarted that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

(cherry picked from commit 25e71c4)
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Guide-HowToDocument that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Reference-Typoscript that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5
github-actions bot pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-Typoscript that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5
github-actions bot pushed a commit to TYPO3-Documentation/TYPO3CMS-Reference-Typoscript that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Reference-Typoscript that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
linawolf added a commit to TYPO3-Documentation/TYPO3CMS-Reference-Typoscript that referenced this pull request Oct 1, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765

Releases: main, 12.4, 11.5

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
linawolf added a commit to TYPO3-Documentation/DocsTypo3Org-Homepage that referenced this pull request Oct 3, 2024
This allows us to control specific settings needed for mininmal tests (like setting only a single output format) or more for the future.

See also: TYPO3-Documentation/render-guides#765
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "--minimal-test" option
2 participants