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 scroll behaviour + [wip] cypress tests for scroll behaviour #8359

Merged
merged 9 commits into from
Sep 21, 2018

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Sep 20, 2018

fixes #7454 (again) but adding tests to catch regressions in future

problem was temp hack for reach/router was disabled by recent changes because of order of calls changes - it's restored now

@pieh
Copy link
Contributor Author

pieh commented Sep 20, 2018

Argh, of course my cypress tests locally but not in CI :)

@pieh pieh changed the title fix scroll behaviour fix scroll behaviour + [wip] cypress tests for scroll behaviour Sep 20, 2018
@DSchau
Copy link
Contributor

DSchau commented Sep 20, 2018

Oh right duh. So Travis tests are going to fail, because I broke that with the CircleCI stuff. I'll fix that in a bit. It's weird, it looks like this PR somehow used the old CircleCI setup too 🙃

I'll take a closer look in a bit! This looks good though!

@DSchau
Copy link
Contributor

DSchau commented Sep 20, 2018

@pieh see #8361 and #8362 for some fixes for this stuff! It's possible your tests are failing in CI for an unrelated reason, but should at least be closer to passing 🙃

@pieh
Copy link
Contributor Author

pieh commented Sep 20, 2018

it looks like this PR somehow used the old CircleCI setup too 🙃

Hmm, I'll merge master and see if that fixes circleCI test then

--edit:
seems like it in fact used old stuff:

➜  gatsby git:(scroll-fix) ✗ git merge origin/master
Merge made by the 'recursive' strategy.
 .circleci/config.yml                        | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------------------------------------------------
 scripts/assert-changed-files.sh             |  11 +++++++++++
 scripts/integration-test.sh                 |  32 +++++++++++++-------------------
[...]

@DSchau
Copy link
Contributor

DSchau commented Sep 20, 2018

@pieh they passed!! Except it's a false positive, haha. Basically the way it works is that the current commit's files are what trigger (or don't trigger) the e2e tests.

I think/thought that was a good idea, but now we won't really know whether they're passing for real or not unless a change to packages/ or integration-tests/ comes through in a commit. I can also change that behavior, but the thought was that for each commit we should run only what's needed. i.e. one commit might change packages -> run e2e tests. Next commit might be a README.md change -> don't run e2e tests, etc.

@pieh
Copy link
Contributor Author

pieh commented Sep 20, 2018

Oh, so it doesn't check file changes in PR - just file changes in latest commit?

@DSchau
Copy link
Contributor

DSchau commented Sep 20, 2018

@pieh yup. But like I said, I can change that, open to other suggestions :)

@KyleAMathews
Copy link
Contributor

That makes sense as a default. This is an edge case. Is there a way to manually trigger tests to run for real?

@DSchau
Copy link
Contributor

DSchau commented Sep 20, 2018

@KyleAMathews I think I can set up the e2e test suite as an approval workflow. Those tests wouldn't make the same check as to whether certain files changed.

It'd be a bit of duplication in the job structure, but worth doing?

@KyleAMathews
Copy link
Contributor

Maybe yeah. But since this is such an edge case (not many people are going to be PRing from older code), @pieh could just push a commit with a minor change to trigger tests

Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

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

LGTM!

"gatsby-plugin-manifest": "next",
"gatsby-plugin-offline": "next",
"gatsby-plugin-react-helmet": "next",
"gatsby": "latest",
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 We should probably switch all versions in integration-tests to use this pattern now, too.

}
}

getSnapshotBeforeUpdate(prevProps, prevState) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Such a nit, but you're not actually using prevState are you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, yeah, will fix - it should also trigger actual tests, so that's good

@KyleAMathews
Copy link
Contributor

sh: 1: gatsby: Permission denied

Hmmm that's why CircleCi failed @DSchau

@DSchau
Copy link
Contributor

DSchau commented Sep 20, 2018

@KyleAMathews I can SSH into the box, but 99% sure that's the chmod fix that enables this to work. Otherwise I could run the commands as sudo, which may also fix it.

@KyleAMathews
Copy link
Contributor

Ok interesting — yeah, this sounds like a circleci wrinkle

@DSchau DSchau merged commit a81afe1 into gatsbyjs:master Sep 21, 2018
oorestisime pushed a commit to oorestisime/gatsby that referenced this pull request Sep 28, 2018
…byjs#8359)

fixes gatsbyjs#7454 (again) but adding tests to catch regressions in future

problem was temp hack for reach/router was disabled by recent changes because of order of calls changes - it's restored now
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.

[v2] Navigating to previously visited pages with <Link> retains scroll position
3 participants