Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into url-inspect
Browse files Browse the repository at this point in the history
# Conflicts:
#	package-lock.json
#	package.json
  • Loading branch information
dzehnder committed Aug 20, 2024
2 parents 2ca14db + b56f1fe commit 05bfb42
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 32 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.26.1](https://github.com/adobe/spacecat-audit-worker/compare/v1.26.0...v1.26.1) (2024-08-20)


### Bug Fixes

* **deps:** update adobe fixes ([#371](https://github.com/adobe/spacecat-audit-worker/issues/371)) ([e2ebb3a](https://github.com/adobe/spacecat-audit-worker/commit/e2ebb3a120963d20a87b9e6c61586f61daa5384b))

# [1.26.0](https://github.com/adobe/spacecat-audit-worker/compare/v1.25.7...v1.26.0) (2024-08-20)


Expand Down
22 changes: 12 additions & 10 deletions package-lock.json

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

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/spacecat-audit-worker",
"version": "1.26.0",
"version": "1.26.1",
"description": "SpaceCat Audit Worker",
"main": "src/index.js",
"type": "module",
Expand Down Expand Up @@ -62,11 +62,11 @@
"@adobe/spacecat-shared-http-utils": "1.6.7",
"@adobe/spacecat-shared-rum-api-client": "2.7.3",
"@adobe/spacecat-shared-rum-api-client-v1": "npm:@adobe/[email protected]",
"@adobe/spacecat-shared-utils": "1.19.3",
"@aws-sdk/client-lambda": "3.624.0",
"@aws-sdk/client-secrets-manager": "3.624.0",
"@aws-sdk/client-sqs": "3.624.0",
"@aws-sdk/credential-provider-node": "3.624.0",
"@aws-sdk/client-lambda": "3.632.0",
"@aws-sdk/credential-provider-node": "3.632.0",
"@adobe/spacecat-shared-utils": "1.19.5",
"@aws-sdk/client-secrets-manager": "3.632.0",
"@aws-sdk/client-sqs": "3.632.0",
"diff": "5.2.0",
"jsdom": "24.1.1",
"urijs": "1.19.11"
Expand Down
27 changes: 11 additions & 16 deletions test/audits/backlinks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ describe('Backlinks Tests', function () {

const org = createOrganization({ name: 'org4' });

const brokenBacklinkWithTimeout = {
title: 'backlink that times out',
url_from: 'https://from.com/from-4',
url_to: 'https://foo.com/times-out',
domain_traffic: 500,
};

const auditResult = {
backlinks: [
{
Expand All @@ -116,12 +123,6 @@ describe('Backlinks Tests', function () {
url_to: 'https://foo.com/returns-429',
domain_traffic: 1000,
},
{
title: 'backlink that times out',
url_from: 'https://from.com/from-4',
url_to: 'https://foo.com/times-out',
domain_traffic: 500,
},
],
};

Expand Down Expand Up @@ -170,12 +171,6 @@ describe('Backlinks Tests', function () {
domain_traffic: 1000,
url_suggested: 'https://bar.foo.com/bar.html',
},
{
title: 'backlink that times out',
url_from: 'https://from.com/from-4',
url_to: 'https://foo.com/times-out',
domain_traffic: 500,
},
{
title: 'backlink that is not excluded',
url_from: 'https://from.com/from-not-excluded',
Expand Down Expand Up @@ -245,7 +240,7 @@ describe('Backlinks Tests', function () {

nock('https://foo.com')
.get('/times-out')
.delay(10000)
.delay(3010)
.reply(200);
});
afterEach(() => {
Expand Down Expand Up @@ -453,7 +448,7 @@ describe('Backlinks Tests', function () {
expect(context.log.info).to.have.been.calledWith('Successfully audited site2 for broken-backlinks type audit');
});

it('should filter out from audit result broken backlinks the ones that return ok(even with redirection)', async () => {
it('should filter out from audit result broken backlinks the ones that return ok (even with redirection)', async () => {
mockDataAccess.getSiteByID = sinon.stub().withArgs('site2').resolves(site2);
mockDataAccess.getTopPagesForSite.resolves([]);
mockDataAccess.getConfiguration = sinon.stub().resolves(configuration);
Expand All @@ -472,7 +467,7 @@ describe('Backlinks Tests', function () {
traffic_domain: 1500,
},
];
const allBacklinks = auditResult.backlinks.concat(fixedBacklinks);
const allBacklinks = auditResult.backlinks.concat(fixedBacklinks, brokenBacklinkWithTimeout);

nock('https://foo.com')
.get('/fixed')
Expand Down Expand Up @@ -502,7 +497,7 @@ describe('Backlinks Tests', function () {
},
auditResult: {
finalUrl: 'foo.com',
brokenBacklinks: auditResult.backlinks,
brokenBacklinks: auditResult.backlinks.concat(brokenBacklinkWithTimeout),
fullAuditRef: 'https://ahrefs.com/site-explorer/broken-backlinks?select=title%2Curl_from%2Curl_to%2Ctraffic_domain&limit=50&mode=prefix&order_by=domain_rating_source%3Adesc%2Ctraffic_domain%3Adesc&target=foo.com&output=json&where=%7B%22and%22%3A%5B%7B%22field%22%3A%22is_dofollow%22%2C%22is%22%3A%5B%22eq%22%2C1%5D%7D%2C%7B%22field%22%3A%22is_content%22%2C%22is%22%3A%5B%22eq%22%2C1%5D%7D%2C%7B%22field%22%3A%22domain_rating_source%22%2C%22is%22%3A%5B%22gte%22%2C29.5%5D%7D%2C%7B%22field%22%3A%22traffic_domain%22%2C%22is%22%3A%5B%22gte%22%2C500%5D%7D%2C%7B%22field%22%3A%22links_external%22%2C%22is%22%3A%5B%22lte%22%2C300%5D%7D%5D%7D',
},
};
Expand Down

0 comments on commit 05bfb42

Please sign in to comment.