Skip to content
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

tmp: testing gateway conformance #67

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Conversation

SgtPooki
Copy link
Member

Title

Attempting to enable gateway conformance tests

Description

You can run the tests locally with npm run test:gwc assuming you have loaded the env vars in .env.gwc

Notes & open questions

All of the tests are still failing.. something to do with oddities of gateway-conformance configuration..

cc @lidel or @aschmahmann to assist.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • I have added tests that prove my fix is effective or that my feature works

@SgtPooki
Copy link
Member Author

FYI that npm run test:gwc-kubo is erroring when importing fixtures:

stdout: 'processing /app/fixtures/dir_listing/fixtures.car\n' +
[kubo]     'processing /app/fixtures/gateway-cache/fixtures.car\n' +
[kubo]     'processing /app/fixtures/gateway-raw-block.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_dag/dag-cbor-traversal.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_dag/dag-json-traversal.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_dag/dag-pb.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_dag/gateway-json-cbor.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_dag/plain-cbor-that-can-be-dag-cbor.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_dag/plain-cbor-that-can-be-dag-json.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_dag/plain-cbor.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_dag/plain-json.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_tar/fixtures.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_tar/inside-root.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_tar/outside-root.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_unixfs/dir-with-files.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_unixfs/dir-with-percent-encoded-filename.car\n' +
[kubo]     'processing /app/fixtures/path_gateway_unixfs/symlink.car\n' +
[kubo]     'processing /app/fixtures/redirects_file/redirects-spa.car\n' +
[kubo]     'processing /app/fixtures/redirects_file/redirects.car\n' +
[kubo]     'processing /app/fixtures/subdomain_gateway/fixtures.car\n' +
[kubo]     'processing /app/fixtures/trustless_gateway_car/dir-with-dag-cbor-with-links.car\n' +
[kubo]     'processing /app/fixtures/trustless_gateway_car/dir-with-duplicate-files.car\n' +
[kubo]     'processing /app/fixtures/trustless_gateway_car/file-3k-and-3-blocks-missing-block.car\n' +
[kubo]     'processing /app/fixtures/trustless_gateway_car/single-layer-hamt-with-multi-block-files.car\n' +
[kubo]     'processing /app/fixtures/trustless_gateway_car/subdir-with-mixed-block-files.car\n' +
[kubo]     'processing /app/fixtures/trustless_gateway_car/subdir-with-two-single-block-files.car\n' +
[kubo]     'Opening the scripts/tmp/fixtures/fixtures.car file, with root: bafybeicxg7remach34kmmhvzauix3imutqi46aht7dg7fdsblkkuo5iohy',
[kubo]   stderr: '2024/03/11 22:04:56 cannot resume on file with mismatching data header',
[kubo]   cwd: '/Users/sgtpooki/code/work/protocol.ai/ipfs/helia-http-gateway',

@SgtPooki SgtPooki changed the title tmp: testing tmp: testing gateway conformance Mar 11, 2024
@SgtPooki
Copy link
Member Author

I ran into #67 (comment) during testing of https://github.com/ipfs-shipyard/service-worker-gateway as well and i believe it's due to importing car files that have already been imported.

@SgtPooki
Copy link
Member Author

