-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: finish porting and cleaning all simple tests #92
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
7e98237
t0109: clear
laurentsenta 20d7295
t0112: clear
laurentsenta 278dde0
t0113: clear
laurentsenta fa4ddce
t0114: clear (a)
laurentsenta 74eca4e
t0114: clear (b)
laurentsenta dd048bd
t0114: clear (c)
laurentsenta 0893f3f
t0114: clear (d)
laurentsenta cbf2bd2
t0115: clear
laurentsenta bfaca86
t0122: clear
laurentsenta 8621a52
t0123: clear (a)
laurentsenta d4e294c
t0123: clear (b)
laurentsenta ada783a
t0117: clear
laurentsenta 846a38e
refactor: move test fixture in _fixtures
laurentsenta 20ae610
t0124: clear (a)
laurentsenta 228fee7
t0124: clear (b)
laurentsenta 0ab59b1
t0114: clear (e)
laurentsenta ad08a29
t0112: clear (b)
laurentsenta 496bf97
t0112: update
laurentsenta afb8704
fixes: doc
laurentsenta 49a9354
fix: rename fixture
laurentsenta fc12109
fix: readme
laurentsenta a886c55
fix: split back the cors
laurentsenta 7a2a26d
fix: t0123 headers
laurentsenta 439156e
CHANGELOG
laurentsenta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,22 @@ | ||
# ipfs add --recursive --raw-leaves --cid-version=1 --wrap-with-directory fixtures/dir | ||
# Fixtures | ||
|
||
added bafkreibyniihaqnhs536mbvc3wx66vbfttisc6zrvea6kzeku3w4as6lum dir/ascii.txt | ||
added bafybeiaxmpwa4nz2mekiiosayvkfgfpbubm7pch7tspx5syhzzsvkoewc4 dir | ||
added bafybeie7u7bbgvdqbur6inl6fpl4yw3xcg34bjjmnnzkmpwb5v6x3xz3hy | ||
This folder contains all the fixtures using during the tests, with | ||
the recipes to re-create them. | ||
|
||
# ipfs dag export bafybeie7u7bbgvdqbur6inl6fpl4yw3xcg34bjjmnnzkmpwb5v6x3xz3hy > fixtures/dir.car | ||
## Recipes | ||
|
||
# go install github.com/ipld/go-car/cmd/car@latest | ||
### [gateway-raw-block.car](./gateway-raw-block.car) | ||
|
||
# car list fixtures/dir.car | ||
Generated with: | ||
|
||
bafybeie7u7bbgvdqbur6inl6fpl4yw3xcg34bjjmnnzkmpwb5v6x3xz3hy | ||
bafybeiaxmpwa4nz2mekiiosayvkfgfpbubm7pch7tspx5syhzzsvkoewc4 | ||
bafkreibyniihaqnhs536mbvc3wx66vbfttisc6zrvea6kzeku3w4as6lum | ||
```sh | ||
# using Kubo CLI version 0.18.1 (https://dist.ipfs.tech/kubo/v0.18.1/) | ||
mkdir -p dir && | ||
echo "hello application/vnd.ipld.raw" > dir/ascii.txt && | ||
ROOT_DIR_CID=$(ipfs add -Qrw --cid-version 1 dir) && | ||
FILE_CID=$(ipfs resolve -r /ipfs/$ROOT_DIR_CID/dir/ascii.txt | cut -d "/" -f3) && | ||
ipfs dag export $ROOT_DIR_CID > gateway-raw-block.car | ||
|
||
# car extract --file fixtures/dir.car --verbose | ||
|
||
.../gateway-conformance/dir | ||
.../gateway-conformance/dir/ascii.txt | ||
|
||
# go run extract.go fixtures/dir.car | ||
|
||
path: / | ||
cid: bafybeie7u7bbgvdqbur6inl6fpl4yw3xcg34bjjmnnzkmpwb5v6x3xz3hy | ||
raw: [18 45 10 36 1 112 18 32 23 99 236 14 55 58 97 20 132 58 64 197 84 83 21 225 160 89 247 136 255 156 159 126 203 7 206 101 85 56 150 23 18 3 100 105 114 24 90 10 2 8 1] | ||
path: /dir | ||
cid: bafybeiaxmpwa4nz2mekiiosayvkfgfpbubm7pch7tspx5syhzzsvkoewc4 | ||
raw: [18 51 10 36 1 85 18 32 56 106 16 112 65 167 151 119 230 6 162 221 175 239 84 37 156 209 33 123 49 169 1 229 100 138 166 237 192 75 203 163 18 9 97 115 99 105 105 46 116 120 116 24 33 10 2 8 1] | ||
path: /dir/ascii.txt | ||
cid: bafkreibyniihaqnhs536mbvc3wx66vbfttisc6zrvea6kzeku3w4as6lum | ||
raw: [103 111 111 100 98 121 101 32 97 112 112 108 105 99 97 116 105 111 110 47 118 110 100 46 105 112 108 100 46 114 97 119 10] | ||
str: goodbye application/vnd.ipld.raw | ||
echo ROOT_DIR_CID=${ROOT_DIR_CID} # ./ | ||
echo FILE_CID=${FILE_CID} # ./dir/ascii.txt | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# IPNS Records Fixtures | ||
|
||
## Recipes | ||
|
||
### Fixtures and ipns-record | ||
|
||
```sh | ||
# using Kubo CLI version 0.21.0-rc3 (https://dist.ipfs.tech/kubo/v0.21.0-rc3/) | ||
FILE_CID=$(echo "Hello IPFS" | ipfs add --cid-version 1 -q) | ||
IPNS_KEY=$(ipfs key gen ipns-record) | ||
|
||
ipfs dag export ${FILE_CID} > fixtures.car | ||
|
||
# publish a record valid for a 100 years | ||
ipfs name publish --key=ipns-record --quieter --ttl=876600h --lifetime=876600h /ipfs/${FILE_CID} | ||
ipfs routing get /ipns/${IPNS_KEY} > ${IPNS_KEY}.ipns-record | ||
|
||
echo IPNS_KEY=${IPNS_KEY} | ||
echo FILE_CID=${FILE_CID} # A file containing "Hello IPFS" | ||
|
||
# IPNS_KEY=k51qzi5uqu5dh71qgwangrt6r0nd4094i88nsady6qgd1dhjcyfsaqmpp143ab | ||
# FILE_CID=bafkreidfdrlkeq4m4xnxuyx6iae76fdm4wgl5d4xzsb77ixhyqwumhz244 # A file containing Hello IPFS | ||
``` |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Path Gateway Dag Fixtures | ||
|
||
## Recipes | ||
|
||
### Legacy fixtures from Kubo | ||
|
||
- dag-cbor-traversal.car | ||
- dag-json-traversal.car | ||
- dag-pb.car | ||
- dag-pb.json | ||
|
||
### [gateway-json-cbor.car](./gateway-json-cbor.car) and ipns-records | ||
|
||
Generated with: | ||
|
||
```sh | ||
# using Kubo CLI version 0.21.0-rc3 (https://dist.ipfs.tech/kubo/v0.21.0-rc3/) | ||
|
||
mkdir -p rootDir/ipfs && | ||
mkdir -p rootDir/ipns && | ||
mkdir -p rootDir/api && | ||
mkdir -p rootDir/ą/ę && | ||
echo "{ \"test\": \"i am a plain json file\" }" > rootDir/ą/ę/t.json && | ||
echo "I am a txt file on path with utf8" > rootDir/ą/ę/file-źł.txt && | ||
echo "I am a txt file in confusing /api dir" > rootDir/api/file.txt && | ||
echo "I am a txt file in confusing /ipfs dir" > rootDir/ipfs/file.txt && | ||
echo "I am a txt file in confusing /ipns dir" > rootDir/ipns/file.txt && | ||
DIR_CID=$(ipfs add -Qr --cid-version 1 rootDir) && | ||
FILE_JSON_CID=$(ipfs files stat --enc=json /ipfs/$DIR_CID/ą/ę/t.json | jq -r .Hash) && | ||
FILE_CID=$(ipfs files stat --enc=json /ipfs/$DIR_CID/ą/ę/file-źł.txt | jq -r .Hash) && | ||
FILE_SIZE=$(ipfs files stat --enc=json /ipfs/$DIR_CID/ą/ę/file-źł.txt | jq -r .Size) | ||
echo "$FILE_CID / $FILE_SIZE" | ||
|
||
echo DIR_CID=${DIR_CID} # ./rootDir | ||
echo FILE_JSON_CID=${FILE_JSON_CID} # ./rootDir/ą/ę/t.json | ||
echo FILE_CID=${FILE_CID} # ./rootDir/ą/ę/file-źł.txt | ||
echo FILE_SIZE=${FILE_SIZE} | ||
|
||
ipfs dag export ${DIR_CID} > gateway-json-cbor.car | ||
|
||
DAG_CBOR_TRAVERSAL_CID="bafyreibs4utpgbn7uqegmd2goqz4bkyflre2ek2iwv743fhvylwi4zeeim" | ||
DAG_JSON_TRAVERSAL_CID="baguqeeram5ujjqrwheyaty3w5gdsmoz6vittchvhk723jjqxk7hakxkd47xq" | ||
DAG_PB_CID="bafybeiegxwlgmoh2cny7qlolykdf7aq7g6dlommarldrbm7c4hbckhfcke" | ||
|
||
test_native_dag() { | ||
NAME=$1 | ||
CID=$2 | ||
|
||
IPNS_ID=$(ipfs key gen --ipns-base=base36 --type=ed25519 ${NAME}_test_key | head -n1 | tr -d "\n") | ||
ipfs name publish --key ${NAME}_test_key --allow-offline --ttl=876600h --lifetime=876600h -Q "/ipfs/${CID}" > name_publish_out | ||
|
||
ipfs routing get /ipns/${IPNS_ID} > ${IPNS_ID}.ipns-record | ||
|
||
echo "IPNS_ID_${NAME}=${IPNS_ID}" | ||
} | ||
|
||
test_native_dag "DAG_JSON" "$DAG_JSON_TRAVERSAL_CID" | ||
test_native_dag "DAG_CBOR" "$DAG_CBOR_TRAVERSAL_CID" | ||
|
||
# DIR_CID=bafybeiafyvqlazbbbtjnn6how5d6h6l6rxbqc4qgpbmteaiskjrffmyy4a # ./rootDir | ||
# FILE_JSON_CID=bafkreibrppizs3g7axs2jdlnjua6vgpmltv7k72l7v7sa6mmht6mne3qqe # ./rootDir/ą/ę/t.json | ||
# FILE_CID=bafkreialihlqnf5uwo4byh4n3cmwlntwqzxxs2fg5vanqdi3d7tb2l5xkm # ./rootDir/ą/ę/file-źł.txt | ||
# FILE_SIZE=34 | ||
# IPNS_ID_DAG_JSON=k51qzi5uqu5dhjghbwdvbo6mi40htrq6e2z4pwgp15pgv3ho1azvidttzh8yy2 | ||
# IPNS_ID_DAG_CBOR=k51qzi5uqu5dghjous0agrwavl8vzl64xckoqzwqeqwudfr74kfd11zcyk3b7l | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Path Gateway Tar Fixtures | ||
|
||
## Recipes | ||
|
||
### [inside-roots.car](./inside-root.car) and [outside-roots.car](./outside-root.car) | ||
|
||
Legacy fixtures from Kubo Sharness. | ||
|
||
See the [PR](https://github.com/ipfs/kubo/pull/9029) that introduced them for more details | ||
|
||
### [fixtures.car](./fixtures.car) | ||
|
||
Generated with: | ||
|
||
```sh | ||
# Kubo CLI version 0.18.1 (https://dist.ipfs.tech/kubo/v0.18.1/) | ||
|
||
mkdir -p rootDir/ipfs && | ||
mkdir -p rootDir/ipns && | ||
mkdir -p rootDir/api && | ||
mkdir -p rootDir/ą/ę && | ||
echo "I am a txt file on path with utf8" > rootDir/ą/ę/file-źł.txt && | ||
echo "I am a txt file in confusing /api dir" > rootDir/api/file.txt && | ||
echo "I am a txt file in confusing /ipfs dir" > rootDir/ipfs/file.txt && | ||
echo "I am a txt file in confusing /ipns dir" > rootDir/ipns/file.txt && | ||
DIR_CID=$(ipfs add -Qr --cid-version 1 rootDir) && | ||
FILE_CID=$(ipfs files stat --enc=json /ipfs/$DIR_CID/ą/ę/file-źł.txt | jq -r .Hash) && | ||
FILE_SIZE=$(ipfs files stat --enc=json /ipfs/$DIR_CID/ą/ę/file-źł.txt | jq -r .Size) | ||
echo "$FILE_CID / $FILE_SIZE" | ||
|
||
echo DIR_CID=${DIR_CID} # ./rootDir | ||
echo FILE_CID=${FILE_CID} # ./rootDir/ą/ę/file-źł.txt | ||
echo FILE_SIZE=${FILE_SIZE} | ||
|
||
ipfs dag export ${DIR_CID} > ./fixtures.car | ||
|
||
# DIR_CID=bafybeig6ka5mlwkl4subqhaiatalkcleo4jgnr3hqwvpmsqfca27cijp3i # ./rootDir | ||
# FILE_CID=bafkreialihlqnf5uwo4byh4n3cmwlntwqzxxs2fg5vanqdi3d7tb2l5xkm # ./rootDir/ą/ę/file-źł.txt | ||
# FILE_SIZE=34 | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Path Gateway Fixtures | ||
|
||
## Recipes | ||
|
||
### [symlink.car](./symlink.car) | ||
|
||
```sh | ||
# using Kubo CLI version 0.18.1 (https://dist.ipfs.tech/kubo/v0.18.1/ | ||
mkdir testfiles && | ||
echo "content" > testfiles/foo && | ||
ln -s foo testfiles/bar && | ||
ROOT_DIR_CID=$(ipfs add -Qr testfiles) && | ||
ipfs dag export $ROOT_DIR_CID > symlink.car | ||
``` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Fixture for Redirects File Testing | ||
|
||
## Recipes | ||
|
||
### [dnslink.yml](./dnslink.yml) | ||
|
||
See comments in the yml file. | ||
|
||
|
||
### [redirects.car](./redirects.car) | ||
|
||
Fixtures based on [specs.ipfs.tech/http-gateways/web-redirects-file/#test-fixtures](https://specs.ipfs.tech/http-gateways/web-redirects-file/#test-fixtures) and [IPIP-0002](https://specs.ipfs.tech/ipips/ipip-0002/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"dag" name is confusing because unixfs is a DAG too.
These are CBOR and JSON tests, and
dag-
variants are part of the story.Maybe rename
fixtures/path_gateway_dag
→fixtures/path_gateway_cbor_json
for clarity?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to my other comments about naming and specs (#92 (comment)) I'd keep this in a different PR if that's OK with you