Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
chore: run electron tests on linux
Browse files Browse the repository at this point in the history
Roughly halves the amount of time it takes to run electron tests.
  • Loading branch information
achingbrain committed Oct 6, 2020
1 parent 9db0452 commit 0c3cd39
Show file tree
Hide file tree
Showing 50 changed files with 49 additions and 57 deletions.
8 changes: 0 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,11 @@ jobs:

- stage: test
name: electron-main
os: osx
script:
- npm run test:electron-main -- $RUN_SINCE -- -- --bail --timeout 60000

- stage: test
name: electron-renderer
os: osx
script:
- npm run test:electron-renderer -- $RUN_SINCE -- -- --bail --timeout 60000

Expand All @@ -115,13 +113,11 @@ jobs:

- stage: test
name: interop - electron-main
os: osx
script:
- npm run test:interop -- $RUN_SINCE -- -- -- -t electron-main -f ./test/node.js --bail --timeout 60000

- stage: test
name: interop - electron-renderer
os: osx
script:
- npm run test:interop -- $RUN_SINCE -- -- -- -t electron-renderer -f ./test/browser.js -bail --timeout 60000

Expand Down Expand Up @@ -152,13 +148,11 @@ jobs:

- stage: test
name: js-ipfs interface tests - electron main
os: osx
script:
- npm run test:interface:core -- $RUN_SINCE -- -- --bail -t electron-main --timeout 60000

- stage: test
name: js-ipfs interface tests - electron renderer
os: osx
script:
- npm run test:interface:core -- $RUN_SINCE -- -- --bail -t electron-renderer --timeout 60000

Expand Down Expand Up @@ -214,13 +208,11 @@ jobs:

- stage: test
name: http-api-client interface tests vs js-ipfs - electron main
os: osx
script:
- npm run test:interface:http-js -- $RUN_SINCE -- -- --bail -t electron-main --timeout 60000

