Download tasks/format-code-task-000057/tests/test.patch from FineEnvs/MiMo-V2.6-RL-harbor-code: direct link, hf CLI and curl.
- Browser
- Download file 3.89 kB
-
https://huggingface.co/datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/resolve/main/tasks/format-code-task-000057/tests/test.patch
- Command line
-
hf download hf://datasets/FineEnvs/MiMo-V2.6-RL-harbor-code/tasks/format-code-task-000057/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-000057/tests/test.patch
3.89 kB
| diff --git a/pkg/logs/internal/decoder/auto_multiline_detection/user_samples_test.go b/pkg/logs/internal/decoder/auto_multiline_detection/user_samples_test.go | |
| index db74b9efe4d554..db348cef768b93 100644 | |
| --- a/pkg/logs/internal/decoder/auto_multiline_detection/user_samples_test.go | |
| +++ b/pkg/logs/internal/decoder/auto_multiline_detection/user_samples_test.go | |
| logs_config: | |
| assert.Equal(t, aggregate, samples.samples[2].label) | |
| } | |
| +func TestUserPatternsJSON(t *testing.T) { | |
| + | |
| + mockConfig := mock.New(t) | |
| + mockConfig.SetWithoutSource("logs_config.auto_multi_line_detection_custom_samples", `[{"sample": "1", "label": "start_group"}, {"regex": "\\d\\w", "label": "no_aggregate"}, {"sample": "3", "match_threshold": 0.1}]`) | |
| + | |
| + samples := NewUserSamples(mockConfig) | |
| + assert.Equal(t, 3, len(samples.samples)) | |
| + assert.Equal(t, startGroup, samples.samples[0].label) | |
| + assert.Equal(t, "1", samples.samples[0].Sample) | |
| + assert.Equal(t, noAggregate, samples.samples[1].label) | |
| + assert.Equal(t, "\\d\\w", samples.samples[1].Regex) | |
| + assert.Equal(t, "3", samples.samples[2].Sample) | |
| + assert.Equal(t, 0.1, samples.samples[2].matchThreshold) | |
| +} | |
| + | |
| +func TestUserPatternsJSONEnv(t *testing.T) { | |
| + | |
| + mockConfig := mock.New(t) | |
| + t.Setenv("DD_LOGS_CONFIG_AUTO_MULTI_LINE_DETECTION_CUSTOM_SAMPLES", `[{"sample": "1", "label": "start_group"}, {"regex": "\\d\\w", "label": "no_aggregate"}, {"sample": "3", "match_threshold": 0.1}]`) | |
| + | |
| + samples := NewUserSamples(mockConfig) | |
| + assert.Equal(t, 3, len(samples.samples)) | |
| + assert.Equal(t, startGroup, samples.samples[0].label) | |
| + assert.Equal(t, "1", samples.samples[0].Sample) | |
| + assert.Equal(t, noAggregate, samples.samples[1].label) | |
| + assert.Equal(t, "\\d\\w", samples.samples[1].Regex) | |
| + assert.Equal(t, "3", samples.samples[2].Sample) | |
| + assert.Equal(t, 0.1, samples.samples[2].matchThreshold) | |
| +} | |
| + | |
| func TestUserPatternsMatchThreshold(t *testing.T) { | |
| datadogYaml := ` | |
| logs_config: | |
| } | |
| } | |
| +func TestOnlyLegacyPatterns(t *testing.T) { | |
| + | |
| + datadogYaml := ` | |
| +logs_config: | |
| + auto_multi_line_extra_patterns: | |
| + - "le\\wacy" | |
| +` | |
| + | |
| + mockConfig := mock.NewFromYAML(t, datadogYaml) | |
| + samples := NewUserSamples(mockConfig) | |
| + tokenizer := NewTokenizer(60) | |
| + | |
| + tests := []struct { | |
| + expectedLabel Label | |
| + shouldStop bool | |
| + input string | |
| + }{ | |
| + {startGroup, false, "legacy pattern should match me"}, | |
| + {startGroup, false, "leAacy pattern should match me"}, | |
| + {startGroup, false, "leVacy pattern should match me"}, | |
| + } | |
| + | |
| + for _, test := range tests { | |
| + context := &messageContext{ | |
| + rawMessage: []byte(test.input), | |
| + label: aggregate, | |
| + } | |
| + | |
| + assert.True(t, tokenizer.ProcessAndContinue(context)) | |
| + assert.Equal(t, test.shouldStop, samples.ProcessAndContinue(context), "Expected stop %v, got %v", test.shouldStop, samples.ProcessAndContinue(context)) | |
| + assert.Equal(t, test.expectedLabel, context.label, "Expected label %v, got %v", test.expectedLabel, context.label) | |
| + } | |
| +} | |
| + | |
| func TestUserPatternsProcessRegexCustomSettings(t *testing.T) { | |
| datadogYaml := ` | |
| 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+3RTU7DMBAFYK97Cl+g8Q/YWXGWKLWtYOF4UDLu+QlZAEKCbloh1PdtZiSP5Bm9 | |
| +7tRyiUOqZyVuRW965/a6+V733jhrrO6tN15oY7x+ENLdbKMv2srjIqVYiPi3uUvv/1T3mT+nlYdA | |
| +8zzW2K3P1/vjUv7G+o/8Xb/NmUdvrZD6eiv87M7zD1HuwZ9SPEwk31vZqdeXSRWaVpUrp6WORcUU | |
| +KKZFjY1pmFvhXHJNQ0ycAmeqSh7P8hioVX4yh7++CgAAAAAAAAAAAAAAAAAAAADgPrwBnZTdPwAo | |
| +AAA= | |
| 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' | |