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

Commit bd6b83f

Browse files
achingbrainAlan Shaw
authored andcommitted
test: run examples/externals on PRs too (#2559)
We run automated tests of IPFS examples & external repos on our release branches, but there's no good reason not to run them on every PR instead to give people early warning of breakages. This PR changes the `.travis.yml` file to run all tests on every submitted PR.
1 parent 53c2144 commit bd6b83f

File tree

19 files changed

+50
-56
lines changed

19 files changed

+50
-56
lines changed

.travis.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -104,191 +104,165 @@ jobs:
104104
- IPFS_JS_EXEC=./../../src/cli/bin.js IPFS_REUSEPORT=false npx aegir test -t electron-renderer -f ./test/browser.js --bail --timeout 10000
105105

106106
- stage: test
107-
if: branch =~ /^release\/.*$/
108107
name: external - ipfs-companion
109108
script:
110109
- npm run test:external -- ipfs-companion https://github.com/ipfs-shipyard/ipfs-companion.git
111110

112111
- stage: test
113-
if: branch =~ /^release\/.*$/
114112
name: external - npm-on-ipfs
115113
script:
116114
- npm run test:external -- npm-on-ipfs https://github.com/ipfs-shipyard/npm-on-ipfs.git
117115

118116
- stage: test
119-
if: branch =~ /^release\/.*$/
120117
name: external - ipfs-pubsub-room
121118
script:
122119
- npm run test:external -- ipfs-pubsub-room https://github.com/ipfs-shipyard/ipfs-pubsub-room.git --branch upgrade-to-latest-js-ipfs-rc
123120

124121
- stage: test
125-
if: branch =~ /^release\/.*$/
126122
name: external - peer-base
127123
script:
128124
- npm run test:external -- peer-base https://github.com/achingbrain/peer-base.git --branch upgrade-to-latest-ipfs-rc
129125

130126
- stage: test
131-
if: branch =~ /^release\/.*$/
132127
name: external - service-worker-gateway
133128
script:
134129
- npm run test:external -- service-worker-gateway https://github.com/ipfs-shipyard/service-worker-gateway.git
135130

136131
- stage: test
137-
if: branch =~ /^release\/.*$/
138132
name: external - orbit-db
139133
script:
140134
- npm run test:external -- orbit-db https://github.com/orbitdb/orbit-db.git
141135

142136
- stage: test
143-
if: branch =~ /^release\/.*$/
144137
name: external - ipfs-log
145138
script:
146139
- npm run test:external -- ipfs-log https://github.com/orbitdb/ipfs-log.git
147140

148141
- stage: test
149-
if: branch =~ /^release\/.*$/
150142
name: external - sidetree
151143
script:
152144
- npm run test:external -- sidetree https://github.com/decentralized-identity/sidetree.git
153145

154146
- stage: test
155-
if: branch =~ /^release\/.*$/
156147
name: example - browser-add-readable-stream
157148
script:
158149
- cd examples
159150
- npm install
160151
- npm run test -- browser-add-readable-stream
161152

162153
- stage: test
163-
if: branch =~ /^release\/.*$/
164154
name: example - browser-browserify
165155
script:
166156
- cd examples
167157
- npm install
168158
- npm run test -- browser-browserify
169159

170160
- stage: test
171-
if: branch =~ /^release\/.*$/
172161
name: example - browser-create-react-app
173162
script:
174163
- cd examples
175164
- npm install
176165
- npm run test -- browser-create-react-app
177166

178167
- stage: test
179-
if: branch =~ /^release\/.*$/
180168
name: example - browser-mfs
181169
script:
182170
- cd examples
183171
- npm install
184172
- npm run test -- browser-mfs
185173

186174
- stage: test
187-
if: branch =~ /^release\/.*$/
188175
name: example - browser-parceljs
189176
script:
190177
- cd examples
191178
- npm install
192179
- npm run test -- browser-parceljs
193180

194181
- stage: test
195-
if: branch =~ /^release\/.*$/
196182
name: example - browser-readablestream
197183
script:
198184
- cd examples
199185
- npm install
200186
- npm run test -- browser-readablestream
201187

202188
- stage: test
203-
if: branch =~ /^release\/.*$/
204189
name: example - browser-script-tag
205190
script:
206191
- cd examples
207192
- npm install
208193
- npm run test -- browser-script-tag
209194

210195
- stage: test
211-
if: branch =~ /^release\/.*$/
212196
name: example - browser-video-streaming
213197
script:
214198
- cd examples
215199
- npm install
216200
- npm run test -- browser-video-streaming
217201

218202
- stage: test
219-
if: branch =~ /^release\/.*$/
220203
name: example - browser-vue
221204
script:
222205
- cd examples
223206
- npm install
224207
- npm run test -- browser-vue
225208

226209
- stage: test
227-
if: branch =~ /^release\/.*$/
228210
name: example - browser-webpack
229211
script:
230212
- cd examples
231213
- npm install
232214
- npm run test -- browser-webpack
233215

234216
- stage: test
235-
if: branch =~ /^release\/.*$/
236217
name: example - circuit-relaying
237218
script:
238219
- cd examples
239220
- npm install
240221
- npm run test -- circuit-relaying
241222

242223
- stage: test
243-
if: branch =~ /^release\/.*$/
244224
name: example - custom-ipfs-repo
245225
script:
246226
- cd examples
247227
- npm install
248228
- npm run test -- custom-ipfs-repo
249229

250230
- stage: test
251-
if: branch =~ /^release\/.*$/
252231
name: example - custom-libp2p
253232
script:
254233
- cd examples
255234
- npm install
256235
- npm run test -- custom-libp2p
257236

258237
- stage: test
259-
if: branch =~ /^release\/.*$/
260238
name: example - exchange-files-in-browser
261239
script:
262240
- cd examples
263241
- npm install
264242
- npm run test -- exchange-files-in-browser
265243

266244
- stage: test
267-
if: branch =~ /^release\/.*$/
268245
name: example - explore-ethereum-blockchain
269246
script:
270247
- cd examples
271248
- npm install
272249
- npm run test -- explore-ethereum-blockchain
273250

274251
- stage: test
275-
if: branch =~ /^release\/.*$/
276252
name: example - ipfs-101
277253
script:
278254
- cd examples
279255
- npm install
280256
- npm run test -- ipfs-101
281257

282258
- stage: test
283-
if: branch =~ /^release\/.*$/
284259
name: example - running-multiple-nodes
285260
script:
286261
- cd examples
287262
- npm install
288263
- npm run test -- running-multiple-nodes
289264

290265
- stage: test
291-
if: branch =~ /^release\/.*$/
292266
name: example - traverse-ipld-graphs
293267
script:
294268
- cd examples

examples/browser-browserify/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"devDependencies": {
1414
"browserify": "^16.2.3",
1515
"concat-stream": "^2.0.0",
16+
"execa": "^3.2.0",
1617
"http-server": "~0.11.1",
1718
"ipfs": "file:../../"
1819
},

examples/circuit-relaying/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
},
2020
"devDependencies": {
2121
"aegir": "^20.0.0",
22+
"execa": "^3.2.0",
2223
"ipfs-css": "^0.13.1",
2324
"parcel-bundler": "^1.6.2",
2425
"tachyons": "^4.9.1"

examples/circuit-relaying/test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const {
1717
const pkg = require('./package.json')
1818

1919
async function testUI (url, relay, localPeerIdFile, remotePeerIdFile) {
20-
const proc = execa('nightwatch', [ path.join(__dirname, 'test.js') ], {
20+
const proc = execa('nightwatch', [path.join(__dirname, 'test.js')], {
2121
cwd: path.resolve(__dirname, '../'),
2222
env: {
2323
...process.env,
@@ -26,7 +26,8 @@ async function testUI (url, relay, localPeerIdFile, remotePeerIdFile) {
2626
IPFS_RELAY_ADDRESS: relay,
2727
IPFS_LOCAL_PEER_ID_FILE: localPeerIdFile,
2828
IPFS_REMOTE_PEER_ID_FILE: remotePeerIdFile
29-
}
29+
},
30+
all: true
3031
})
3132
proc.all.on('data', (data) => {
3233
process.stdout.write(data)
@@ -41,7 +42,7 @@ async function runTest () {
4142
config: {
4243
Addresses: {
4344
Swarm: [
44-
`/ip4/127.0.0.1/tcp/0/ws`
45+
'/ip4/127.0.0.1/tcp/0/ws'
4546
]
4647
},
4748
Bootstrap: [],

examples/custom-ipfs-repo/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use strict'
22

3-
const log = require('why-is-node-running')
4-
53
const IPFS = require('ipfs')
64
const Repo = require('ipfs-repo')
75
const fsLock = require('ipfs-repo/src/lock')

examples/custom-ipfs-repo/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@
1212
"datastore-fs": "^0.9.1",
1313
"ipfs": "file:../../",
1414
"ipfs-repo": "^0.28.0"
15+
},
16+
"devDependencies": {
17+
"execa": "^3.2.0"
1518
}
1619
}

examples/custom-ipfs-repo/test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ const execa = require('execa')
55
const fs = require('fs')
66

77
async function test () {
8-
const proc = execa('node', [ path.join(__dirname, 'index.js') ], {
9-
cwd: path.resolve(__dirname)
8+
const proc = execa('node', [path.join(__dirname, 'index.js')], {
9+
cwd: path.resolve(__dirname),
10+
all: true
1011
})
1112
proc.all.on('data', (data) => {
1213
process.stdout.write(data)

examples/custom-libp2p/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@
1919
"libp2p-tcp": "~0.13.0",
2020
"libp2p-websocket-star": "~0.10.2",
2121
"pull-mplex": "~0.1.0"
22+
},
23+
"devDependencies": {
24+
"execa": "^3.2.0"
2225
}
2326
}

examples/custom-libp2p/test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ const PeerBook = require('peer-book')
1616
async function test () {
1717
let output = ''
1818

19-
const proc = execa('node', [ path.join(__dirname, 'index.js') ], {
20-
cwd: path.resolve(__dirname)
19+
const proc = execa('node', [path.join(__dirname, 'index.js')], {
20+
cwd: path.resolve(__dirname),
21+
all: true
2122
})
2223
proc.all.on('data', async (data) => {
2324
process.stdout.write(data)

examples/exchange-files-in-browser/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"license": "MIT",
1010
"devDependencies": {
1111
"browserify": "^16.2.3",
12+
"execa": "^3.2.0",
1213
"http-server": "~0.11.1"
1314
},
1415
"dependencies": {

0 commit comments

Comments
 (0)