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

fix: timeouts due to audio, video elements #39

Merged
merged 17 commits into from
Sep 28, 2020

Conversation

mohanraj-r
Copy link
Contributor

@mohanraj-r mohanraj-r commented Sep 23, 2020

Related to audio, video elements cause timeout in jest even with audio/video rules disabled · Issue #2528 · dequelabs/axe-core

Fixes 🐛

  • preset-rules: disable preloading media in axe config to fix timeout issue (3cffead)

Chores 🧹

  • bump version of packages as they hadn't been bumped since 0.2.0-beta
  • add cmd to ensure pkg versions are bumped (85025d4)

Documentation 📝

  • add caution notices about color contrast and headless mode (3f9f2dc)

@codecov
Copy link

codecov bot commented Sep 23, 2020

Codecov Report

Merging #39 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #39   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          112       115    +3     
  Branches        11        10    -1     
=========================================
+ Hits           112       115    +3     
Impacted Files Coverage Δ
packages/assert/src/assert.ts 100.00% <ø> (ø)
packages/preset-rules/src/a11yConfig.ts 100.00% <ø> (ø)
packages/test-utils/src/utils.ts 100.00% <ø> (ø)
packages/common/src/axe.ts 100.00% <100.00%> (ø)
packages/format/src/format.ts 100.00% <100.00%> (ø)
packages/jest/src/setup.ts 100.00% <100.00%> (ø)
packages/test-utils/src/index.ts 100.00% <100.00%> (ø)
packages/test-utils/src/test-data.ts 100.00% <100.00%> (ø)

// Disable preloading assets as it causes timeouts for audio/video elements
// with jest and delays webdriver tests by 2-3x when assets are not found (404)
// Ref: https://github.com/dequelabs/axe-core/issues/2528
preload: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@trevor-bliss @cordeliadillon This one line is essentially the fix for audio/video timeout issue. Rest of the changes are updating tests, docs and bumping versions.

Can you please review this when possible. I will get a release to npm with this fix once the PR is merged.

cordeliadillon
cordeliadillon previously approved these changes Sep 24, 2020
- Not invoking it async would result in incorrect results e.g. no issues reported even when the page is not accessible
- **color-contrast**: Color-contrast check is disabled for Jest tests as it is [doesn't work in JSDOM](https://github.com/dequelabs/axe-core/issues/595)
Copy link
Contributor

Choose a reason for hiding this comment

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

Grammatical typo -- remove "is"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thanks - fixed

packages/jest/README.md Show resolved Hide resolved
package.json Outdated
"lint:deps": "lerna exec depcheck",
"lint:depgraph": "yarn pkg:depgraph && git diff --quiet docs/sa11y_dependency_graph.svg || echo 'Dependency graph needs to be updated!'",
"lint:fix": "yarn lint --fix",
"lint:lockfile": "lockfile-lint --path yarn.lock --allowed-hosts registry.yarnpkg.com --validate-https",
"lint:staged": "lint-staged",
"lint:version": "vertioner && yarn lerna exec --since master vertioner",

Choose a reason for hiding this comment

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

What does this do exactly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a small util to check if the version field in package.json file in current branch is different than master. I am using it to ensure the versions for packages that are changed are bumped without fail.

Choose a reason for hiding this comment

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

So the expectation is every PR must bump the version of all packages?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really - only the changed packages (yarn lerna exec --since master .. takes care of that) and the monorepo root version.

Choose a reason for hiding this comment

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

Ok interesting. I see a couple potential issues with this flow:

  1. There can be version conflicts between PRs. Imagine there are several PRs open at the same time and they all bump the version to the next patch version. As soon as one gets merged, all other PRs must go in and bump their version again. This potentially repeats for every open PR when a different PR is merged.

  2. There may be versions in github without corresponding NPM releases. Unless we release every commit to master to NPM, there may be several version bumps before a new version in NPM. Not necessarily a bad thing but can be confusing IMO.

  3. We put the burden of versioning on the PR author. When I contribute to other projects I just focus on the code fix rather than worrying about whether something should be a patch vs. minor release.

Just my opinion but I think it makes more sense to leave the versions untouched in PRs and then do a release from master or a release branch and we as project maintainers decide when that release happens and what version to bump to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @trevor-bliss - Those are very valid concerns 👍
I have created a issue to track this and continue discussion #40

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@trevor-bliss I have removed the version check on mono-repo root due to a potential issue of it failing after merging into master

I was also able to remove force setting the master branch in CI branch since lerna exec seems to work fine without it.

Can you please give a glance and approve.
I will release to npm and work on improving versioning as part of #40

@@ -11,6 +11,8 @@ jobs:
- browser-tools/install-chrome
- browser-tools/install-chromedriver
- checkout
# CircleCI seems to mess with master ref which causes lint:version check to fail
- run: git branch -f master origin/master

Choose a reason for hiding this comment

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

I'm not sure about this. I don't really understand why we need vertioner to begin with though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah agree, this is not ideal. But CircleCI seems to map local master branch to the current PR or something. Have been thinking about a better solution - will keep looking.

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 has been removed now.

trevor-bliss
trevor-bliss previously approved these changes Sep 24, 2020
Copy link

@trevor-bliss trevor-bliss left a comment

Choose a reason for hiding this comment

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

Have some opinions on the versioning and release flow as commented, but the actual code changes here look good.

as lint version with lerna seems to work fine without it
Copy link

@trevor-bliss trevor-bliss left a comment

Choose a reason for hiding this comment

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

:shipit:

@mohanraj-r mohanraj-r merged commit 060538d into salesforce:master Sep 28, 2020
@mohanraj-r mohanraj-r deleted the fix_audio_video_timeout branch September 28, 2020 18:08
@mohanraj-r mohanraj-r restored the fix_audio_video_timeout branch September 28, 2020 18:08
@mohanraj-r mohanraj-r deleted the fix_audio_video_timeout branch September 28, 2020 18:09
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.

3 participants