- stage: test
name: http-api-client interface tests vs js-ipfs - electron renderer
os: osx
script:
- npm run test:interface:http-js -- $RUN_SINCE -- -- --bail -t electron-renderer --timeout 60000

Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
],
"license": "MIT",
"dependencies": {
"abort-controller": "^3.0.0",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0",
Expand Down Expand Up @@ -59,6 +58,7 @@
"multibase": "^3.0.0",
"multihashing-async": "^2.0.1",
"nanoid": "^3.1.12",
"native-abort-controller": "^0.0.3",
"p-map": "^4.0.0",
"peer-id": "^0.14.1",
"readable-stream": "^3.4.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/bitswap/wantlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { getDescribe, getIt, expect } = require('../utils/mocha')
const { waitForWantlistKey, waitForWantlistKeyToBeRemoved } = require('./utils')
const { isWebWorker } = require('ipfs-utils/src/env')
const testTimeout = require('../utils/test-timeout')
const AbortController = require('abort-controller')
const AbortController = require('native-abort-controller')
const CID = require('cids')
const delay = require('delay')

Expand Down
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/pubsub/subscribe.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const all = require('it-all')
const { waitForPeers, getTopic } = require('./utils')
const { getDescribe, getIt, expect } = require('../utils/mocha')
const delay = require('delay')
const AbortController = require('abort-controller')
const AbortController = require('native-abort-controller')
const { isWebWorker, isNode } = require('ipfs-utils/src/env')

/** @typedef { import("ipfsd-ctl/src/factory") } Factory */
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"dep-check": "aegir dep-check"
},
"dependencies": {
"abort-controller": "^3.0.0",
"any-signal": "^2.0.0",
"array-shuffle": "^1.0.1",
"bignumber.js": "^9.0.0",
Expand Down Expand Up @@ -109,6 +108,7 @@
"multibase": "^3.0.0",
"multicodec": "^2.0.1",
"multihashing-async": "^2.0.1",
"native-abort-controller": "^0.0.3",
"p-defer": "^3.0.0",
"p-queue": "^6.6.1",
"parse-duration": "^0.4.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-core/src/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const toUri = require('multiaddr-to-uri')
const debug = require('debug')
const CID = require('cids')
const shuffle = require('array-shuffle')
const AbortController = require('abort-controller').default
const AbortController = require('native-abort-controller')
const preload = require('./runtime/preload-nodejs')

const log = Object.assign(
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"dep-check": "aegir dep-check"
},
"dependencies": {
"abort-controller": "^3.0.0",
"any-signal": "^2.0.0",
"bignumber.js": "^9.0.0",
"cids": "^1.0.0",
Expand All @@ -65,6 +64,7 @@
"multicodec": "^2.0.1",
"multihashes": "^3.0.1",
"nanoid": "^3.1.12",
"native-abort-controller": "^0.0.3",
"node-fetch": "^2.6.0",
"parse-duration": "^0.4.4",
"stream-to-it": "^0.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/src/add-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const configure = require('./lib/configure')
const multipartRequest = require('./lib/multipart-request')
const toUrlSearchParams = require('./lib/to-url-search-params')
const anySignal = require('any-signal')
const AbortController = require('abort-controller').default
const AbortController = require('native-abort-controller')

module.exports = configure((api) => {
// eslint-disable-next-line valid-jsdoc
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/src/block/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const multipartRequest = require('../lib/multipart-request')
const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
const anySignal = require('any-signal')
const AbortController = require('abort-controller').default
const AbortController = require('native-abort-controller')

module.exports = configure(api => {
// eslint-disable-next-line valid-jsdoc
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/src/config/replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const multipartRequest = require('../lib/multipart-request')
const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
const anySignal = require('any-signal')
const AbortController = require('abort-controller').default
const AbortController = require('native-abort-controller')

module.exports = configure(api => {
return async (config, options = {}) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/src/dag/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const configure = require('../lib/configure')
const multipartRequest = require('../lib/multipart-request')
const toUrlSearchParams = require('../lib/to-url-search-params')
const anySignal = require('any-signal')
const AbortController = require('abort-controller').default
const AbortController = require('native-abort-controller')
const multicodec = require('multicodec')

module.exports = configure((api, opts) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/src/files/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const configure = require('../lib/configure')
const multipartRequest = require('../lib/multipart-request')
const toUrlSearchParams = require('../lib/to-url-search-params')
const anySignal = require('any-signal')
const AbortController = require('abort-controller').default
const AbortController = require('native-abort-controller')

module.exports = configure(api => {
return async (path, input, options = {}) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/src/object/patch/append-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const multipartRequest = require('../../lib/multipart-request')
const configure = require('../../lib/configure')
const toUrlSearchParams = require('../../lib/to-url-search-params')
const anySignal = require('any-signal')
const AbortController = require('abort-controller').default
const AbortController = require('native-abort-controller')

module.exports = configure(api => {
return async (cid, data, options = {}) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/src/object/patch/set-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const multipartRequest = require('../../lib/multipart-request')
const configure = require('../../lib/configure')
const toUrlSearchParams = require('../../lib/to-url-search-params')
const anySignal = require('any-signal')
const AbortController = require('abort-controller').default
const AbortController = require('native-abort-controller')

module.exports = configure(api => {
return async (cid, data, options = {}) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/src/object/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const multipartRequest = require('../lib/multipart-request')
const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
const anySignal = require('any-signal')
const AbortController = require('abort-controller').default
const AbortController = require('native-abort-controller')
const unit8ArrayToString = require('uint8arrays/to-string')
const uint8ArrayFromString = require('uint8arrays/from-string')

Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-client/src/pubsub/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const configure = require('../lib/configure')
const toUrlSearchParams = require('../lib/to-url-search-params')
const multipartRequest = require('../lib/multipart-request')
const anySignal = require('any-signal')
const AbortController = require('abort-controller').default
const AbortController = require('native-abort-controller')

module.exports = configure(api => {
return async (topic, data, options = {}) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const AbortController = require('abort-controller').default
const AbortController = require('native-abort-controller')

class SubscriptionTracker {
constructor () {
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@hapi/boom": "^9.1.0",
"@hapi/content": "^5.0.2",
"@hapi/hapi": "^20.0.0",
"abort-controller": "^3.0.0",
"cids": "^1.0.0",
"debug": "^4.1.1",
"dlv": "^1.1.3",
Expand Down Expand Up @@ -63,6 +62,7 @@
"multibase": "^3.0.0",
"multicodec": "^2.0.1",
"multihashing-async": "^2.0.1",
"native-abort-controller": "^0.0.3",
"parse-duration": "^0.4.4",
"stream-to-it": "^0.2.2",
"streaming-iterables": "^5.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const debug = require('debug')
const multiaddr = require('multiaddr')
const toMultiaddr = require('uri-to-multiaddr')
const Boom = require('@hapi/boom')
const AbortController = require('abort-controller')
const AbortController = require('native-abort-controller')

const errorHandler = require('./error-handler')
const LOG = 'ipfs:http-api'
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/bitswap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const CID = require('cids')
const sinon = require('sinon')
const testHttpMethod = require('../utils/test-http-method')
const http = require('../utils/http')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

describe('/bitswap', () => {
const cid = new CID('QmUBdnXXPyoDFXj3Hj39dNJ5VkN3QFRskXxcGaYFBB8CNR')
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const testHttpMethod = require('../utils/test-http-method')
const http = require('../utils/http')
const sinon = require('sinon')
const CID = require('cids')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

const sendData = async (data) => {
const form = new FormData()
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const defaultList = [
const testHttpMethod = require('../utils/test-http-method')
const http = require('../utils/http')
const sinon = require('sinon')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

describe('/bootstrap', () => {
const validIp4 = '/ip4/101.236.176.52/tcp/4001/p2p/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z'
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const profiles = {
const testHttpMethod = require('../utils/test-http-method')
const http = require('../utils/http')
const sinon = require('sinon')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

const defaultOptions = {
signal: sinon.match.instanceOf(AbortSignal),
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/dag.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const CID = require('cids')
const testHttpMethod = require('../utils/test-http-method')
const http = require('../utils/http')
const sinon = require('sinon')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

const toHeadersAndPayload = async (thing) => {
const stream = new Readable()
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/dht.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const http = require('../utils/http')
const sinon = require('sinon')
const errCode = require('err-code')
const CID = require('cids')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')
const allNdjson = require('../utils/all-ndjson')

describe('/dht', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai')
const testHttpMethod = require('../utils/test-http-method')
const http = require('../utils/http')
const sinon = require('sinon')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

const defaultOptions = {
recursive: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const sinon = require('sinon')
const CID = require('cids')
const first = require('it-first')
const toBuffer = require('it-to-buffer')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

function matchIterable () {
return sinon.match((thing) => Boolean(thing[Symbol.asyncIterator]) || Boolean(thing[Symbol.iterator]))
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai')
const testHttpMethod = require('../utils/test-http-method')
const http = require('../utils/http')
const sinon = require('sinon')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

const defaultOptions = {
signal: sinon.match.instanceOf(AbortSignal),
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/key.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { expect } = require('aegir/utils/chai')
const testHttpMethod = require('../utils/test-http-method')
const http = require('../utils/http')
const sinon = require('sinon')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

describe('/key', function () {
let ipfs
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/mfs/chmod.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai')
const http = require('../../utils/http')
const sinon = require('sinon')
const testHttpMethod = require('../../utils/test-http-method')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

const defaultOptions = {
recursive: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/mfs/cp.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai')
const http = require('../../utils/http')
const sinon = require('sinon')
const testHttpMethod = require('../../utils/test-http-method')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

const defaultOptions = {
cidVersion: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/mfs/flush.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const sinon = require('sinon')
const CID = require('cids')
const cid = new CID('QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn')
const testHttpMethod = require('../../utils/test-http-method')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

const defaultOptions = {
timeout: undefined,
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/mfs/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const sinon = require('sinon')
const CID = require('cids')
const fileCid = new CID('bafybeigyov3nzxrqjismjpq7ghkkjorcmozy5rgaikvyieakoqpxfc3rvu')
const testHttpMethod = require('../../utils/test-http-method')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

const defaultOptions = {
timeout: undefined,
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/mfs/mkdir.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai')
const http = require('../../utils/http')
const sinon = require('sinon')
const testHttpMethod = require('../../utils/test-http-method')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

const defaultOptions = {
parents: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/mfs/mv.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { expect } = require('aegir/utils/chai')
const http = require('../../utils/http')
const sinon = require('sinon')
const testHttpMethod = require('../../utils/test-http-method')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

const defaultOptions = {
parents: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/ipfs-http-server/test/inject/mfs/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const http = require('../../utils/http')
const uint8ArrayFromString = require('uint8arrays/from-string')
const sinon = require('sinon')
const testHttpMethod = require('../../utils/test-http-method')
const { AbortSignal } = require('abort-controller')
const { AbortSignal } = require('native-abort-controller')

const defaultOptions = {
offset: undefined,
Expand Down
Loading

0 comments on commit 0c3cd39

Please sign in to comment.