Giter VIP home page Giter VIP logo

Comments (7)

djones avatar djones commented on May 27, 2024

Hi @toolmantim, thanks for reporting this and percy/percy-agent#30

I'm gonna pull down the Buildkite site and see about what we can do to resolve these issues later today.

from percy-puppeteer.

toolmantim avatar toolmantim commented on May 27, 2024

Thanks David! FYI I think I’m going to rejig the Docker/integration test setup, as some things don’t fit together nicely anymore. This was just the simplest thing to try to get it work.

from percy-puppeteer.

djones avatar djones commented on May 27, 2024

I have been able to get successful Percy builds going over the Buildkite site by running the following:

docker-compose build
export PERCY_TOKEN=xxx
docker-compose -f docker-compose.integration-tests.yml run integration-tests

There's a bunch of errors that output along the way. The biggest issue I've found so far are these lines:

https://github.com/buildkite/site/blob/master/integration-tests/index.test.js#L37-L39

I can understand why you might want to assert that no output shows up on console.log but just FYI that's one place things are breaking.

I changed those lines to:

  page.on('console', (msg) => {
    console.log(msg)
  })

to simply get some visibility on the console and not assert a fail. I'm seeing console errors around fonts:

Failed to decode downloaded font: http://site:3000/_next/static/assets/assets/fonts/lineto-circular-book-d41d8cd9.woff2'

It looks like that might be resolved with some private pieces in your codebase.

Interestingly I'm not seeing CSP errors.

from percy-puppeteer.

toolmantim avatar toolmantim commented on May 27, 2024

Thanks for digging in, and all the awesome info! I’ll give it another shot today and keep you posted.

from percy-puppeteer.

toolmantim avatar toolmantim commented on May 27, 2024

I've pushed a few changes to the branch, which you can run locally against the live https://buildkite.com/

yarn install
env PERCY_TOKEN=xyz yarn run integration:production

It creates a Percy build, but no snapshots are uploaded. The output looks like this:

yarn run v1.12.3
$ env PRODUCTION_HEADERS=true TEST_HOST=https://buildkite.com/ yarn run integration
$ percy exec -- mocha --recursive --no-timeouts integration-tests/*
[percy] created build #35: https://percy.io/buildkite-1/site/builds/1214053
[percy] percy has started.

Started HeadlessChrome/72.0.3617.0
  Home
    ✓ renders the tagline
    ✓ has a link to about
    ✓ has the security headers
    ✓ renders the same page with and without Javascript (1433ms)

  Logged in cookie behaviours
    without the logged in cookie
      ✓ has a link to signup (1056ms)
    with the logged in cookie
      ✓ has a link to dashboard (1064ms)

  About
warning: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
error: Refused to connect to 'http://localhost:5338/percy/healthcheck' because it violates the following Content Security Policy directive: "connect-src 'self' https://www.google-analytics.com".
warning: percy agent not started.

🤔

from percy-puppeteer.

toolmantim avatar toolmantim commented on May 27, 2024

I went down the rabbit hole of implementing Puppeteer’s request interception API (https://github.com/buildkite/site/commit/f4ecdf8bd23b673016f3806f5fa2a3d8568cc6dc) to rewrite the CORS header responses. But it appears that enabling request interception causes the browser, or Percy agent, to hang for some reason (minimal change to see the problem here https://github.com/buildkite/site/commit/246f98bf542de4b001188801fa1ed55e4cafebb8)

Removing all request interception (https://github.com/buildkite/site/commit/be2ecc38b0f3281c5475ec537ff46d619849531f) and the CORS headers lets everything work again (https://percy.io/buildkite-1/site/builds/1220254)

About
  | warning: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
  | [percy] snapshot taken: 'About'
  | ✓ responds ok (1317ms)

I think my next step might be to try to implement a proxy server, to avoid Puppeteer’s request interception. And figure out what's going on with the styles in the snapshots.

from percy-puppeteer.

djones avatar djones commented on May 27, 2024

Closing this issue now because Percy agent communication now effectively works around CSP issues with #36

Be sure to use @percy/puppeteer 1.0.1 or higher

from percy-puppeteer.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.