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

Commit f351dd5

Browse files
authored
chore: windows build fixes (#2793)
Stop things that were started and checkout things with the right line endings. Must move gateway fixtures to fixtures dir, or preferably generate data during the tests.
1 parent ceee358 commit f351dd5

File tree

25 files changed

+104
-58
lines changed

25 files changed

+104
-58
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
* text=auto
22
**/test/fixtures/** text eol=lf
3+
**/test/gateway/** text eol=lf
34
**/src/init-files/** text eol=lf
45

56
*.data binary

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ docs
2323

2424
# Deployment files
2525
.npmrc
26+
27+
# Editor files
28+
.vscode

packages/interface-ipfs-core/src/add.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ module.exports = (common, options) => {
458458
})
459459

460460
it('should add from a HTTP URL', async () => {
461-
const text = `TEST${Date.now()}`
461+
const text = `TEST${Math.random()}`
462462
const url = echoUrl(text)
463463

464464
const [result, expectedResult] = await Promise.all([
@@ -474,7 +474,7 @@ module.exports = (common, options) => {
474474
})
475475

476476
it('should add from a HTTP URL with redirection', async () => {
477-
const text = `TEST${Date.now()}`
477+
const text = `TEST${Math.random()}`
478478
const url = echoUrl(text) + '?foo=bar#buzz'
479479

480480
const [result, expectedResult] = await Promise.all([
@@ -490,7 +490,7 @@ module.exports = (common, options) => {
490490
})
491491

492492
it('should add from a URL with only-hash=true', async function () {
493-
const text = `TEST${Date.now()}`
493+
const text = `TEST${Math.random()}`
494494
const url = echoUrl(text)
495495

496496
const res = await all(ipfs.add(urlSource(url), { onlyHash: true }))

packages/interface-ipfs-core/src/block/get.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = (common, options) => {
5454
})
5555

5656
it('should get a block added as CIDv0 with a CIDv1', async () => {
57-
const input = Buffer.from(`TEST${Date.now()}`)
57+
const input = Buffer.from(`TEST${Math.random()}`)
5858

5959
const res = await ipfs.block.put(input, { version: 0 })
6060

@@ -68,7 +68,7 @@ module.exports = (common, options) => {
6868
})
6969

7070
it('should get a block added as CIDv1 with a CIDv0', async () => {
71-
const input = Buffer.from(`TEST${Date.now()}`)
71+
const input = Buffer.from(`TEST${Math.random()}`)
7272

7373
const res = await ipfs.block.put(input, { version: 1 })
7474

packages/interface-ipfs-core/src/block/put.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = (common, options) => {
5656
})
5757

5858
it('should put a buffer, using options', async () => {
59-
const blob = Buffer.from(`TEST${Date.now()}`)
59+
const blob = Buffer.from(`TEST${Math.random()}`)
6060

6161
const block = await ipfs.block.put(blob, {
6262
format: 'raw',

packages/interface-ipfs-core/src/cat.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module.exports = (common, options) => {
5050
})
5151

5252
it('should cat a file added as CIDv0 with a CIDv1', async () => {
53-
const input = Buffer.from(`TEST${Date.now()}`)
53+
const input = Buffer.from(`TEST${Math.random()}`)
5454

5555
const res = await all(ipfs.add(input, { cidVersion: 0 }))
5656

@@ -64,7 +64,7 @@ module.exports = (common, options) => {
6464
})
6565

6666
it('should cat a file added as CIDv1 with a CIDv0', async () => {
67-
const input = Buffer.from(`TEST${Date.now()}`)
67+
const input = Buffer.from(`TEST${Math.random()}`)
6868

6969
const res = await all(ipfs.add(input, { cidVersion: 1, rawLeaves: false }))
7070

packages/interface-ipfs-core/src/dag/get.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ module.exports = (common, options) => {
138138
})
139139

140140
it('should get a node added as CIDv0 with a CIDv1', async () => {
141-
const input = Buffer.from(`TEST${Date.now()}`)
141+
const input = Buffer.from(`TEST${Math.random()}`)
142142

143143
const node = new DAGNode(input)
144144

@@ -152,7 +152,7 @@ module.exports = (common, options) => {
152152
})
153153

154154
it('should get a node added as CIDv1 with a CIDv0', async () => {
155-
const input = Buffer.from(`TEST${Date.now()}`)
155+
const input = Buffer.from(`TEST${Math.random()}`)
156156

157157
const res = await all(ipfs.add(input, { cidVersion: 1, rawLeaves: false }))
158158

packages/interface-ipfs-core/src/dht/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const multihashing = require('multihashing-async')
44
const CID = require('cids')
55

66
exports.fakeCid = async (data) => {
7-
const bytes = data || Buffer.from(`TEST${Date.now()}`)
7+
const bytes = data || Buffer.from(`TEST${Math.random()}`)
88
const mh = await multihashing(bytes, 'sha2-256')
99
return new CID(0, 'dag-pb', mh)
1010
}

packages/interface-ipfs-core/src/get.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module.exports = (common, options) => {
4646
})
4747

4848
it('should get a file added as CIDv0 with a CIDv1', async () => {
49-
const input = Buffer.from(`TEST${Date.now()}`)
49+
const input = Buffer.from(`TEST${Math.random()}`)
5050

5151
const res = await all(ipfs.add(input, { cidVersion: 0 }))
5252

@@ -60,7 +60,7 @@ module.exports = (common, options) => {
6060
})
6161

6262
it('should get a file added as CIDv1 with a CIDv0', async () => {
63-
const input = Buffer.from(`TEST${Date.now()}`)
63+
const input = Buffer.from(`TEST${Math.random()}`)
6464

6565
const res = await all(ipfs.add(input, { cidVersion: 1, rawLeaves: false }))
6666

packages/ipfs-mfs/test/core/chmod.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ describe('chmod', () => {
1111
mfs = await createMfs()
1212
})
1313

14+
after(async () => {
15+
await mfs.repo.close()
16+
})
17+
1418
async function testChmod (initialMode, modification, expectedFinalMode) {
15-
const path = `/foo-${Date.now()}`
19+
const path = `/foo-${Math.random()}`
1620

1721
await mfs.write(path, Buffer.from('Hello world'), {
1822
create: true,
@@ -28,7 +32,7 @@ describe('chmod', () => {
2832
}
2933

3034
it('should update the mode for a file', async () => {
31-
const path = `/foo-${Date.now()}`
35+
const path = `/foo-${Math.random()}`
3236

3337
await mfs.write(path, Buffer.from('Hello world'), {
3438
create: true,
@@ -45,7 +49,7 @@ describe('chmod', () => {
4549
})
4650

4751
it('should update the mode for a directory', async () => {
48-
const path = `/foo-${Date.now()}`
52+
const path = `/foo-${Math.random()}`
4953

5054
await mfs.mkdir(path)
5155
const originalMode = (await mfs.stat(path)).mode
@@ -59,7 +63,7 @@ describe('chmod', () => {
5963
})
6064

6165
it('should update the mode for a hamt-sharded-directory', async () => {
62-
const path = `/foo-${Date.now()}`
66+
const path = `/foo-${Math.random()}`
6367

6468
await mfs.mkdir(path)
6569
await mfs.write(`${path}/foo.txt`, Buffer.from('Hello world'), {
@@ -160,7 +164,7 @@ describe('chmod', () => {
160164
})
161165

162166
it('should apply special execute permissions to world', async () => {
163-
const path = `/foo-${Date.now()}`
167+
const path = `/foo-${Math.random()}`
164168
const sub = `${path}/sub`
165169
const file = `${path}/sub/foo.txt`
166170
const bin = `${path}/sub/bar`
@@ -197,7 +201,7 @@ describe('chmod', () => {
197201
})
198202

199203
it('should apply special execute permissions to user', async () => {
200-
const path = `/foo-${Date.now()}`
204+
const path = `/foo-${Math.random()}`
201205
const sub = `${path}/sub`
202206
const file = `${path}/sub/foo.txt`
203207
const bin = `${path}/sub/bar`
@@ -234,7 +238,7 @@ describe('chmod', () => {
234238
})
235239

236240
it('should apply special execute permissions to user and group', async () => {
237-
const path = `/foo-${Date.now()}`
241+
const path = `/foo-${Math.random()}`
238242
const sub = `${path}/sub`
239243
const file = `${path}/sub/foo.txt`
240244
const bin = `${path}/sub/bar`
@@ -271,7 +275,7 @@ describe('chmod', () => {
271275
})
272276

273277
it('should apply special execute permissions to sharded directories', async () => {
274-
const path = `/foo-${Date.now()}`
278+
const path = `/foo-${Math.random()}`
275279
const sub = `${path}/sub`
276280
const file = `${path}/sub/foo.txt`
277281
const bin = `${path}/sub/bar`

0 commit comments

Comments
 (0)