This package modifies and uploads mochawesome report files to a given Google Big Query data store.
The report files can be generated with mochawesome.
This package will merge the report files with mochawesome-merge
and generate a report with mochawesome-report-generator
in the mochawesome-report
directory.
- Fields
passPercent
andpendingPercent
to be of schema typeFLOAT
. - Field
err
is modified to be of schema typeRECORD
.
When a mochawesome report file is uploaded to Google Big Query, the table schema is auto detected.
The attributes and values set in the initial upload dictate the table schema.
Any subsequent uploads to the same table that result in a mismatch of the initial table schema will result in an upload failure.
These modificiations mitigate upload discrepancies when percentages switch between an INTEGER
(ie 100) or a FLOAT
(ie 98.8888)
and when the field err
has zero or more records.
This package assumes that the report files are already generated by mochawesome in the mochawesome-report
directory. See https://github.com/adamgruber/mochawesome#output
Get the latest Google Cloud SDK at https://cloud.google.com/sdk/docs#install_the_latest_cloud_tools_version_cloudsdk_current_version
npm install -D https://github.com/coltadorsey/mochawesome-to-gbq.git
gcloud auth login
gcloud config set project PROJECT_ID
DS=your_data_store TBLREPORT=your_report_name npx mochawesome-to-gbq