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

[WIP] Fix how we call grunt with multiple tasks #7461

Closed
wants to merge 2 commits into from

Conversation

ycombinator
Copy link
Contributor

This way, if we invoke npm test with options like npm test -- --esvm-no-fresh, the options are available to all grunt tasks, not just the last one.

This way, if we invoke `npm test` with options like `npm test -- --esvm-no-fresh`, the options are available to all grunt tasks, not just the last one.
@ycombinator
Copy link
Contributor Author

jenkins, test it

@jbudz
Copy link
Member

jbudz commented Jun 15, 2016

Any reason for not adding this to the grunt test command? Not running on jenkins? https://github.com/elastic/kibana/blob/master/tasks/test.js#L18

@cjcenizal
Copy link
Contributor

👍 Awesome! Thanks for the improvement.

@ycombinator
Copy link
Contributor Author

@jbudz I see no reason not to do it that way. I didn't know the original intent of doing it in package.json so I left it that way and made a minor improvement. @cjcenizal would it be okay to move test:visualRegression as a sub-task of test:quick in the grunt task file instead?

@cjcenizal
Copy link
Contributor

@ycombinator After talking about it with @spalger, I put the task into package.json so that the visualRegression task would run regardless of the tests failing. I think if it's a sub-task, grunt will exit after a test fails, and visualRegression won't run. The long-term goal is to be able to run this on Jenkins and push the resulting visual regression gallery to S3. But I haven't been able to get access to Jenkins's configuration yet, so I haven't been able to set that up.

@ycombinator
Copy link
Contributor Author

ycombinator commented Jun 15, 2016

@cjcenizal I see. Then I think we need a way to accomplish both these constraints: run the visualRegression task regardless of tests failing and be able to pass any command-line options to all grunt invocations. Perhaps the solution lies in moving visualRegression into the grunt tasks file but not as a sub-task of test:quick.

@spalger
Copy link
Contributor

spalger commented Jun 15, 2016

The reason this was done this way is that we want the test:visualRegression task to run even if the test task fails. using --force won't work because it won't differentiate between the sub-tasks of test (which is shouldn't run if test fails) so the only way I can think of to do this is using the ; command separator.

@ycombinator
Copy link
Contributor Author

ycombinator commented Jun 15, 2016

@spalger The current behavior with using the ; separator seems broken to me. My specific use case is that I want to be able to call npm run test -- --esvm-no-fresh and not have ESVM download a fresh Elasticsearch build. Currently that's broken because the effective command becomes grunt test; grunt test:visualRegression --esvm-no-fresh. Note that the first grunt command never gets passed the --esvm-no-fresh option so it ends up downloading a fresh Elasticsearch build anyway.

I understand we want the test:visualRegression task to run even if the test task fails. But I also think any commandline options should be available to both tasks.

@spalger
Copy link
Contributor

spalger commented Jun 15, 2016

Yeah, that's fair, which is why I didn't close the pr :) we just can't merge it as is

@ycombinator
Copy link
Contributor Author

Agreed. I'll mark it as WIP and remove the review label so its clearer that it should not be merged in its current state.

@ycombinator ycombinator changed the title Fix how we call grunt with multiple tasks [WIP] Fix how we call grunt with multiple tasks Jun 15, 2016
@ycombinator
Copy link
Contributor Author

ycombinator commented Jun 16, 2016

I looked into using grunt-continue but that simply toggles --force around specific tasks via continue:on and continue:off, which isn't going to cut it as Spencer noted in an earlier comment. Continuing to look into other ways of achieving both constraints.

@epixa
Copy link
Contributor

epixa commented Jun 16, 2016

I don't understand. Why not just add visualRegression to test?

@ycombinator
Copy link
Contributor Author

@epixa Unless I'm misunderstanding your question, I think the answer is in this comment from CJ above: #7461 (comment).

BTW, I think I have something that works while satisfying both constraints. @spalger and others, mind giving this another review?

