Skip to content

Commit da0ac9c

Browse files
committed
chore: add modules for interface-blockstore and interface-datastore tests
1 parent 294b249 commit da0ac9c

File tree

23 files changed

+1654
-8
lines changed

23 files changed

+1654
-8
lines changed

.github/ISSUE_TEMPLATE/config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Getting Help on IPFS
4+
url: https://ipfs.io/help
5+
about: All information about how and where to get help on IPFS.
6+
- name: IPFS Official Forum
7+
url: https://discuss.ipfs.io
8+
about: Please post general questions, support requests, and discussions here.
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Open an issue
3+
about: Only for actionable issues relevant to this repository.
4+
title: ''
5+
labels: need/triage
6+
assignees: ''
7+
8+
---
9+
<!--
10+
Hello! To ensure this issue is correctly addressed as soon as possible by the IPFS team, please try to make sure:
11+
12+
- This issue is relevant to this repository's topic or codebase.
13+
14+
- A clear description is provided. It should includes as much relevant information as possible and clear scope for the issue to be actionable.
15+
16+
FOR GENERAL DISCUSSION, HELP OR QUESTIONS, please see the options at https://ipfs.io/help or head directly to https://discuss.ipfs.io.
17+
18+
(you can delete this section after reading)
19+
-->

.github/config.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Configuration for welcome - https://github.com/behaviorbot/welcome
2+
3+
# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
4+
# Comment to be posted to on first time issues
5+
newIssueWelcomeComment: >
6+
Thank you for submitting your first issue to this repository! A maintainer
7+
will be here shortly to triage and review.
8+
9+
In the meantime, please double-check that you have provided all the
10+
necessary information to make this process easy! Any information that can
11+
help save additional round trips is useful! We currently aim to give
12+
initial feedback within **two business days**. If this does not happen, feel
13+
free to leave a comment.
14+
15+
Please keep an eye on how this issue will be labeled, as labels give an
16+
overview of priorities, assignments and additional actions requested by the
17+
maintainers:
18+
19+
- "Priority" labels will show how urgent this is for the team.
20+
- "Status" labels will show if this is ready to be worked on, blocked, or in progress.
21+
- "Need" labels will indicate if additional input or analysis is required.
22+
23+
Finally, remember to use https://discuss.ipfs.io if you just need general
24+
support.
25+
26+
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
27+
# Comment to be posted to on PRs from first time contributors in your repository
28+
newPRWelcomeComment: >
29+
Thank you for submitting this PR!
30+
31+
A maintainer will be here shortly to review it.
32+
33+
We are super grateful, but we are also overloaded! Help us by making sure
34+
that:
35+
36+
* The context for this PR is clear, with relevant discussion, decisions
37+
and stakeholders linked/mentioned.
38+
39+
* Your contribution itself is clear (code comments, self-review for the
40+
rest) and in its best form. Follow the [code contribution
41+
guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md#code-contribution-guidelines)
42+
if they apply.
43+
44+
Getting other community members to do a review would be great help too on
45+
complex PRs (you can ask in the chats/forums). If you are unsure about
46+
something, just leave us a comment.
47+
48+
Next steps:
49+
50+
* A maintainer will triage and assign priority to this PR, commenting on
51+
any missing things and potentially assigning a reviewer for high
52+
priority items.
53+
54+
* The PR gets reviews, discussed and approvals as needed.
55+
56+
* The PR is merged by maintainers when it has been approved and comments addressed.
57+
58+
We currently aim to provide initial feedback/triaging within **two business
59+
days**. Please keep an eye on any labelling actions, as these will indicate
60+
priorities and status of your contribution.
61+
62+
We are very grateful for your contribution!
63+
64+
65+
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
66+
# Comment to be posted to on pull requests merged by a first time user
67+
# Currently disabled
68+
#firstPRMergeComment: ""

.github/dependabot.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 2
2+
updates:
3+
- directory: "/packages/interface-blockstore"
4+
package-ecosystem: npm
5+
schedule:
6+
interval: daily
7+
time: "11:00"
8+
9+
- directory: "/packages/interface-blockstore-tests"
10+
package-ecosystem: npm
11+
schedule:
12+
interval: daily
13+
time: "11:00"
14+
15+
- directory: "/packages/interface-datastore"
16+
package-ecosystem: npm
17+
schedule:
18+
interval: daily
19+
time: "11:00"
20+
21+
- directory: "/packages/interface-datastore-tests"
22+
package-ecosystem: npm
23+
schedule:
24+
interval: daily
25+
time: "11:00"
26+
27+
- directory: "/packages/interface-store"
28+
package-ecosystem: npm
29+
schedule:
30+
interval: daily
31+
time: "11:00"

.github/workflows/main.yml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: ci
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
10+
jobs:
11+
check:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
project:
16+
- packages/interface-blockstore
17+
- packages/interface-blockstore-tests
18+
- packages/interface-datastore
19+
- packages/interface-datastore-tests
20+
- packages/interface-store
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js 14.x
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: 14.x
27+
- name: Install dependencies
28+
run: npm install
29+
- name: Build types
30+
run: npm run build
31+
- name: Typecheck ${{ matrix.project }}
32+
uses: gozala/[email protected]
33+
with:
34+
project: ${{ matrix.project }}
35+
- run: npx aegir build
36+
- run: npx aegir dep-check
37+
- uses: ipfs/aegir/actions/bundle-size@master
38+
name: size
39+
with:
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
project: ${{ matrix.project }}
42+
test-node:
43+
strategy:
44+
matrix:
45+
node-version: [14.x, 16.x]
46+
os: [windows-latest, ubuntu-latest, macos-latest]
47+
project:
48+
- packages/interface-blockstore
49+
- packages/interface-blockstore-tests
50+
- packages/interface-datastore
51+
- packages/interface-datastore-tests
52+
- packages/interface-store
53+
needs: check
54+
runs-on: ${{ matrix.os }}
55+
strategy:
56+
matrix:
57+
os: [windows-latest, ubuntu-latest, macos-latest]
58+
node: ${{ matrix.node-version }}
59+
fail-fast: true
60+
steps:
61+
- uses: actions/checkout@v2
62+
- uses: actions/setup-node@v1
63+
with:
64+
node-version: ${{ matrix.node-version }}
65+
- run: npm install
66+
- run: npx aegir test -t node --cov --bail
67+
- uses: codecov/codecov-action@v1
68+
test-chrome:
69+
needs: check
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v2
73+
- run: npm install
74+
- run: npx aegir test -t browser -t webworker --bail
75+
test-firefox:
76+
needs: check
77+
runs-on: ubuntu-latest
78+
steps:
79+
- uses: actions/checkout@v2
80+
- run: npm install
81+
- run: npx aegir test -t browser -t webworker --bail -- --browser firefox
82+
test-electron-main:
83+
needs: check
84+
runs-on: ubuntu-latest
85+
steps:
86+
- uses: actions/checkout@v2
87+
- run: npm install
88+
- run: npx xvfb-maybe aegir test -t electron-main --bail
89+
test-electron-renderer:
90+
needs: check
91+
runs-on: ubuntu-latest
92+
steps:
93+
- uses: actions/checkout@v2
94+
- run: npm install
95+
- run: npx xvfb-maybe aegir test -t electron-renderer --bail

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dist
22
node_modules
33
package-lock.json
4+
docs

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"private": true,
77
"scripts": {
88
"reset": "rimraf ./node_modules ./package-lock.json packages/*/node_modules packages/*/package-lock.json packages/*/dist",
9-
"test": "echo \"Error: no test specified\" && exit 1",
9+
"test": "lerna run test",
1010
"build": "lerna run build",
1111
"lint": "lerna run lint",
1212
"release": "lerna run build && lerna publish"
@@ -22,7 +22,8 @@
2222
"packages/*"
2323
],
2424
"dependencies": {
25-
"lerna": "^4.0.0"
25+
"lerna": "^4.0.0",
26+
"rimraf": "^3.0.2"
2627
},
2728
"engines": {
2829
"npm": ">=7.0.0"

packages/interface-blockstore-tests/CHANGELOG.md

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
2+
3+
http://www.apache.org/licenses/LICENSE-2.0
4+
5+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
The MIT License (MIT)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# interface-blockstore-tests <!-- omit in toc -->
2+
3+
> A test suite for [interface-blockstore](https://github.com/ipfs/js-ipfs-interfaces/tree/master/packages/interface-blockstore) implementations
4+
5+
## Table of Contents <!-- omit in toc -->
6+
7+
- [Usage](#usage)
8+
- [Contribute](#contribute)
9+
- [License](#license)
10+
11+
## Usage
12+
13+
```js
14+
const MyBlockstore = require('./path/to/my-blockstore')
15+
const suite = require('interface-blockstore-tests')
16+
17+
describe('MyBlockstore', () => {
18+
describe('interface-blockstore compliance tests', () => {
19+
suite({
20+
setup () {
21+
return new MyBlockstore()
22+
},
23+
teardown () {}
24+
})
25+
})
26+
})
27+
```
28+
29+
## Contribute
30+
31+
PRs accepted.
32+
33+
Small note: If editing the Readme, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
34+
35+
## License
36+
37+
[Apache-2.0](LICENSE-APACHE) OR [MIT](LICENSE-MIT)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "interface-blockstore-tests",
3+
"version": "0.0.0",
4+
"description": "Compliance tests for the blockstore interface",
5+
"leadMaintainer": "Alex Potsides <[email protected]>",
6+
"main": "src/index.js",
7+
"types": "dist/src/index.d.ts",
8+
"files": [
9+
"src",
10+
"dist"
11+
],
12+
"scripts": {
13+
"build": "aegir build",
14+
"lint": "aegir ts -p check && aegir lint",
15+
"test": "echo \"No tests configured\""
16+
},
17+
"repository": {
18+
"type": "git",
19+
"url": "git+https://github.com/ipfs/interface-blockstore.git"
20+
},
21+
"keywords": [
22+
"interface",
23+
"key-value",
24+
"ipfs",
25+
"blockstore"
26+
],
27+
"license": "(Apache-2.0 OR MIT)",
28+
"bugs": {
29+
"url": "https://github.com/ipfs/interface-blockstore/issues"
30+
},
31+
"homepage": "https://github.com/ipfs/js-ipfs-interfaces/tree/master/packages/interface-blockstore-tests#readme",
32+
"dependencies": {
33+
"aegir": "^33.1.2",
34+
"interface-blockstore": "^0.1.0",
35+
"it-all": "^1.0.2",
36+
"it-drain": "^1.0.1",
37+
"it-length": "^1.0.2",
38+
"multiformats": "^9.1.0",
39+
"uint8arrays": "^2.1.5"
40+
},
41+
"eslintConfig": {
42+
"extends": "ipfs"
43+
}
44+
}

0 commit comments

Comments
 (0)