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

HTML test reporter - relative path for assets #2651

Closed
4 tasks done
ben-reitz opened this issue Jan 12, 2023 · 1 comment · Fixed by #2695
Closed
4 tasks done

HTML test reporter - relative path for assets #2651

ben-reitz opened this issue Jan 12, 2023 · 1 comment · Fixed by #2695
Labels
enhancement New feature or request pr welcome

Comments

@ben-reitz
Copy link

Clear and concise description of the problem

As part of the CI/CD pipeline at our company, we upload the test report folder to a large repository of test reports where the static assets are automatically served on a standard path related to which version of the tests were run. For example:

https://test-reports-url.com/repo_name/branch_name/build_number/<folder_of_report_assets>

This approach needs the folder of static assets for the html report to be referenced from the index.html with a relative path (assets/index-21883a1b.js) rather than the current fixed path (/__vitest__/assets/index-21883a1b.js) so they can be served on a URL like the one shown above.

Suggested solution

When generating the HTML test report, output the paths with the expectation that the HTML report could be served from any URL and don't mandate the fixed root.com/__vitest__/report URL format.

Alternative

Provide a configuration option to choose how the report should be generated.

Additional context

No response

Validations

@sheremet-va sheremet-va added enhancement New feature or request pr welcome labels Jan 12, 2023
@mysteryven
Copy link
Contributor

mysteryven commented Jan 17, 2023

Since add a new option should be seriously considered, what about just set base from '/__vitest__' to './' in the generated HTML report?

@github-actions github-actions bot locked and limited conversation to collaborators Jun 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request pr welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants