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

730 - Refactor jUnit HTML report #731

Merged
merged 10 commits into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions junit_html_report/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
26 changes: 3 additions & 23 deletions junit_html_report/.gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
build
node_modules
.idea
69 changes: 9 additions & 60 deletions junit_html_report/README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,12 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
jUnit HTML report
=================

## Contributing
# One time setup
- install Node (any reasonably modern version will do as long as it comes with NPM)
- run `npm` or `yarn` (if you use Yarn)

Install [Visual Studio Code](https://code.visualstudio.com/)
# To build a static HTML/CSS app
- run `npm run build` or `yarn build` - this will transpile/bundle/minify a simple JS app and inline it into an HTML file (`../test_runner/src/main/resources/inline.html`)

Install node
- `brew install node`

Install yarn
- `brew install yarn`

Install deps
- `yarn`

Run locally
- `yarn start`

Create inline.html to bundle in the flank jar
- `./update_report.sh`

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br>
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
# To spin up a dev server
- run `npm run start` or `yarn start` - this should serve the app with test data and reload whenever source files change.
52 changes: 52 additions & 0 deletions junit_html_report/index.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!doctype html>
<meta charset="UTF-8">
<title><%= htmlWebpackPlugin.options.title %></title>
<svg style="display: none">
<defs>
<symbol id="icon-chevron" viewBox="0 0 7 12">
<path d="M0.756683 0.675335L6.03278 5.95143L0.756683 11.2275" stroke-width="0.5" />
</symbol>
</defs>
</svg>
<div id="results"></div>

<% if (htmlWebpackPlugin.options.inlineBundle) { %>
<script>
window.resultData = "INJECT-DATA-HERE";
</script>
<script>
<%= compilation.getAsset('bundle.js').source._value %>
</script>
<% } else { %>
<script>
// NOTE: Test data - does not get inlined.
window.resultData = `
[
{
"label": "First group",
"items": [
{
"label": "First item",
"url": "foo"
},
{
"label": "Second item",
"url": "bar"
}
]
},
{
"label": "Second group",
"items": [
{
"label": "First item of the second group",
"url": "baz"
}
]
}
]
`;
</script>
<script src="bundle.js"></script>
<% } %>

14 changes: 0 additions & 14 deletions junit_html_report/inline.js

This file was deleted.

Loading