sahava / multisite-lighthouse-gcp

Run Lighthouse audits on URLs, and write the results daily into a BigQuery table.
MIT License
46 stars 25 forks source link

BigQuery Schema issues #17

Open jakub-busek opened 2 years ago

jakub-busek commented 2 years ago

Hey, anyone here who can help with BigQuery schema issues?

Getting following errors when running npm test


index.unit › should convert lhr to bigquery schema

  /Users/*/multisite-lighthouse-gcp/index.js:37

   36:                                                    
   37: const bqSchema = require(`./bigquery-schema.json`);
   38: const config = require(`./config.json`);           

  Error thrown in test:

  TypeError {
    message: 'Cannot read properties of undefined (reading \'score\')',
  }

  Object._createJSON (index.js:37:2827)
  Test.fn (test/index.unit.test.js:159:33)

  index.unit › should call bigquery load for id when called with id in pubsub message

  /Users/*/multisite-lighthouse-gcp/test/index.unit.test.js:328

   327:   await sample.program.launchLighthouse(event);                          
   328:   t.deepEqual(sample.mocks.bigquery.dataset().table().load.callCount, 1);
   329: });             
jakub-busek commented 2 years ago

I guess the schema is outdated, but wonder how to update it so it updates throughout all of the dependencies. Is it "just" to edit the bigquery-schema.json file, and if yes, what values should be there?