@ycombinator ycombinator changed the title [WIP] Fix how we call grunt with multiple tasks Fix how we call grunt with multiple tasks Jun 16, 2016
@@ -38,7 +38,7 @@
"Tim Sullivan <tim@elastic.co>"
],
"scripts": {
"test": "grunt test; grunt test:visualRegression",
"test": "bash -c 'grunt test $@; grunt test:visualRegression $@' --",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does mean development has to be done on a system with bash on it, which may be too restrictive.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that's a no go. The dev tasks need to be able to run on windows and such.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okie doke. Marking this PR as WIP again.

@epixa
Copy link
Contributor

epixa commented Jun 16, 2016

Our tests don't bail once a single failure is found, so I'm not sure how adding visualRegression to grunt test would prevent it from running if there were tests failures.

@ycombinator ycombinator changed the title Fix how we call grunt with multiple tasks [WIP] Fix how we call grunt with multiple tasks Jun 16, 2016
@cjcenizal
Copy link
Contributor

cjcenizal commented Jun 16, 2016

@epixa I did an experiment by adding the visualRegression task to test:ui:

grunt.registerTask('test:ui', [
  'esvm:ui',
  'run:testUIServer',
  'downloadSelenium',
  'run:seleniumServer',
  'clean:screenshots',
  'intern:dev',
  'test:visualRegression',
  'esvm_shutdown:ui',
  'stop:seleniumServer',
  'stop:testUIServer'
]);

I then hard-coded a test to fail and tried running grunt test. The intern:dev completes and reports the failure, but then grunt exits without running test:visualRegression and subsequent tasks.

@epixa
Copy link
Contributor

epixa commented Jun 16, 2016

In that case, if tests do bail once one task fails, why do we want visualRegression to behave differently than the other test suites?

@cjcenizal
Copy link
Contributor

I think the idea is that we could use the generated screenshots/visual_regression_gallery.html to do some debugging. So you could run your tests, take a look at the gallery, and notice some UI error that's breaking the tests. At least that's the theory. 😄 I don't think the value of this has been proven yet...

@cjcenizal
Copy link
Contributor

cjcenizal commented Jun 16, 2016

If this is blocking people or costing an inordinate amount of attention, I suggest we remove the visualRegression task from the npm scripts and refrain from adding it to the grunt test tasks. At this point, I think I'm the only person really using it, so I'm fine with just running grunt visualRegression locally for now.

@epixa
Copy link
Contributor

epixa commented Jun 16, 2016

For consistency's sake, we should just toss it at the end of grunt test and be done with it. You can always add a test:visualRegressions npm script to explicitly run this test if that's desired.

@ycombinator
Copy link
Contributor Author

@cjcenizal Based on #7461 (comment), I'm going to close this PR (unmerged) so you can do a separate, clean PR instead.

@ycombinator ycombinator deleted the grunt-multi-task branch June 17, 2016 01:03
cee-chen added a commit that referenced this pull request Mar 22, 2024
`v93.3.0`⏩ `v93.4.0`

---

## [`v93.4.0`](https://github.com/elastic/eui/releases/v93.4.0)

- Added the following properties to `EuiButtonGroup`'s `options`
configs: `toolTipContent`, `toolTipProps`, and `title`. These new
properties allow wrapping buttons in `EuiToolTips`, and additionally
customizing or disabling the native browser `title` tooltip.
([#7461](elastic/eui#7461))
- Enhanced `EuiResizeObserver` and `useResizeObserver`'s performance to
not trigger page reflows on resize event
([#7575](elastic/eui#7575))
- Updated `EuiSuperUpdateButton` to support custom button text via an
optional `children` prop
([#7576](elastic/eui#7576))

**Bug fixes**

- Fixed `EuiFlyout` to not repeatedly remove/add a body class on resize
([#7462](elastic/eui#7462))
- Fixed `EuiToast` title text to wrap instead of overflowing out of the
container ([#7568](elastic/eui#7568))
- Fixed a visual bug with `EuiHeaderBreadcrumbs` with popovers
([#7580](elastic/eui#7580))

**Deprecations**

- Deprecated `euiPalettePositive` and `euiPaletteNegative` in favour of
a more culturally inclusive `euiPaletteGreen` and `euiPaletteRed`
([#7570](elastic/eui#7570))
- Deprecated all charts theme exports in favor of `@elastic/charts`
exports: ([#7572](elastic/eui#7572))
- Deprecated `EUI_CHARTS_THEME_<DARK|LIGHT>` in favor of
`<DARK|LIGHT>_THEME` from `@elastic/charts`.
([#7572](elastic/eui#7572))
- Deprecated `EUI_SPARKLINE_THEME_PARTIAL` in favor of
`useSparklineOverrides` theme from the kibana `charts` plugin `theme`
service.

**Accessibility**

- Updated `EuiModal` to set an `aria-modal` attribute and a default
`dialog` role ([#7564](elastic/eui#7564))
- Updated `EuiConfirmModal` to set a default `alertdialog` role
([#7564](elastic/eui#7564))
- Fixed `EuiModal` and `EuiConfirmModal` to properly trap
Safari+VoiceOver's virtual cursor
([#7564](elastic/eui#7564))
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.

5 participants