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

test: enable integation tests for image sharp #11567

Merged
merged 18 commits into from
Feb 11, 2019
Merged

test: enable integation tests for image sharp #11567

merged 18 commits into from
Feb 11, 2019

Conversation

wardpeet
Copy link
Contributor

@wardpeet wardpeet commented Feb 5, 2019

Description

Adding some integration tests for our lazy builds setup. It's primarily going to be used to validate #10964. And probably more issues that we need to validate on a real run instead of just testing the functions separately.

Related Issues

#10964, #7348, #10815

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.

This is looking awesome! Wish there were some way we could move off of all the hard-coded paths (because this really won't be resilient to changes if we make any changes--but maybe that's OK?), but beyond that--the functionality seems solid!

One comment on the above: maybe we could readdir on public/static/image-hash and then ensure there are X images rather than checking each image directly?

@wardpeet
Copy link
Contributor Author

wardpeet commented Feb 6, 2019

One comment on the above: maybe we could readdir on public/static/image-hash and then ensure there are X images rather than checking each image directly?

this is probably more maintainable 👍

@wardpeet wardpeet requested a review from a team as a code owner February 6, 2019 21:25
@DSchau
Copy link
Contributor

DSchau commented Feb 6, 2019

@wardpeet heads up I fixed the CircleCI config errors.

Super helpful to use the circleci CLI -> https://circleci.com/docs/2.0/local-cli/#installation

brew install circleci is my preferred way!

@wardpeet
Copy link
Contributor Author

wardpeet commented Feb 7, 2019

@wardpeet heads up I fixed the CircleCI config errors.

Super helpful to use the circleci CLI -> circleci.com/docs/2.0/local-cli/#installation

brew install circleci is my preferred way!

Sweet thanks a bunch! I'm on a linux vm now so I'm using apt-get but I saw that homebrew is now also available on linux

@wardpeet wardpeet added type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response and removed status: WIP labels Feb 8, 2019
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.

Left some comments; great work!

This is pretty much good to go!

.circleci/config.yml Outdated Show resolved Hide resolved
integration-tests/gatsby-pipeline/README.md Show resolved Hide resolved
integration-tests/gatsby-pipeline/README.md Show resolved Hide resolved
integration-tests/gatsby-pipeline/gatsby-node.js Outdated Show resolved Hide resolved
@@ -1,12 +1,19 @@
const glob = require(`glob`)

const pkgs = glob
Copy link
Contributor

Choose a reason for hiding this comment

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

Merely an alternate approach--both work well here!

const roots = glob
  .sync(`*/`, {
    cwd: path.join(process.cwd(), `integration-tests`),
  })
  .map(testPath => `<rootDir>/integration-tests/${testPath}`)

Copy link
Contributor Author

@wardpeet wardpeet Feb 11, 2019

Choose a reason for hiding this comment

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

you probably want to replace process.cwd() with __dirname?
I copied this from the base config 😛 i'll update in another pr and take the other jest.config with it

scripts/e2e-test.sh Show resolved Hide resolved
@wardpeet wardpeet merged commit 40c2199 into master Feb 11, 2019
@wardpeet wardpeet deleted the tests/lazy-load branch February 11, 2019 11:36
gurpreet-hanjra pushed a commit to gurpreet-hanjra/gatsby that referenced this pull request Feb 14, 2019
* test: enable integration tests for image sharp
pragmaticpat pushed a commit to pragmaticpat/gatsby that referenced this pull request Apr 28, 2022
* test: enable integration tests for image sharp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants