Skip to content

Commit

Permalink
Merge pull request #105 from ssbc/no-use-testbot
Browse files Browse the repository at this point in the history
Don't import db1
  • Loading branch information
Powersource authored Nov 7, 2023
2 parents 71cd7e0 + bfbe6bf commit 6542a76
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 25 deletions.
114 changes: 104 additions & 10 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"devDependencies": {
"cross-env": "^7.0.3",
"is-canonical-base64": "^1.1.1",
"scuttle-testbot": "^2.1.0",
"scuttle-testbot": "^2.2.0",
"ssb-box2": "^7.4.0",
"ssb-db2": "^7.1.1",
"ssb-db2": "^8.0.0",
"ssb-replicate": "^1.3.3",
"standard": "^17.1.0",
"tap-arc": "^0.4.0",
Expand Down
6 changes: 3 additions & 3 deletions test/helpers/test-bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
noDefaultUse: true,
...opts
})

Expand Down
12 changes: 2 additions & 10 deletions test/rebuild.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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),
Expand All @@ -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)
}
})
)
Expand Down

0 comments on commit 6542a76

Please sign in to comment.