Skip to content

Commit

Permalink
Merge branch 'main' of github.com:adobe/spacecat-audit-worker into si…
Browse files Browse the repository at this point in the history
…tes-23343
  • Loading branch information
dipratap committed Aug 29, 2024
2 parents 1ed4f35 + 64a0804 commit 66e8600
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.29.1](https://github.com/adobe/spacecat-audit-worker/compare/v1.29.0...v1.29.1) (2024-08-28)


### Bug Fixes

* audit context includes interval info ([#383](https://github.com/adobe/spacecat-audit-worker/issues/383)) ([c0add98](https://github.com/adobe/spacecat-audit-worker/commit/c0add98e5b1a794284bcb72624c284f0aed6593d))

# [1.29.0](https://github.com/adobe/spacecat-audit-worker/compare/v1.28.1...v1.29.0) (2024-08-27)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/spacecat-audit-worker",
"version": "1.29.0",
"version": "1.29.1",
"description": "SpaceCat Audit Worker",
"main": "src/index.js",
"type": "module",
Expand Down
3 changes: 3 additions & 0 deletions src/cwv/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export async function CWVRunner(auditUrl, context, site) {
const cwvData = await rumAPIClient.query('cwv', options);
const auditResult = {
cwv: cwvData.filter((data) => data.pageviews >= DAILY_THRESHOLD * INTERVAL),
auditContext: {
interval: INTERVAL,
},
};

return {
Expand Down
3 changes: 3 additions & 0 deletions test/audits/cwv.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ describe('Index Tests', () => {
expect(result).to.deep.equal({
auditResult: {
cwv: rumData.filter((data) => data.pageviews >= 7000),
auditContext: {
interval: 7,
},
},
fullAuditRef: auditUrl,
});
Expand Down
8 changes: 4 additions & 4 deletions test/fixtures/rum-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const rumData = [
inpCount: 3,
ttfb: 520.4500000476837,
ttfbCount: 18,
pageviews: 2620,
pageviews: 9620,
},
{
url: 'https://www.aem.live/developer/block-collection',
Expand All @@ -33,7 +33,7 @@ export const rumData = [
inpCount: 2,
ttfb: 122.90000003576279,
ttfbCount: 4,
pageviews: 2000,
pageviews: 8000,
},
{
url: 'https://www.aem.live/docs/',
Expand All @@ -45,7 +45,7 @@ export const rumData = [
inpCount: 8,
ttfb: 96.97500000149012,
ttfbCount: 16,
pageviews: 1910,
pageviews: 7910,
},
{
url: 'https://www.aem.live/tools/rum/explorer.html',
Expand All @@ -57,7 +57,7 @@ export const rumData = [
inpCount: 5,
ttfb: 312.69999980926514,
ttfbCount: 9,
pageviews: 1600,
pageviews: 7600,
},
{
url: 'https://www.aem.live/developer/tutorial',
Expand Down

0 comments on commit 66e8600

Please sign in to comment.