with 6fa4ff7 (#67) I've got 44 successes when running npm run test:gwc

report is attached: gwc-report.json

Passing tests
PASS: TestMetadata (0.00s)
PASS: TestCors/GET_Responses_from_Gateway_should_include_CORS_headers_allowing_JS_from_other_origins_to_read_the_data_cross-origin./Header_Access-Control-Allow-Origin (0.00s)
PASS: TestCors/OPTIONS_to_Gateway_succeeds/Header_Access-Control-Allow-Origin (0.00s)
PASS: TestGatewayJsonCbor/GET_UnixFS_file_with_JSON_bytes_is_returned_with_application%2Fjson_Content-Type_-_without_headers/Status_code (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_file_as_DAG-JSON_with_format=dag-json_converts_to_the_expected_Content-Type/Status_code (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_file_as_DAG-JSON_with_format=dag-json_converts_to_the_expected_Content-Type/Header_Content-Type#01 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_directory_as_DAG-JSON_with_format=dag-json_converts_to_the_expected_Content-Type/Header_Content-Type#01 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_as_DAG-JSON_with_%27Accept:_application%2Fvnd.ipld.dag-json%27_converts_to_the_expected_Content-Type/Header_Content-Type#01 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_format=json_%28not_dag-json%29_is_no-op_%28no_conversion%29/Status_code (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_format=json_%28not_dag-json%29_is_no-op_%28no_conversion%29/Header_Content-Type (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_format=json_%28not_dag-json%29_is_no-op_%28no_conversion%29/Header_Content-Type#01 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_format=json_%28not_dag-json%29_is_no-op_%28no_conversion%29/Header_Content-Type#02 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_%27Accept:_application%2Fjson%27_%28not_dag-json%29_is_no-op_%28no_conversion%29/Header_Content-Type (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_%27Accept:_application%2Fjson%27_%28not_dag-json%29_is_no-op_%28no_conversion%29/Header_Content-Type#01 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_%27Accept:_application%2Fjson%27_%28not_dag-json%29_is_no-op_%28no_conversion%29/Header_Content-Type#02 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_file_as_DAG-CBOR_with_format=dag-cbor_converts_to_the_expected_Content-Type/Status_code (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_file_as_DAG-CBOR_with_format=dag-cbor_converts_to_the_expected_Content-Type/Header_Content-Type#01 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_directory_as_DAG-CBOR_with_format=dag-cbor_converts_to_the_expected_Content-Type/Header_Content-Type#01 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_as_DAG-CBOR_with_%27Accept:_application%2Fvnd.ipld.dag-cbor%27_converts_to_the_expected_Content-Type/Header_Content-Type#01 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_format=cbor_%28not_dag-cbor%29_is_no-op_%28no_conversion%29/Status_code (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_format=cbor_%28not_dag-cbor%29_is_no-op_%28no_conversion%29/Header_Content-Type (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_format=cbor_%28not_dag-cbor%29_is_no-op_%28no_conversion%29/Header_Content-Type#01 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_format=cbor_%28not_dag-cbor%29_is_no-op_%28no_conversion%29/Header_Content-Type#02 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_%27Accept:_application%2Fcbor%27_%28not_dag-cbor%29_is_no-op_%28no_conversion%29/Header_Content-Type (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_%27Accept:_application%2Fcbor%27_%28not_dag-cbor%29_is_no-op_%28no_conversion%29/Header_Content-Type#01 (0.00s)
PASS: TestDagPbConversion/GET_UnixFS_with_%27Accept:_application%2Fcbor%27_%28not_dag-cbor%29_is_no-op_%28no_conversion%29/Header_Content-Type#02 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_without_Accept_or_format=_has_expected_%22json%22_Content-Type_and_body_as-is_-_full_request/Check_1/Status_code (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_without_Accept_or_format=_has_expected_%22json%22_Content-Type_and_body_as-is_-_single_range/Check_1/Check_0 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_without_Accept_or_format=_has_expected_%22json%22_Content-Type_and_body_as-is_-_single_range/Check_1/Check_1 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_without_Accept_or_format=_has_expected_%22json%22_Content-Type_and_body_as-is_-_multi_range/Check_1/Check_0 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_without_Accept_or_format=_has_expected_%22json%22_Content-Type_and_body_as-is_-_multi_range/Check_1/Check_1 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_without_Accept_or_format=_has_expected_%22json%22_Content-Type_and_body_as-is_-_multi_range/Check_1/Check_2 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_with_%3Fformat=_has_expected_json_Content-Type_and_body_as-is_-_full_request/Check_1/Status_code (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_with_%3Fformat=_has_expected_json_Content-Type_and_body_as-is_-_single_range/Check_1/Check_0 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_with_%3Fformat=_has_expected_json_Content-Type_and_body_as-is_-_single_range/Check_1/Check_1 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_with_%3Fformat=_has_expected_json_Content-Type_and_body_as-is_-_multi_range/Check_1/Check_0 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_with_%3Fformat=_has_expected_json_Content-Type_and_body_as-is_-_multi_range/Check_1/Check_1 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_with_%3Fformat=_has_expected_json_Content-Type_and_body_as-is_-_multi_range/Check_1/Check_2 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_with_Accept_has_expected_json_Content-Type_and_body_as-is%2C_with_single_range_request_-_full_request/Check_1/Status_code (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_with_Accept_has_expected_json_Content-Type_and_body_as-is%2C_with_single_range_request_-_single_range/Check_1/Check_0 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_with_Accept_has_expected_json_Content-Type_and_body_as-is%2C_with_single_range_request_-_single_range/Check_1/Check_1 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_with_Accept_has_expected_json_Content-Type_and_body_as-is%2C_with_single_range_request_-_multi_range/Check_1/Check_0 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_with_Accept_has_expected_json_Content-Type_and_body_as-is%2C_with_single_range_request_-_multi_range/Check_1/Check_1 (0.00s)
PASS: TestPlainCodec/GET_plain_JSON_codec_with_Accept_has_expected_json_Content-Type_and_body_as-is%2C_with_single_range_request_-_multi_range/Check_1/Check_2 (0.00s)

@SgtPooki
Copy link
Member Author

SgtPooki commented Mar 30, 2024

with the fix from ipfs/helia-verified-fetch#36, i've got successes up to 116 (searching output.log or gwc-report.json for "PASS:")

gwc-report.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants