Download tasks/format-code-task-000030/tests/test.patch from FineEnvs/MiMo-V2.6-RL-harbor-code: direct link, hf CLI and curl.
- Browser
- Download file 4.4 kB
-
https://huggingface.co/datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/resolve/main/tasks/format-code-task-000030/tests/test.patch
- Command line
-
hf download hf://datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/tasks/format-code-task-000030/tests/test.patch
-
curl -L -o test.patch https://huggingface.co/datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/resolve/main/tasks/format-code-task-000030/tests/test.patch
4.4 kB
| diff --git a/tests/blob/blobCorsRequest.test.ts b/tests/blob/blobCorsRequest.test.ts | |
| index f46468450..7fc25f36c 100644 | |
| --- a/tests/blob/blobCorsRequest.test.ts | |
| +++ b/tests/blob/blobCorsRequest.test.ts | |
| import * as assert from "assert"; | |
| import { configLogger } from "../../src/common/Logger"; | |
| import BlobTestServerFactory from "../BlobTestServerFactory"; | |
| +import { RestError } from "@azure/core-http"; | |
| import { | |
| EMULATOR_ACCOUNT_KEY, | |
| EMULATOR_ACCOUNT_NAME, | |
| describe("Blob Cors requests test", () => { | |
| assert.ok(res._response.status === 200); | |
| }); | |
| + context( | |
| + "OPTIONS request should work with matching rule containing wildcard in Origin @loki @sql", | |
| + async () => { | |
| + const testCases = [ | |
| + { origin: undefined, expected: 403 }, | |
| + { origin: "contoso.com", expected: 403 }, | |
| + { origin: "bar.notcontoso.com", expected: 403 }, | |
| + { origin: "foo.contoso.com", expected: 200 }, | |
| + { origin: "foo.bar.baz.contoso.com", expected: 200 }, | |
| + { origin: "foo.CONTOSO.com", expected: 200 } | |
| + ]; | |
| + | |
| + testCases.forEach(async (testCase) => { | |
| + it(`${testCase.origin}`, async () => { | |
| + const serviceProperties = await serviceClient.getProperties(); | |
| + | |
| + const newCORS = { | |
| + allowedHeaders: "header", | |
| + allowedMethods: "GET", | |
| + allowedOrigins: "*.contoso.com", | |
| + exposedHeaders: "*", | |
| + maxAgeInSeconds: 8888 | |
| + }; | |
| + | |
| + serviceProperties.cors = [newCORS]; | |
| + | |
| + await serviceClient.setProperties(serviceProperties); | |
| + | |
| + await sleep(100); | |
| + | |
| + const origin = testCase.origin; | |
| + const requestMethod = "GET"; | |
| + const expectedStatus = testCase.expected; | |
| + | |
| + const pipeline = newPipeline( | |
| + new StorageSharedKeyCredential( | |
| + EMULATOR_ACCOUNT_NAME, | |
| + EMULATOR_ACCOUNT_KEY | |
| + ), | |
| + { | |
| + retryOptions: { maxTries: 1 }, | |
| + | |
| + keepAliveOptions: { enable: false } | |
| + } | |
| + ); | |
| + pipeline.factories.unshift( | |
| + new OPTIONSRequestPolicyFactory(origin, requestMethod) | |
| + ); | |
| + const serviceClientForOptions = new BlobServiceClient( | |
| + baseURL, | |
| + pipeline | |
| + ); | |
| + | |
| + let status: number = 0; | |
| + try { | |
| + const res = await serviceClientForOptions.getProperties(); | |
| + status = res._response.status; | |
| + } catch (e: any) { | |
| + if (!(e instanceof RestError)) { | |
| + throw e; | |
| + } | |
| + | |
| + status = e.response?.status || 0; | |
| + } | |
| + | |
| + assert.ok(status === expectedStatus); | |
| + }); | |
| + }); | |
| + } | |
| + ); | |
| + | |
| it("Response of request to service without cors rules should not contains cors info @loki @sql", async () => { | |
| const serviceProperties = await serviceClient.getProperties(); | |
| describe("Blob Cors requests test", () => { | |
| pipeline.factories.unshift(new OriginPolicyFactory(origin)); | |
| const serviceClientWithOrigin = new BlobServiceClient(baseURL, pipeline); | |
| - const containerClientWithOrigin = serviceClientWithOrigin.getContainerClient( | |
| - "notexistcontainer" | |
| - ); | |
| + const containerClientWithOrigin = | |
| + serviceClientWithOrigin.getContainerClient("notexistcontainer"); | |
| try { | |
| await containerClientWithOrigin.getProperties(); | |
| diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64 | |
| new file mode 100644 | |
| --- /dev/null | |
| +++ b/mimo_build_env.tar.gz.b64 | |
| +H4sIAAAAAAAAA+3ST0+DMBgGcM77FP0CQCEWTyaajUSN2RLcLl4If5qtEejsWxY/vl0vLia6y5Zp | |
| +fH6HvoW28IaHqB5V15Zy2MXBuXDnWghfna/VzxORJkl2lXGRBNzNeBowcbaODoxkK8NYYLS2P+07 | |
| +tv5HRZ/5W0m2bHTfV0Mb0eZ07ziWfyoO8uf7/F3NAsZP18L3/nn+Tct88LVsJ8P2nTVGE4Xud2Dz | |
| +xSwvl0/PZZE/5tNluZrfrZb3i+LhJZ/dcLbf3OtmU7EwNPJtVEYyS+GgWxkbuVZkpXFLgw6t6qUe | |
| +LbmrtZFbdtvpV+VPNaMhtXPnXAMU152u/TDVhgr3SHc3sn6gyaW/EwAAAAAAAAAAAAAAAAAAAADA | |
| +b/QBSL+fCwAoAAA= | |
| diff --git a/mimo_test_command.sh b/mimo_test_command.sh | |
| new file mode 100755 | |
| --- /dev/null | |
| +++ b/mimo_test_command.sh | |
| +#!/usr/bin/env bash | |
| + | |
| +set -uo pipefail | |
| +cd /testbed || exit 1 | |
| +base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1 | |
| +exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh' | |