Skip to content

Commit

Permalink
disable unbox vector tests in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mixmix committed Sep 13, 2023
1 parent ce18c44 commit f078721
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 43 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 16.x, 18.x]
node-version: [12, 16, 18]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Expand All @@ -34,13 +34,13 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [16, 18]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Expand All @@ -50,13 +50,13 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [16, 18]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Expand Down
31 changes: 15 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,22 @@ function init (ssb, config) {
const processedNewAuthors = {}

function processAuthors (groupId, authors, adder, cb) {
if (processedNewAuthors[groupId] === undefined) processedNewAuthors[groupId] = new Set([])

const newAuthors = new Set(authors.filter(author => !processedNewAuthors[groupId].has(author)))

processedNewAuthors[groupId] = new Set([...processedNewAuthors[groupId], ...newAuthors])

if ([...newAuthors].length) {
state.newAuthorListeners.forEach(fn => fn({ groupId, newAuthors: [...newAuthors] }))

// we don't rebuild if we're the person who added them
if (adder !== ssb.id) {
const reason = ['add-member', ...newAuthors].join()

rebuildManager.rebuild(reason)
}
if (processedNewAuthors[groupId] === undefined) processedNewAuthors[groupId] = new Set()

const newAuthors = authors.reduce((acc, author) => {
if (!processedNewAuthors[groupId].has(author)) acc.add(author)
return acc
}, new Set())
if (!newAuthors.size) return cb()

state.newAuthorListeners.forEach(fn => fn({ groupId, newAuthors: [...newAuthors] }))
// we don't rebuild if we're the person who added them
if (adder !== ssb.id) {
const reason = ['add-member', ...newAuthors].join('+')
rebuildManager.rebuild(reason)
}
return cb()
newAuthors.forEach(author => processedNewAuthors[groupId].add(author))
cb()
}

pull(
Expand Down
26 changes: 13 additions & 13 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"main": "index.js",
"scripts": {
"test": "npm run test:js && npm run test:only && npm run lint",
"test:js": "NODE_ENV=test tape 'test/**/*.test.js' | tap-arc --bail",
"test:js": "NODE_ENV=test tape 'test/**/*.test.js' | tap-arc",
"test:only": "if grep -r --exclude-dir=node_modules --exclude-dir=.git --color 'test\\.only' ; then exit 1; fi",
"lint": "standard --fix",
"test:windows": "cross-env NODE_ENV=test tape test/**/*.test.js | tap-arc --bail",
"test:windows": "cross-env NODE_ENV=test tape test/**/*.test.js | tap-arc",
"generate": "rm test/generate/*/* && node test/generate/index.js"
},
"homepage": "https://github.com/ssbc/ssb-tribes#readme",
Expand Down Expand Up @@ -52,7 +52,7 @@
"ssb-query": "^2.4.5",
"ssb-replicate": "^1.3.3",
"standard": "^17.1.0",
"tap-arc": "^0.3.5",
"tap-arc": "^0.4.0",
"tape": "^4.16.2"
},
"keywords": [
Expand Down
5 changes: 3 additions & 2 deletions test/unbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
const test = require('tape')
const pull = require('pull-stream')
const { promisify: p } = require('util')
const { decodeLeaves, Server, Run } = require('./helpers')
const os = require('os')

const envelope = require('../envelope')
const { decodeLeaves, Server, Run } = require('./helpers')

const vectors = [
require('private-group-spec/vectors/unbox1.json'),
Expand Down Expand Up @@ -71,7 +72,7 @@ test('unbox', async t => {
t.end()
})

test('unbox - test vectors', async t => {
test('unbox - test vectors', { skip: os.platform() === 'win32' }, async t => {
console.log('vectors:', vectors.length)

vectors.forEach(vector => {
Expand Down

0 comments on commit f078721

Please sign in to comment.