From bcf7e8ecaae7bbfa8f32d19a432a5023c0ae57d4 Mon Sep 17 00:00:00 2001 From: Jacob Karlsson Date: Thu, 26 Oct 2023 23:57:33 +0200 Subject: [PATCH 1/4] Use testbot with noUse --- package-lock.json | 6 +++--- package.json | 2 +- test/helpers/test-bot.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3abb70a..2598387 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "devDependencies": { "cross-env": "^7.0.3", "is-canonical-base64": "^1.1.1", - "scuttle-testbot": "^2.1.0", + "scuttle-testbot": "github:ssbc/scuttle-testbot#no-use", "ssb-box2": "ssbc/ssb-box2#pobox", "ssb-db2": "^7.1.1", "ssb-replicate": "^1.3.3", @@ -4716,9 +4716,9 @@ }, "node_modules/scuttle-testbot": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/scuttle-testbot/-/scuttle-testbot-2.1.0.tgz", - "integrity": "sha512-v519Xn31VZTs629fbd1Gb73W0Qu8/6qhWEq6Df2HDPVpmP+ovSXc87eVEZG1qC2vlP94DHu6kzMNmLSvrdQOTw==", + "resolved": "git+ssh://git@github.com/ssbc/scuttle-testbot.git#4ce8fc01d8c11bca63c36ffb78d29a395d08a35b", "dev": true, + "license": "MIT", "dependencies": { "color-tag": "^1.0.2", "pull-paramap": "^1.2.2", diff --git a/package.json b/package.json index 58dc24f..ef27f29 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "devDependencies": { "cross-env": "^7.0.3", "is-canonical-base64": "^1.1.1", - "scuttle-testbot": "^2.1.0", + "scuttle-testbot": "github:ssbc/scuttle-testbot#no-use", "ssb-box2": "ssbc/ssb-box2#pobox", "ssb-db2": "^7.1.1", "ssb-replicate": "^1.3.3", diff --git a/test/helpers/test-bot.js b/test/helpers/test-bot.js index 7db2d4f..07fbda9 100644 --- a/test/helpers/test-bot.js +++ b/test/helpers/test-bot.js @@ -33,8 +33,8 @@ module.exports = function TestBot (opts = {}) { legacyMode: true, ...opts.box2 }, - // we don't want testbot to import db2 for us, we want more granularity and control of dep versions - db1: true, + // we don't want testbot to import db1 or db2 for us, we want to control what db2 plugins get imported + noUse: true, ...opts }) From 3b89efba021b5bc4695995f52ba1e55153661333 Mon Sep 17 00:00:00 2001 From: Jacob Karlsson Date: Fri, 27 Oct 2023 00:06:54 +0200 Subject: [PATCH 2/4] Don't use db1 index functions --- test/rebuild.test.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/test/rebuild.test.js b/test/rebuild.test.js index 38b2da6..68fd2dc 100644 --- a/test/rebuild.test.js +++ b/test/rebuild.test.js @@ -34,8 +34,6 @@ test('rebuild (I am added to a group)', async t => { // time for rebuilding await p(setTimeout)(500) - t.true(me.status().sync.sync, 'all indexes updated') - const msgs = await pull( me.db.query( where(and( @@ -243,12 +241,6 @@ test('rebuild from listen.addMember', t => { // NOTE with auto-rebuild active, this listener gets hit twice: // 1. first time we see group/add-member (unboxed with DM key) // 2. after rebuild - function checkRebuildDone (done) { - if (A.status().sync.sync) return done() - - console.log('waiting for rebuild') - setTimeout(() => checkRebuildDone(done), 500) - } pull( listen.addMember(A), pull.filter(m => !m.sync), @@ -259,12 +251,12 @@ test('rebuild from listen.addMember', t => { // (2) B invites A if (heardCount === 2) { - checkRebuildDone(() => { + setTimeout(() => { A.close(err => { t.error(err, 'A closed') t.end() }) - }) + }, 500) } }) ) From cb9d20903abf51dc9fb594d4615c0cd67d4dd97e Mon Sep 17 00:00:00 2001 From: Jacob Karlsson Date: Mon, 30 Oct 2023 13:25:43 +0100 Subject: [PATCH 3/4] noUse->noDefaultUse --- package-lock.json | 2 +- test/helpers/test-bot.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2598387..2c8fbfa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4716,7 +4716,7 @@ }, "node_modules/scuttle-testbot": { "version": "2.1.0", - "resolved": "git+ssh://git@github.com/ssbc/scuttle-testbot.git#4ce8fc01d8c11bca63c36ffb78d29a395d08a35b", + "resolved": "git+ssh://git@github.com/ssbc/scuttle-testbot.git#06a268a788e7b4e39672020c197309fd793eb15e", "dev": true, "license": "MIT", "dependencies": { diff --git a/test/helpers/test-bot.js b/test/helpers/test-bot.js index 07fbda9..0e27c02 100644 --- a/test/helpers/test-bot.js +++ b/test/helpers/test-bot.js @@ -34,7 +34,7 @@ module.exports = function TestBot (opts = {}) { ...opts.box2 }, // we don't want testbot to import db1 or db2 for us, we want to control what db2 plugins get imported - noUse: true, + noDefaultUse: true, ...opts }) From ffa84811a3abe8da3d3dca318eaab704d704f39d Mon Sep 17 00:00:00 2001 From: Jacob Karlsson Date: Thu, 2 Nov 2023 20:28:26 +0100 Subject: [PATCH 4/4] Fix replicate tests by using new fixed post compat --- package-lock.json | 8 ++++---- package.json | 2 +- test/helpers/test-bot.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4a9ed0b..4a98a9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "is-canonical-base64": "^1.1.1", "scuttle-testbot": "github:ssbc/scuttle-testbot#no-use", "ssb-box2": "^7.2.0", - "ssb-db2": "^7.1.1", + "ssb-db2": "github:ssbc/ssb-db2#fix-post-compat", "ssb-replicate": "^1.3.3", "standard": "^17.1.0", "tap-arc": "^0.4.0", @@ -5313,10 +5313,10 @@ } }, "node_modules/ssb-db2": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/ssb-db2/-/ssb-db2-7.1.1.tgz", - "integrity": "sha512-mRnqDY2XTTdgT0ILsWPcOWL2/WdAPlYwBEhXYm1vtnPeS2da8RcTSMIOzBAp/bAcnfJWMgUOgRNupQnbiLjMCg==", + "version": "7.2.0", + "resolved": "git+ssh://git@github.com/ssbc/ssb-db2.git#eda707a65a608f4ddef85e7ac32ca09f41503a49", "dev": true, + "license": "LGPL-3.0-only", "dependencies": { "async-append-only-log": "^4.3.7", "atomic-file-rw": "^0.3.0", diff --git a/package.json b/package.json index 3c3ee9d..357d2bd 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "is-canonical-base64": "^1.1.1", "scuttle-testbot": "github:ssbc/scuttle-testbot#no-use", "ssb-box2": "^7.2.0", - "ssb-db2": "^7.1.1", + "ssb-db2": "github:ssbc/ssb-db2#fix-post-compat", "ssb-replicate": "^1.3.3", "standard": "^17.1.0", "tap-arc": "^0.4.0", diff --git a/test/helpers/test-bot.js b/test/helpers/test-bot.js index 0e27c02..eec8f11 100644 --- a/test/helpers/test-bot.js +++ b/test/helpers/test-bot.js @@ -18,7 +18,7 @@ module.exports = function TestBot (opts = {}) { .use(require('ssb-classic')) .use(require('ssb-db2/compat')) .use(require('ssb-db2/compat/feedstate')) - // .use(require("ssb-db2/compat/publish")) + .use(require("ssb-db2/compat/post")) .use(require('ssb-box2')) .use(require('../..')) // ssb-tribes - NOTE load it after ssb-backlinks