Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- tasks/format-code-task-000019/environment/Dockerfile +3 -0
- tasks/format-code-task-000019/environment/setup/files/blocklist +33 -0
- tasks/format-code-task-000019/environment/setup/setup.sh +34 -0
- tasks/format-code-task-000019/tests/test.patch +252 -0
- tasks/format-code-task-000019/tests/test.sh +38 -0
- tasks/format-code-task-000019/tests/test_command.sh +1 -0
- tasks/format-code-task-000026/environment/Dockerfile +3 -0
- tasks/format-code-task-000026/environment/setup/files/blocklist +33 -0
- tasks/format-code-task-000026/environment/setup/setup.sh +34 -0
- tasks/format-code-task-000026/tests/test.patch +140 -0
- tasks/format-code-task-000026/tests/test.sh +39 -0
- tasks/format-code-task-000026/tests/test_command.sh +1 -0
- tasks/format-code-task-000028/environment/Dockerfile +3 -0
- tasks/format-code-task-000028/environment/setup/files/blocklist +33 -0
- tasks/format-code-task-000028/environment/setup/setup.sh +34 -0
- tasks/format-code-task-000028/tests/test.patch +166 -0
- tasks/format-code-task-000028/tests/test.sh +38 -0
- tasks/format-code-task-000028/tests/test_command.sh +1 -0
- tasks/format-code-task-000072/environment/Dockerfile +3 -0
- tasks/format-code-task-000072/environment/setup/files/blocklist +33 -0
- tasks/format-code-task-000072/environment/setup/setup.sh +34 -0
- tasks/format-code-task-000072/tests/test.patch +1032 -0
- tasks/format-code-task-000072/tests/test.sh +43 -0
- tasks/format-code-task-000072/tests/test_command.sh +1 -0
- tasks/format-code-task-000073/environment/Dockerfile +3 -0
- tasks/format-code-task-000073/environment/setup/files/blocklist +33 -0
- tasks/format-code-task-000073/environment/setup/setup.sh +34 -0
- tasks/format-code-task-000073/tests/test.patch +36 -0
- tasks/format-code-task-000073/tests/test.sh +39 -0
- tasks/format-code-task-000073/tests/test_command.sh +1 -0
- tasks/format-code-task-000075/environment/Dockerfile +3 -0
- tasks/format-code-task-000075/environment/setup/files/blocklist +33 -0
- tasks/format-code-task-000075/environment/setup/setup.sh +34 -0
- tasks/format-code-task-000075/tests/test.patch +427 -0
- tasks/format-code-task-000075/tests/test.sh +39 -0
- tasks/format-code-task-000075/tests/test_command.sh +1 -0
- tasks/format-code-task-000080/environment/Dockerfile +3 -0
- tasks/format-code-task-000080/environment/setup/files/blocklist +33 -0
- tasks/format-code-task-000080/environment/setup/setup.sh +34 -0
- tasks/format-code-task-000080/tests/test.patch +193 -0
- tasks/format-code-task-000080/tests/test.sh +38 -0
- tasks/format-code-task-000080/tests/test_command.sh +1 -0
- tasks/format-code-task-000081/environment/Dockerfile +3 -0
- tasks/format-code-task-000081/environment/setup/files/blocklist +33 -0
- tasks/format-code-task-000081/environment/setup/setup.sh +34 -0
- tasks/format-code-task-000081/tests/test.patch +250 -0
- tasks/format-code-task-000081/tests/test.sh +39 -0
- tasks/format-code-task-000081/tests/test_command.sh +1 -0
- tasks/format-code-task-000087/environment/Dockerfile +3 -0
- tasks/format-code-task-000087/environment/setup/files/blocklist +33 -0
tasks/format-code-task-000019/environment/Dockerfile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The task's image, pinned by digest (the same as [environment].docker_image).
|
| 2 |
+
# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy.
|
| 3 |
+
FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:78f404abfd84d841daf74e13995a6fc5c6f7fc25031414ddfa21030eca5aea78
|
tasks/format-code-task-000019/environment/setup/files/blocklist
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# mimo answer-leak blocklist (mimoagent)
|
| 2 |
+
0.0.0.0 github.com
|
| 3 |
+
0.0.0.0 www.github.com
|
| 4 |
+
0.0.0.0 api.github.com
|
| 5 |
+
0.0.0.0 raw.githubusercontent.com
|
| 6 |
+
0.0.0.0 codeload.github.com
|
| 7 |
+
0.0.0.0 objects.githubusercontent.com
|
| 8 |
+
0.0.0.0 gist.github.com
|
| 9 |
+
0.0.0.0 gist.githubusercontent.com
|
| 10 |
+
0.0.0.0 gitlab.com
|
| 11 |
+
0.0.0.0 bitbucket.org
|
| 12 |
+
0.0.0.0 sourceforge.net
|
| 13 |
+
0.0.0.0 git.kernel.org
|
| 14 |
+
0.0.0.0 chromium.googlesource.com
|
| 15 |
+
0.0.0.0 android.googlesource.com
|
| 16 |
+
0.0.0.0 sourcegraph.com
|
| 17 |
+
0.0.0.0 bugs.chromium.org
|
| 18 |
+
0.0.0.0 issues.oss-fuzz.com
|
| 19 |
+
0.0.0.0 oss-fuzz.com
|
| 20 |
+
0.0.0.0 osv.dev
|
| 21 |
+
0.0.0.0 api.osv.dev
|
| 22 |
+
0.0.0.0 bugzilla.mozilla.org
|
| 23 |
+
0.0.0.0 proxy.golang.org
|
| 24 |
+
0.0.0.0 sum.golang.org
|
| 25 |
+
0.0.0.0 pkg.go.dev
|
| 26 |
+
0.0.0.0 google.com
|
| 27 |
+
0.0.0.0 www.google.com
|
| 28 |
+
0.0.0.0 bing.com
|
| 29 |
+
0.0.0.0 www.bing.com
|
| 30 |
+
0.0.0.0 duckduckgo.com
|
| 31 |
+
0.0.0.0 html.duckduckgo.com
|
| 32 |
+
0.0.0.0 search.brave.com
|
| 33 |
+
0.0.0.0 stackoverflow.com
|
tasks/format-code-task-000019/environment/setup/setup.sh
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into
|
| 3 |
+
# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
[ -f "$M/ready" ] && exit 0
|
| 6 |
+
chmod 700 "$M"
|
| 7 |
+
fail() { echo "setup: $*" >&2; exit 1; }
|
| 8 |
+
# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs
|
| 9 |
+
write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; }
|
| 10 |
+
|
| 11 |
+
# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code).
|
| 12 |
+
CWD=/testbed
|
| 13 |
+
git config --global --add safe.directory "$CWD"
|
| 14 |
+
cd "$CWD" || fail "no working directory $CWD"
|
| 15 |
+
if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit
|
| 16 |
+
git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty
|
| 17 |
+
fi
|
| 18 |
+
BASE=$(git rev-parse HEAD 2>/dev/null)
|
| 19 |
+
[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD"
|
| 20 |
+
echo "$BASE" > "$M/base"
|
| 21 |
+
# Images are built with history truncated at the base. If one is not, the fix could be read out of git log,
|
| 22 |
+
# so .git is hidden while the agent works and put back for grading.
|
| 23 |
+
LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true)
|
| 24 |
+
rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true
|
| 25 |
+
git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1
|
| 26 |
+
find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true
|
| 27 |
+
if [ "$LATER" -gt 0 ]; then
|
| 28 |
+
mv "$CWD/.git" "$M/git-hidden"
|
| 29 |
+
echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works"
|
| 30 |
+
fi
|
| 31 |
+
write_blocklist
|
| 32 |
+
|
| 33 |
+
touch "$M/ready"
|
| 34 |
+
echo "setup done"
|
tasks/format-code-task-000019/tests/test.patch
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/covalent_ui/api/v1/tests/delete_all_dispatches_test.py b/covalent_ui/api/v1/tests/delete_all_dispatches_test.py
|
| 2 |
+
new file mode 100644
|
| 3 |
+
index 00000000..9b7dfac5
|
| 4 |
+
--- /dev/null
|
| 5 |
+
+++ b/covalent_ui/api/v1/tests/delete_all_dispatches_test.py
|
| 6 |
+
@@ -0,0 +1,225 @@
|
| 7 |
+
+
|
| 8 |
+
+
|
| 9 |
+
+
|
| 10 |
+
+
|
| 11 |
+
+
|
| 12 |
+
+
|
| 13 |
+
+
|
| 14 |
+
+
|
| 15 |
+
+
|
| 16 |
+
+
|
| 17 |
+
+
|
| 18 |
+
+
|
| 19 |
+
+
|
| 20 |
+
+
|
| 21 |
+
+
|
| 22 |
+
+
|
| 23 |
+
+
|
| 24 |
+
+
|
| 25 |
+
+
|
| 26 |
+
+
|
| 27 |
+
+
|
| 28 |
+
+
|
| 29 |
+
+import datetime
|
| 30 |
+
+import uuid
|
| 31 |
+
+
|
| 32 |
+
+import pytest
|
| 33 |
+
+from sqlalchemy import create_engine
|
| 34 |
+
+from sqlalchemy.orm import Session
|
| 35 |
+
+
|
| 36 |
+
+from covalent._data_store.models import Base as ModelsBase
|
| 37 |
+
+from covalent_ui.api.v1.data_layer.summary_dal import Summary
|
| 38 |
+
+from covalent_ui.api.v1.database.config.db import Base as UIBase
|
| 39 |
+
+from covalent_ui.api.v1.database.schema.electron import Electron
|
| 40 |
+
+from covalent_ui.api.v1.database.schema.lattices import Lattice
|
| 41 |
+
+from covalent_ui.api.v1.models.dispatch_model import DeleteAllDispatchesRequest
|
| 42 |
+
+from covalent_ui.api.v1.utils.status import Status
|
| 43 |
+
+
|
| 44 |
+
+NOW = datetime.datetime(2022, 1, 1, 0, 0, 0)
|
| 45 |
+
+
|
| 46 |
+
+
|
| 47 |
+
+@pytest.fixture
|
| 48 |
+
+def session():
|
| 49 |
+
+
|
| 50 |
+
+ engine = create_engine("sqlite+pysqlite:///:memory:")
|
| 51 |
+
+ UIBase.metadata.create_all(engine)
|
| 52 |
+
+
|
| 53 |
+
+ ModelsBase.metadata.tables["electron_dependency"].create(engine)
|
| 54 |
+
+ with Session(engine) as sess:
|
| 55 |
+
+ yield sess
|
| 56 |
+
+
|
| 57 |
+
+
|
| 58 |
+
+def _add_dispatch(sess, status, name=None, dispatch_id=None, is_active=True):
|
| 59 |
+
+ dispatch_id = dispatch_id or str(uuid.uuid4())
|
| 60 |
+
+ name = name or f"workflow_{status.lower()}"
|
| 61 |
+
+ lattice = Lattice(
|
| 62 |
+
+ dispatch_id=dispatch_id,
|
| 63 |
+
+ name=name,
|
| 64 |
+
+ status=status,
|
| 65 |
+
+ electron_num=1,
|
| 66 |
+
+ completed_electron_num=1,
|
| 67 |
+
+ is_active=is_active,
|
| 68 |
+
+ started_at=NOW,
|
| 69 |
+
+ completed_at=NOW,
|
| 70 |
+
+ electron_id=None,
|
| 71 |
+
+ )
|
| 72 |
+
+ sess.add(lattice)
|
| 73 |
+
+ sess.flush()
|
| 74 |
+
+ sess.add(
|
| 75 |
+
+ Electron(
|
| 76 |
+
+ parent_lattice_id=lattice.id,
|
| 77 |
+
+ transport_graph_node_id=0,
|
| 78 |
+
+ type="function",
|
| 79 |
+
+ name=f"node_{status.lower()}",
|
| 80 |
+
+ status=status,
|
| 81 |
+
+ is_active=is_active,
|
| 82 |
+
+ )
|
| 83 |
+
+ )
|
| 84 |
+
+ sess.commit()
|
| 85 |
+
+ return dispatch_id
|
| 86 |
+
+
|
| 87 |
+
+
|
| 88 |
+
+def _active_status_map(sess):
|
| 89 |
+
+ return {row.status: row.is_active for row in sess.query(Lattice).all()}
|
| 90 |
+
+
|
| 91 |
+
+
|
| 92 |
+
+def _active_electron_map(sess):
|
| 93 |
+
+ return {row.status: row.is_active for row in sess.query(Electron).all()}
|
| 94 |
+
+
|
| 95 |
+
+
|
| 96 |
+
+def test_delete_all_with_all_filter_removes_every_active_dispatch(session):
|
| 97 |
+
+ ids = {
|
| 98 |
+
+ st: _add_dispatch(session, st)
|
| 99 |
+
+ for st in ["RUNNING", "COMPLETED", "FAILED", "CANCELLED"]
|
| 100 |
+
+ }
|
| 101 |
+
+
|
| 102 |
+
+ resp = Summary(session).delete_all_dispatches(
|
| 103 |
+
+ DeleteAllDispatchesRequest(status_filter=Status.ALL)
|
| 104 |
+
+ )
|
| 105 |
+
+
|
| 106 |
+
+ assert {uuid.UUID(d) for d in ids.values()} == set(resp.success_items)
|
| 107 |
+
+ assert resp.message == "Dispatch(es) have been deleted successfully!"
|
| 108 |
+
+
|
| 109 |
+
+ assert all(active is False for active in _active_status_map(session).values())
|
| 110 |
+
+
|
| 111 |
+
+
|
| 112 |
+
+def test_completed_filter_includes_postprocessing_states(session):
|
| 113 |
+
+ grouped = ["COMPLETED", "POSTPROCESSING", "POSTPROCESSING_FAILED", "PENDING_POSTPROCESSING"]
|
| 114 |
+
+ untouched = ["RUNNING", "FAILED", "CANCELLED", "NEW_OBJECT"]
|
| 115 |
+
+ for st in grouped + untouched:
|
| 116 |
+
+ _add_dispatch(session, st)
|
| 117 |
+
+
|
| 118 |
+
+ resp = Summary(session).delete_all_dispatches(
|
| 119 |
+
+ DeleteAllDispatchesRequest(status_filter=Status.COMPLETED)
|
| 120 |
+
+ )
|
| 121 |
+
+
|
| 122 |
+
+ status_active = _active_status_map(session)
|
| 123 |
+
+ for st in grouped:
|
| 124 |
+
+ assert status_active[st] is False, f"{st} should have been deleted"
|
| 125 |
+
+ for st in untouched:
|
| 126 |
+
+ assert status_active[st] is True, f"{st} should be untouched"
|
| 127 |
+
+ assert len(resp.success_items) == len(grouped)
|
| 128 |
+
+
|
| 129 |
+
+
|
| 130 |
+
+def test_specific_status_filter_deletes_only_that_status(session):
|
| 131 |
+
+ for st in ["RUNNING", "COMPLETED", "FAILED"]:
|
| 132 |
+
+ _add_dispatch(session, st)
|
| 133 |
+
+
|
| 134 |
+
+ resp = Summary(session).delete_all_dispatches(
|
| 135 |
+
+ DeleteAllDispatchesRequest(status_filter=Status.FAILED)
|
| 136 |
+
+ )
|
| 137 |
+
+
|
| 138 |
+
+ status_active = _active_status_map(session)
|
| 139 |
+
+ assert status_active["FAILED"] is False
|
| 140 |
+
+ assert status_active["RUNNING"] is True
|
| 141 |
+
+ assert status_active["COMPLETED"] is True
|
| 142 |
+
+ assert len(resp.success_items) == 1
|
| 143 |
+
+
|
| 144 |
+
+
|
| 145 |
+
+def test_completed_postprocessing_only_does_not_touch_running_or_failed(session):
|
| 146 |
+
+
|
| 147 |
+
+ _add_dispatch(session, "POSTPROCESSING")
|
| 148 |
+
+ _add_dispatch(session, "RUNNING")
|
| 149 |
+
+
|
| 150 |
+
+ Summary(session).delete_all_dispatches(
|
| 151 |
+
+ DeleteAllDispatchesRequest(status_filter=Status.COMPLETED)
|
| 152 |
+
+ )
|
| 153 |
+
+
|
| 154 |
+
+ status_active = _active_status_map(session)
|
| 155 |
+
+ assert status_active["POSTPROCESSING"] is False
|
| 156 |
+
+ assert status_active["RUNNING"] is True
|
| 157 |
+
+
|
| 158 |
+
+
|
| 159 |
+
+def test_deletion_cascades_to_electrons(session):
|
| 160 |
+
+ _add_dispatch(session, "COMPLETED")
|
| 161 |
+
+ _add_dispatch(session, "RUNNING")
|
| 162 |
+
+
|
| 163 |
+
+ Summary(session).delete_all_dispatches(
|
| 164 |
+
+ DeleteAllDispatchesRequest(status_filter=Status.COMPLETED)
|
| 165 |
+
+ )
|
| 166 |
+
+
|
| 167 |
+
+ electron_active = _active_electron_map(session)
|
| 168 |
+
+ assert electron_active["COMPLETED"] is False
|
| 169 |
+
+ assert electron_active["RUNNING"] is True
|
| 170 |
+
+
|
| 171 |
+
+
|
| 172 |
+
+def test_search_string_narrows_selection(session):
|
| 173 |
+
+ keep = _add_dispatch(session, "COMPLETED", name="alpha_pipeline")
|
| 174 |
+
+ _add_dispatch(session, "COMPLETED", name="beta_pipeline")
|
| 175 |
+
+
|
| 176 |
+
+ resp = Summary(session).delete_all_dispatches(
|
| 177 |
+
+ DeleteAllDispatchesRequest(status_filter=Status.ALL, search_string="alpha")
|
| 178 |
+
+ )
|
| 179 |
+
+
|
| 180 |
+
+ assert set(resp.success_items) == {uuid.UUID(keep)}
|
| 181 |
+
+ status_for = {row.dispatch_id: row.is_active for row in session.query(Lattice).all()}
|
| 182 |
+
+ assert status_for[keep] is False
|
| 183 |
+
+
|
| 184 |
+
+ assert all(
|
| 185 |
+
+ active is True for did, active in status_for.items() if did != keep
|
| 186 |
+
+ )
|
| 187 |
+
+
|
| 188 |
+
+
|
| 189 |
+
+def test_search_string_matches_dispatch_id(session):
|
| 190 |
+
+ target = _add_dispatch(session, "COMPLETED")
|
| 191 |
+
+ _add_dispatch(session, "COMPLETED")
|
| 192 |
+
+
|
| 193 |
+
+ resp = Summary(session).delete_all_dispatches(
|
| 194 |
+
+ DeleteAllDispatchesRequest(status_filter=Status.ALL, search_string=target)
|
| 195 |
+
+ )
|
| 196 |
+
+
|
| 197 |
+
+ assert set(resp.success_items) == {uuid.UUID(target)}
|
| 198 |
+
+
|
| 199 |
+
+
|
| 200 |
+
+def test_no_matching_dispatches_reports_nothing_deleted(session):
|
| 201 |
+
+ _add_dispatch(session, "RUNNING")
|
| 202 |
+
+
|
| 203 |
+
+ resp = Summary(session).delete_all_dispatches(
|
| 204 |
+
+ DeleteAllDispatchesRequest(status_filter=Status.FAILED)
|
| 205 |
+
+ )
|
| 206 |
+
+
|
| 207 |
+
+ assert list(resp.success_items) == []
|
| 208 |
+
+ assert resp.message == "No dispatches were deleted"
|
| 209 |
+
+ assert _active_status_map(session)["RUNNING"] is True
|
| 210 |
+
+
|
| 211 |
+
+
|
| 212 |
+
+def test_already_inactive_dispatches_are_excluded(session):
|
| 213 |
+
+ active = _add_dispatch(session, "COMPLETED", name="active_one")
|
| 214 |
+
+ _add_dispatch(session, "COMPLETED", name="already_gone", is_active=False)
|
| 215 |
+
+
|
| 216 |
+
+ resp = Summary(session).delete_all_dispatches(
|
| 217 |
+
+ DeleteAllDispatchesRequest(status_filter=Status.ALL)
|
| 218 |
+
+ )
|
| 219 |
+
+
|
| 220 |
+
+ assert set(resp.success_items) == {uuid.UUID(active)}
|
| 221 |
+
+
|
| 222 |
+
+
|
| 223 |
+
+def test_defaults_select_all_active_dispatches(session):
|
| 224 |
+
+ for st in ["RUNNING", "COMPLETED", "FAILED"]:
|
| 225 |
+
+ _add_dispatch(session, st)
|
| 226 |
+
+
|
| 227 |
+
+
|
| 228 |
+
+ resp = Summary(session).delete_all_dispatches(DeleteAllDispatchesRequest())
|
| 229 |
+
+
|
| 230 |
+
+ assert len(resp.success_items) == 3
|
| 231 |
+
+ assert all(active is False for active in _active_status_map(session).values())
|
| 232 |
+
diff --git a/mimo_test_command.sh b/mimo_test_command.sh
|
| 233 |
+
new file mode 100755
|
| 234 |
+
--- /dev/null
|
| 235 |
+
+++ b/mimo_test_command.sh
|
| 236 |
+
@@ -0,0 +1,16 @@
|
| 237 |
+
+#!/usr/bin/env bash
|
| 238 |
+
+
|
| 239 |
+
+
|
| 240 |
+
+
|
| 241 |
+
+
|
| 242 |
+
+set -euo pipefail
|
| 243 |
+
+HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
| 244 |
+
+cd /testbed
|
| 245 |
+
+
|
| 246 |
+
+
|
| 247 |
+
+
|
| 248 |
+
+
|
| 249 |
+
+python -m pytest tests/covalent_tests/data_store/data_store_test.py -q
|
| 250 |
+
+
|
| 251 |
+
+
|
| 252 |
+
+python -m pytest covalent_ui/api/v1/tests/delete_all_dispatches_test.py -q
|
tasks/format-code-task-000019/tests/test.sh
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the
|
| 3 |
+
# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
CWD=/testbed
|
| 6 |
+
V=/logs/verifier
|
| 7 |
+
mkdir -p "$V"
|
| 8 |
+
BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; }
|
| 9 |
+
cd "$CWD" || exit 1
|
| 10 |
+
if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi
|
| 11 |
+
# the agent's change against the base, so its own commits count too
|
| 12 |
+
git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff"
|
| 13 |
+
git reset -q
|
| 14 |
+
if ! (
|
| 15 |
+
while IFS= read -r tf; do
|
| 16 |
+
[ -z "$tf" ] && continue
|
| 17 |
+
if git cat-file -e $BASE:"$tf" 2>/dev/null; then
|
| 18 |
+
git checkout $BASE -- "$tf" 2>/dev/null || true
|
| 19 |
+
else
|
| 20 |
+
git rm -f --cached "$tf" >/dev/null 2>&1 || true
|
| 21 |
+
rm -f "$tf"
|
| 22 |
+
fi
|
| 23 |
+
done <<'EOF_RESET_TEST_FILES'
|
| 24 |
+
covalent_ui/api/v1/tests/delete_all_dispatches_test.py
|
| 25 |
+
mimo_test_command.sh
|
| 26 |
+
EOF_RESET_TEST_FILES
|
| 27 |
+
|
| 28 |
+
); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi
|
| 29 |
+
if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then
|
| 30 |
+
cat "$V/apply.log" >&2
|
| 31 |
+
echo "the hidden tests could not be applied (testbed problem, not scored)" >&2
|
| 32 |
+
exit 1
|
| 33 |
+
fi
|
| 34 |
+
timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1
|
| 35 |
+
RC=$?
|
| 36 |
+
tail -c 12000 "$V/test_output.log"
|
| 37 |
+
if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi
|
| 38 |
+
echo "test command exited $RC"
|
tasks/format-code-task-000019/tests/test_command.sh
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
bash /testbed/mimo_test_command.sh
|
tasks/format-code-task-000026/environment/Dockerfile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The task's image, pinned by digest (the same as [environment].docker_image).
|
| 2 |
+
# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy.
|
| 3 |
+
FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:77d20cca70ee937251907e49fbfead1a4d3e80f34905562725c99d78f9d1bd4f
|
tasks/format-code-task-000026/environment/setup/files/blocklist
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# mimo answer-leak blocklist (mimoagent)
|
| 2 |
+
0.0.0.0 github.com
|
| 3 |
+
0.0.0.0 www.github.com
|
| 4 |
+
0.0.0.0 api.github.com
|
| 5 |
+
0.0.0.0 raw.githubusercontent.com
|
| 6 |
+
0.0.0.0 codeload.github.com
|
| 7 |
+
0.0.0.0 objects.githubusercontent.com
|
| 8 |
+
0.0.0.0 gist.github.com
|
| 9 |
+
0.0.0.0 gist.githubusercontent.com
|
| 10 |
+
0.0.0.0 gitlab.com
|
| 11 |
+
0.0.0.0 bitbucket.org
|
| 12 |
+
0.0.0.0 sourceforge.net
|
| 13 |
+
0.0.0.0 git.kernel.org
|
| 14 |
+
0.0.0.0 chromium.googlesource.com
|
| 15 |
+
0.0.0.0 android.googlesource.com
|
| 16 |
+
0.0.0.0 sourcegraph.com
|
| 17 |
+
0.0.0.0 bugs.chromium.org
|
| 18 |
+
0.0.0.0 issues.oss-fuzz.com
|
| 19 |
+
0.0.0.0 oss-fuzz.com
|
| 20 |
+
0.0.0.0 osv.dev
|
| 21 |
+
0.0.0.0 api.osv.dev
|
| 22 |
+
0.0.0.0 bugzilla.mozilla.org
|
| 23 |
+
0.0.0.0 proxy.golang.org
|
| 24 |
+
0.0.0.0 sum.golang.org
|
| 25 |
+
0.0.0.0 pkg.go.dev
|
| 26 |
+
0.0.0.0 google.com
|
| 27 |
+
0.0.0.0 www.google.com
|
| 28 |
+
0.0.0.0 bing.com
|
| 29 |
+
0.0.0.0 www.bing.com
|
| 30 |
+
0.0.0.0 duckduckgo.com
|
| 31 |
+
0.0.0.0 html.duckduckgo.com
|
| 32 |
+
0.0.0.0 search.brave.com
|
| 33 |
+
0.0.0.0 stackoverflow.com
|
tasks/format-code-task-000026/environment/setup/setup.sh
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into
|
| 3 |
+
# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
[ -f "$M/ready" ] && exit 0
|
| 6 |
+
chmod 700 "$M"
|
| 7 |
+
fail() { echo "setup: $*" >&2; exit 1; }
|
| 8 |
+
# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs
|
| 9 |
+
write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; }
|
| 10 |
+
|
| 11 |
+
# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code).
|
| 12 |
+
CWD=/testbed
|
| 13 |
+
git config --global --add safe.directory "$CWD"
|
| 14 |
+
cd "$CWD" || fail "no working directory $CWD"
|
| 15 |
+
if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit
|
| 16 |
+
git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty
|
| 17 |
+
fi
|
| 18 |
+
BASE=$(git rev-parse HEAD 2>/dev/null)
|
| 19 |
+
[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD"
|
| 20 |
+
echo "$BASE" > "$M/base"
|
| 21 |
+
# Images are built with history truncated at the base. If one is not, the fix could be read out of git log,
|
| 22 |
+
# so .git is hidden while the agent works and put back for grading.
|
| 23 |
+
LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true)
|
| 24 |
+
rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true
|
| 25 |
+
git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1
|
| 26 |
+
find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true
|
| 27 |
+
if [ "$LATER" -gt 0 ]; then
|
| 28 |
+
mv "$CWD/.git" "$M/git-hidden"
|
| 29 |
+
echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works"
|
| 30 |
+
fi
|
| 31 |
+
write_blocklist
|
| 32 |
+
|
| 33 |
+
touch "$M/ready"
|
| 34 |
+
echo "setup done"
|
tasks/format-code-task-000026/tests/test.patch
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/test/types/lean.test.ts b/test/types/lean.test.ts
|
| 2 |
+
index 745999d3a..05f34d96f 100644
|
| 3 |
+
--- a/test/types/lean.test.ts
|
| 4 |
+
+++ b/test/types/lean.test.ts
|
| 5 |
+
@@ -1,4 +1,4 @@
|
| 6 |
+
-import { Schema, model, Types, InferSchemaType, FlattenMaps } from 'mongoose';
|
| 7 |
+
+import { Schema, model, Types, InferSchemaType, FlattenMaps, Require_id } from 'mongoose';
|
| 8 |
+
import { expectAssignable, expectError, expectType } from 'tsd';
|
| 9 |
+
|
| 10 |
+
function gh10345() {
|
| 11 |
+
@@ -206,3 +206,107 @@ async function gh13382() {
|
| 12 |
+
const res = await Test.updateOne({}, { name: 'bar' }).lean();
|
| 13 |
+
expectAssignable<{ matchedCount: number, modifiedCount: number }>(res);
|
| 14 |
+
}
|
| 15 |
+
+
|
| 16 |
+
+async function gh13702_findById_lean_option() {
|
| 17 |
+
+ interface User { name: string; }
|
| 18 |
+
+ const UserModel = model<User>('User', new Schema({ name: String }));
|
| 19 |
+
+
|
| 20 |
+
+ const a = await UserModel.findById('id', undefined, { lean: true });
|
| 21 |
+
+ const b = await UserModel.findById('id').lean();
|
| 22 |
+
+ expectType<typeof b>(a);
|
| 23 |
+
+ expectType<(FlattenMaps<User> & { _id: Types.ObjectId }) | null>(a);
|
| 24 |
+
+
|
| 25 |
+
+ const a2 = await UserModel.findById('id', null, { lean: true });
|
| 26 |
+
+ expectType<(FlattenMaps<User> & { _id: Types.ObjectId }) | null>(a2);
|
| 27 |
+
+}
|
| 28 |
+
+
|
| 29 |
+
+async function gh13702_findById_no_lean_preserves_hydrated() {
|
| 30 |
+
+ interface User { name: string; }
|
| 31 |
+
+ const UserModel = model<User>('User', new Schema({ name: String }));
|
| 32 |
+
+
|
| 33 |
+
+ const a = await UserModel.findById('id');
|
| 34 |
+
+ if (a) {
|
| 35 |
+
+
|
| 36 |
+
+ expectAssignable<Function>(a.save);
|
| 37 |
+
+ }
|
| 38 |
+
+}
|
| 39 |
+
+
|
| 40 |
+
+async function gh13702_findOne_lean_option() {
|
| 41 |
+
+ interface User { name: string; }
|
| 42 |
+
+ const UserModel = model<User>('User', new Schema({ name: String }));
|
| 43 |
+
+
|
| 44 |
+
+ const a = await UserModel.findOne({}, undefined, { lean: true });
|
| 45 |
+
+ const b = await UserModel.findOne({}).lean();
|
| 46 |
+
+ expectType<typeof b>(a);
|
| 47 |
+
+ expectType<(FlattenMaps<User> & { _id: Types.ObjectId }) | null>(a);
|
| 48 |
+
+}
|
| 49 |
+
+
|
| 50 |
+
+async function gh13702_find_lean_option() {
|
| 51 |
+
+ interface User { name: string; }
|
| 52 |
+
+ const UserModel = model<User>('User', new Schema({ name: String }));
|
| 53 |
+
+
|
| 54 |
+
+ const a = await UserModel.find({}, undefined, { lean: true });
|
| 55 |
+
+ const b = await UserModel.find({}).lean();
|
| 56 |
+
+ expectType<typeof b>(a);
|
| 57 |
+
+ expectType<Array<FlattenMaps<User> & { _id: Types.ObjectId }>>(a);
|
| 58 |
+
+}
|
| 59 |
+
+
|
| 60 |
+
+async function gh13702_findOneAndDelete_lean_option() {
|
| 61 |
+
+ interface User { name: string; }
|
| 62 |
+
+ const UserModel = model<User>('User', new Schema({ name: String }));
|
| 63 |
+
+
|
| 64 |
+
+ const a = await UserModel.findOneAndDelete({}, { lean: true });
|
| 65 |
+
+ const b = await UserModel.findOneAndDelete({}).lean();
|
| 66 |
+
+ expectType<typeof b>(a);
|
| 67 |
+
+ expectType<(FlattenMaps<User> & { _id: Types.ObjectId }) | null>(a);
|
| 68 |
+
+}
|
| 69 |
+
+
|
| 70 |
+
+async function gh13702_findOneAndUpdate_lean_option() {
|
| 71 |
+
+ interface User { name: string; }
|
| 72 |
+
+ const UserModel = model<User>('User', new Schema({ name: String }));
|
| 73 |
+
+
|
| 74 |
+
+ const a = await UserModel.findOneAndUpdate({}, { name: 'x' }, { lean: true });
|
| 75 |
+
+ const b = await UserModel.findOneAndUpdate({}, { name: 'x' }).lean();
|
| 76 |
+
+ expectType<typeof b>(a);
|
| 77 |
+
+ expectType<(FlattenMaps<User> & { _id: Types.ObjectId }) | null>(a);
|
| 78 |
+
+}
|
| 79 |
+
+
|
| 80 |
+
+async function gh13702_findOneAndReplace_lean_option() {
|
| 81 |
+
+ interface User { name: string; }
|
| 82 |
+
+ const UserModel = model<User>('User', new Schema({ name: String }));
|
| 83 |
+
+
|
| 84 |
+
+ const a = await UserModel.findOneAndReplace({}, { name: 'x' }, { lean: true });
|
| 85 |
+
+ const b = await UserModel.findOneAndReplace({}, { name: 'x' }).lean();
|
| 86 |
+
+ expectType<typeof b>(a);
|
| 87 |
+
+ expectType<(FlattenMaps<User> & { _id: Types.ObjectId }) | null>(a);
|
| 88 |
+
+}
|
| 89 |
+
+
|
| 90 |
+
+async function gh13702_findByIdAndDelete_lean_option() {
|
| 91 |
+
+ interface User { name: string; }
|
| 92 |
+
+ const UserModel = model<User>('User', new Schema({ name: String }));
|
| 93 |
+
+
|
| 94 |
+
+ const a = await UserModel.findByIdAndDelete('id', { lean: true });
|
| 95 |
+
+ const b = await UserModel.findByIdAndDelete('id').lean();
|
| 96 |
+
+ expectType<typeof b>(a);
|
| 97 |
+
+ expectType<(FlattenMaps<User> & { _id: Types.ObjectId }) | null>(a);
|
| 98 |
+
+}
|
| 99 |
+
+
|
| 100 |
+
+async function gh13702_findByIdAndRemove_lean_option() {
|
| 101 |
+
+ interface User { name: string; }
|
| 102 |
+
+ const UserModel = model<User>('User', new Schema({ name: String }));
|
| 103 |
+
+
|
| 104 |
+
+ const a = await UserModel.findByIdAndRemove('id', { lean: true });
|
| 105 |
+
+ const b = await UserModel.findByIdAndRemove('id').lean();
|
| 106 |
+
+ expectType<typeof b>(a);
|
| 107 |
+
+ expectType<(FlattenMaps<User> & { _id: Types.ObjectId }) | null>(a);
|
| 108 |
+
+}
|
| 109 |
+
+
|
| 110 |
+
+async function gh13702_findByIdAndUpdate_lean_option() {
|
| 111 |
+
+ interface User { name: string; }
|
| 112 |
+
+ const UserModel = model<User>('User', new Schema({ name: String }));
|
| 113 |
+
+
|
| 114 |
+
+ const a = await UserModel.findByIdAndUpdate('id', { name: 'x' }, { lean: true });
|
| 115 |
+
+ const b = await UserModel.findByIdAndUpdate('id', { name: 'x' }).lean();
|
| 116 |
+
+ expectType<typeof b>(a);
|
| 117 |
+
+ expectType<(FlattenMaps<User> & { _id: Types.ObjectId }) | null>(a);
|
| 118 |
+
+}
|
| 119 |
+
diff --git a/test_commands.json b/test_commands.json
|
| 120 |
+
new file mode 100644
|
| 121 |
+
index 000000000..8fcadc25d
|
| 122 |
+
--- /dev/null
|
| 123 |
+
+++ b/test_commands.json
|
| 124 |
+
@@ -0,0 +1,3 @@
|
| 125 |
+
+{
|
| 126 |
+
+ "test_commands": ["./node_modules/.bin/tsd"]
|
| 127 |
+
+}
|
| 128 |
+
diff --git a/mimo_test_command.sh b/mimo_test_command.sh
|
| 129 |
+
new file mode 100755
|
| 130 |
+
--- /dev/null
|
| 131 |
+
+++ b/mimo_test_command.sh
|
| 132 |
+
@@ -0,0 +1,8 @@
|
| 133 |
+
+#!/usr/bin/env bash
|
| 134 |
+
+
|
| 135 |
+
+set -uo pipefail
|
| 136 |
+
+cd /testbed
|
| 137 |
+
+rc=0
|
| 138 |
+
+./node_modules/.bin/tsd
|
| 139 |
+
+rc=$(( rc | $? ))
|
| 140 |
+
+exit $rc
|
tasks/format-code-task-000026/tests/test.sh
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the
|
| 3 |
+
# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
CWD=/testbed
|
| 6 |
+
V=/logs/verifier
|
| 7 |
+
mkdir -p "$V"
|
| 8 |
+
BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; }
|
| 9 |
+
cd "$CWD" || exit 1
|
| 10 |
+
if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi
|
| 11 |
+
# the agent's change against the base, so its own commits count too
|
| 12 |
+
git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff"
|
| 13 |
+
git reset -q
|
| 14 |
+
if ! (
|
| 15 |
+
while IFS= read -r tf; do
|
| 16 |
+
[ -z "$tf" ] && continue
|
| 17 |
+
if git cat-file -e $BASE:"$tf" 2>/dev/null; then
|
| 18 |
+
git checkout $BASE -- "$tf" 2>/dev/null || true
|
| 19 |
+
else
|
| 20 |
+
git rm -f --cached "$tf" >/dev/null 2>&1 || true
|
| 21 |
+
rm -f "$tf"
|
| 22 |
+
fi
|
| 23 |
+
done <<'EOF_RESET_TEST_FILES'
|
| 24 |
+
test/types/lean.test.ts
|
| 25 |
+
test_commands.json
|
| 26 |
+
mimo_test_command.sh
|
| 27 |
+
EOF_RESET_TEST_FILES
|
| 28 |
+
|
| 29 |
+
); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi
|
| 30 |
+
if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then
|
| 31 |
+
cat "$V/apply.log" >&2
|
| 32 |
+
echo "the hidden tests could not be applied (testbed problem, not scored)" >&2
|
| 33 |
+
exit 1
|
| 34 |
+
fi
|
| 35 |
+
timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1
|
| 36 |
+
RC=$?
|
| 37 |
+
tail -c 12000 "$V/test_output.log"
|
| 38 |
+
if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi
|
| 39 |
+
echo "test command exited $RC"
|
tasks/format-code-task-000026/tests/test_command.sh
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
bash /testbed/mimo_test_command.sh
|
tasks/format-code-task-000028/environment/Dockerfile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The task's image, pinned by digest (the same as [environment].docker_image).
|
| 2 |
+
# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy.
|
| 3 |
+
FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:233c258f8339f4f14aa2ba6fc7b2ed89c16f92a03f87c35f254bfbc2eb35f18f
|
tasks/format-code-task-000028/environment/setup/files/blocklist
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# mimo answer-leak blocklist (mimoagent)
|
| 2 |
+
0.0.0.0 github.com
|
| 3 |
+
0.0.0.0 www.github.com
|
| 4 |
+
0.0.0.0 api.github.com
|
| 5 |
+
0.0.0.0 raw.githubusercontent.com
|
| 6 |
+
0.0.0.0 codeload.github.com
|
| 7 |
+
0.0.0.0 objects.githubusercontent.com
|
| 8 |
+
0.0.0.0 gist.github.com
|
| 9 |
+
0.0.0.0 gist.githubusercontent.com
|
| 10 |
+
0.0.0.0 gitlab.com
|
| 11 |
+
0.0.0.0 bitbucket.org
|
| 12 |
+
0.0.0.0 sourceforge.net
|
| 13 |
+
0.0.0.0 git.kernel.org
|
| 14 |
+
0.0.0.0 chromium.googlesource.com
|
| 15 |
+
0.0.0.0 android.googlesource.com
|
| 16 |
+
0.0.0.0 sourcegraph.com
|
| 17 |
+
0.0.0.0 bugs.chromium.org
|
| 18 |
+
0.0.0.0 issues.oss-fuzz.com
|
| 19 |
+
0.0.0.0 oss-fuzz.com
|
| 20 |
+
0.0.0.0 osv.dev
|
| 21 |
+
0.0.0.0 api.osv.dev
|
| 22 |
+
0.0.0.0 bugzilla.mozilla.org
|
| 23 |
+
0.0.0.0 proxy.golang.org
|
| 24 |
+
0.0.0.0 sum.golang.org
|
| 25 |
+
0.0.0.0 pkg.go.dev
|
| 26 |
+
0.0.0.0 google.com
|
| 27 |
+
0.0.0.0 www.google.com
|
| 28 |
+
0.0.0.0 bing.com
|
| 29 |
+
0.0.0.0 www.bing.com
|
| 30 |
+
0.0.0.0 duckduckgo.com
|
| 31 |
+
0.0.0.0 html.duckduckgo.com
|
| 32 |
+
0.0.0.0 search.brave.com
|
| 33 |
+
0.0.0.0 stackoverflow.com
|
tasks/format-code-task-000028/environment/setup/setup.sh
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into
|
| 3 |
+
# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
[ -f "$M/ready" ] && exit 0
|
| 6 |
+
chmod 700 "$M"
|
| 7 |
+
fail() { echo "setup: $*" >&2; exit 1; }
|
| 8 |
+
# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs
|
| 9 |
+
write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; }
|
| 10 |
+
|
| 11 |
+
# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code).
|
| 12 |
+
CWD=/testbed
|
| 13 |
+
git config --global --add safe.directory "$CWD"
|
| 14 |
+
cd "$CWD" || fail "no working directory $CWD"
|
| 15 |
+
if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit
|
| 16 |
+
git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty
|
| 17 |
+
fi
|
| 18 |
+
BASE=$(git rev-parse HEAD 2>/dev/null)
|
| 19 |
+
[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD"
|
| 20 |
+
echo "$BASE" > "$M/base"
|
| 21 |
+
# Images are built with history truncated at the base. If one is not, the fix could be read out of git log,
|
| 22 |
+
# so .git is hidden while the agent works and put back for grading.
|
| 23 |
+
LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true)
|
| 24 |
+
rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true
|
| 25 |
+
git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1
|
| 26 |
+
find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true
|
| 27 |
+
if [ "$LATER" -gt 0 ]; then
|
| 28 |
+
mv "$CWD/.git" "$M/git-hidden"
|
| 29 |
+
echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works"
|
| 30 |
+
fi
|
| 31 |
+
write_blocklist
|
| 32 |
+
|
| 33 |
+
touch "$M/ready"
|
| 34 |
+
echo "setup done"
|
tasks/format-code-task-000028/tests/test.patch
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/test/document.validateAllPaths.test.js b/test/document.validateAllPaths.test.js
|
| 2 |
+
new file mode 100644
|
| 3 |
+
index 000000000..d6445486a
|
| 4 |
+
--- /dev/null
|
| 5 |
+
+++ b/test/document.validateAllPaths.test.js
|
| 6 |
+
@@ -0,0 +1,133 @@
|
| 7 |
+
+'use strict';
|
| 8 |
+
+
|
| 9 |
+
+const start = require('./common');
|
| 10 |
+
+
|
| 11 |
+
+const assert = require('assert');
|
| 12 |
+
+
|
| 13 |
+
+const mongoose = start.mongoose;
|
| 14 |
+
+const Schema = mongoose.Schema;
|
| 15 |
+
+
|
| 16 |
+
+describe('document validateAllPaths option', function() {
|
| 17 |
+
+ let modelCounter = 0;
|
| 18 |
+
+ function makeModel(definition, schemaOptions) {
|
| 19 |
+
+ const schema = new Schema(definition, schemaOptions);
|
| 20 |
+
+ return mongoose.model('validateAllPaths_' + (++modelCounter), schema);
|
| 21 |
+
+ }
|
| 22 |
+
+
|
| 23 |
+
+ describe('with schema-level validateModifiedOnly', function() {
|
| 24 |
+
+ let Test;
|
| 25 |
+
+ function makeInvalidDoc() {
|
| 26 |
+
+ return Test.hydrate({ name: '', age: -1, tags: ['z'], okField: 'fine' });
|
| 27 |
+
+ }
|
| 28 |
+
+
|
| 29 |
+
+ beforeEach(function() {
|
| 30 |
+
+ Test = makeModel({
|
| 31 |
+
+ name: { type: String, required: true },
|
| 32 |
+
+ age: { type: Number, min: [0, 'too small'] },
|
| 33 |
+
+ tags: [{ type: String, enum: ['a', 'b'] }],
|
| 34 |
+
+ okField: { type: String }
|
| 35 |
+
+ }, { validateModifiedOnly: true });
|
| 36 |
+
+ });
|
| 37 |
+
+
|
| 38 |
+
+ it('validateSync does not report unmodified paths by default', function() {
|
| 39 |
+
+ const doc = makeInvalidDoc();
|
| 40 |
+
+ assert.strictEqual(doc.modifiedPaths().length, 0);
|
| 41 |
+
+ assert.strictEqual(doc.validateSync(), undefined);
|
| 42 |
+
+ });
|
| 43 |
+
+
|
| 44 |
+
+ it('validateSync({ validateAllPaths: true }) validates every path', function() {
|
| 45 |
+
+ const doc = makeInvalidDoc();
|
| 46 |
+
+ const err = doc.validateSync({ validateAllPaths: true });
|
| 47 |
+
+ assert.ok(err);
|
| 48 |
+
+ assert.equal(err.name, 'ValidationError');
|
| 49 |
+
+ assert.ok(err.errors['name']);
|
| 50 |
+
+ assert.ok(err.errors['age']);
|
| 51 |
+
+ assert.ok(err.errors['tags.0']);
|
| 52 |
+
+ assert.ok(!err.errors['okField']);
|
| 53 |
+
+ });
|
| 54 |
+
+
|
| 55 |
+
+ it('validateSync({ validateAllPaths: true }) returns undefined when all paths are valid', function() {
|
| 56 |
+
+ const doc = Test.hydrate({ name: 'valid', age: 5, tags: ['a'], okField: 'fine' });
|
| 57 |
+
+ assert.strictEqual(doc.validateSync({ validateAllPaths: true }), undefined);
|
| 58 |
+
+ });
|
| 59 |
+
+
|
| 60 |
+
+ it('validate() does not report unmodified paths by default', async function() {
|
| 61 |
+
+ const doc = makeInvalidDoc();
|
| 62 |
+
+ await doc.validate();
|
| 63 |
+
+ });
|
| 64 |
+
+
|
| 65 |
+
+ it('validate({ validateAllPaths: true }) rejects with every failing path', async function() {
|
| 66 |
+
+ const doc = makeInvalidDoc();
|
| 67 |
+
+ const err = await doc.validate({ validateAllPaths: true }).then(() => null, e => e);
|
| 68 |
+
+ assert.ok(err);
|
| 69 |
+
+ assert.equal(err.name, 'ValidationError');
|
| 70 |
+
+ assert.ok(err.errors['name']);
|
| 71 |
+
+ assert.ok(err.errors['age']);
|
| 72 |
+
+ assert.ok(err.errors['tags.0']);
|
| 73 |
+
+ assert.ok(!err.errors['okField']);
|
| 74 |
+
+ });
|
| 75 |
+
+
|
| 76 |
+
+ it('validate({ validateAllPaths: true }) resolves when all paths are valid', async function() {
|
| 77 |
+
+ const doc = Test.hydrate({ name: 'valid', age: 5, tags: ['a'], okField: 'fine' });
|
| 78 |
+
+ await doc.validate({ validateAllPaths: true });
|
| 79 |
+
+ });
|
| 80 |
+
+ });
|
| 81 |
+
+
|
| 82 |
+
+ describe('error contracts', function() {
|
| 83 |
+
+ let Test;
|
| 84 |
+
+ beforeEach(function() {
|
| 85 |
+
+ Test = makeModel({
|
| 86 |
+
+ name: { type: String, required: true },
|
| 87 |
+
+ age: { type: Number }
|
| 88 |
+
+ });
|
| 89 |
+
+ });
|
| 90 |
+
+
|
| 91 |
+
+ it('validateSync throws when combining validateAllPaths and pathsToSkip', function() {
|
| 92 |
+
+ const doc = Test.hydrate({ name: 'x', age: 1 });
|
| 93 |
+
+ assert.throws(
|
| 94 |
+
+ () => doc.validateSync({ validateAllPaths: true, pathsToSkip: 'name' }),
|
| 95 |
+
+ err => err instanceof TypeError &&
|
| 96 |
+
+ err.message === 'Cannot set both `validateAllPaths` and `pathsToSkip`'
|
| 97 |
+
+ );
|
| 98 |
+
+ });
|
| 99 |
+
+
|
| 100 |
+
+ it('validateSync throws when combining validateAllPaths and pathsToValidate', function() {
|
| 101 |
+
+ const doc = Test.hydrate({ name: 'x', age: 1 });
|
| 102 |
+
+ assert.throws(
|
| 103 |
+
+ () => doc.validateSync(['name'], { validateAllPaths: true }),
|
| 104 |
+
+ err => err instanceof TypeError &&
|
| 105 |
+
+ err.message === 'Cannot set both `validateAllPaths` and `pathsToValidate`'
|
| 106 |
+
+ );
|
| 107 |
+
+ });
|
| 108 |
+
+
|
| 109 |
+
+ it('validateSync throws when combining validateAllPaths and validateModifiedOnly', function() {
|
| 110 |
+
+ const doc = Test.hydrate({ name: 'x', age: 1 });
|
| 111 |
+
+ assert.throws(
|
| 112 |
+
+ () => doc.validateSync({ validateAllPaths: true, validateModifiedOnly: true }),
|
| 113 |
+
+ err => err instanceof TypeError &&
|
| 114 |
+
+ err.message === 'Cannot set both `validateAllPaths` and `validateModifiedOnly`'
|
| 115 |
+
+ );
|
| 116 |
+
+ });
|
| 117 |
+
+
|
| 118 |
+
+ it('validate rejects when combining validateAllPaths and pathsToSkip', async function() {
|
| 119 |
+
+ const doc = Test.hydrate({ name: 'x', age: 1 });
|
| 120 |
+
+ const err = await doc.validate({ validateAllPaths: true, pathsToSkip: 'name' }).then(() => null, e => e);
|
| 121 |
+
+ assert.ok(err instanceof TypeError);
|
| 122 |
+
+ assert.equal(err.message, 'Cannot set both `validateAllPaths` and `pathsToSkip`');
|
| 123 |
+
+ });
|
| 124 |
+
+
|
| 125 |
+
+ it('validate rejects when combining validateAllPaths and pathsToValidate', async function() {
|
| 126 |
+
+ const doc = Test.hydrate({ name: 'x', age: 1 });
|
| 127 |
+
+ const err = await doc.validate(['name'], { validateAllPaths: true }).then(() => null, e => e);
|
| 128 |
+
+ assert.ok(err instanceof TypeError);
|
| 129 |
+
+ assert.equal(err.message, 'Cannot set both `validateAllPaths` and `pathsToValidate`');
|
| 130 |
+
+ });
|
| 131 |
+
+
|
| 132 |
+
+ it('validate rejects when combining validateAllPaths and validateModifiedOnly', async function() {
|
| 133 |
+
+ const doc = Test.hydrate({ name: 'x', age: 1 });
|
| 134 |
+
+ const err = await doc.validate({ validateAllPaths: true, validateModifiedOnly: true }).then(() => null, e => e);
|
| 135 |
+
+ assert.ok(err instanceof TypeError);
|
| 136 |
+
+ assert.equal(err.message, 'Cannot set both `validateAllPaths` and `validateModifiedOnly`');
|
| 137 |
+
+ });
|
| 138 |
+
+ });
|
| 139 |
+
+});
|
| 140 |
+
diff --git a/mimo_test_command.sh b/mimo_test_command.sh
|
| 141 |
+
new file mode 100755
|
| 142 |
+
--- /dev/null
|
| 143 |
+
+++ b/mimo_test_command.sh
|
| 144 |
+
@@ -0,0 +1,22 @@
|
| 145 |
+
+#!/usr/bin/env bash
|
| 146 |
+
+
|
| 147 |
+
+
|
| 148 |
+
+
|
| 149 |
+
+
|
| 150 |
+
+set -euo pipefail
|
| 151 |
+
+HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
| 152 |
+
+cd /testbed
|
| 153 |
+
+
|
| 154 |
+
+
|
| 155 |
+
+
|
| 156 |
+
+
|
| 157 |
+
+
|
| 158 |
+
+
|
| 159 |
+
+
|
| 160 |
+
+export MONGOMS_VERSION=8.0.0
|
| 161 |
+
+
|
| 162 |
+
+
|
| 163 |
+
+npx mocha --exit ./test/document.test.js
|
| 164 |
+
+
|
| 165 |
+
+
|
| 166 |
+
+npx mocha --exit ./test/document.validateAllPaths.test.js
|
tasks/format-code-task-000028/tests/test.sh
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the
|
| 3 |
+
# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
CWD=/testbed
|
| 6 |
+
V=/logs/verifier
|
| 7 |
+
mkdir -p "$V"
|
| 8 |
+
BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; }
|
| 9 |
+
cd "$CWD" || exit 1
|
| 10 |
+
if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi
|
| 11 |
+
# the agent's change against the base, so its own commits count too
|
| 12 |
+
git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff"
|
| 13 |
+
git reset -q
|
| 14 |
+
if ! (
|
| 15 |
+
while IFS= read -r tf; do
|
| 16 |
+
[ -z "$tf" ] && continue
|
| 17 |
+
if git cat-file -e $BASE:"$tf" 2>/dev/null; then
|
| 18 |
+
git checkout $BASE -- "$tf" 2>/dev/null || true
|
| 19 |
+
else
|
| 20 |
+
git rm -f --cached "$tf" >/dev/null 2>&1 || true
|
| 21 |
+
rm -f "$tf"
|
| 22 |
+
fi
|
| 23 |
+
done <<'EOF_RESET_TEST_FILES'
|
| 24 |
+
test/document.validateAllPaths.test.js
|
| 25 |
+
mimo_test_command.sh
|
| 26 |
+
EOF_RESET_TEST_FILES
|
| 27 |
+
|
| 28 |
+
); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi
|
| 29 |
+
if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then
|
| 30 |
+
cat "$V/apply.log" >&2
|
| 31 |
+
echo "the hidden tests could not be applied (testbed problem, not scored)" >&2
|
| 32 |
+
exit 1
|
| 33 |
+
fi
|
| 34 |
+
timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1
|
| 35 |
+
RC=$?
|
| 36 |
+
tail -c 12000 "$V/test_output.log"
|
| 37 |
+
if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi
|
| 38 |
+
echo "test command exited $RC"
|
tasks/format-code-task-000028/tests/test_command.sh
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
bash /testbed/mimo_test_command.sh
|
tasks/format-code-task-000072/environment/Dockerfile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The task's image, pinned by digest (the same as [environment].docker_image).
|
| 2 |
+
# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy.
|
| 3 |
+
FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:84c6874aa8a23cdd4015851adbb0a016f40f74bc5489fa540974537a253114a3
|
tasks/format-code-task-000072/environment/setup/files/blocklist
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# mimo answer-leak blocklist (mimoagent)
|
| 2 |
+
0.0.0.0 github.com
|
| 3 |
+
0.0.0.0 www.github.com
|
| 4 |
+
0.0.0.0 api.github.com
|
| 5 |
+
0.0.0.0 raw.githubusercontent.com
|
| 6 |
+
0.0.0.0 codeload.github.com
|
| 7 |
+
0.0.0.0 objects.githubusercontent.com
|
| 8 |
+
0.0.0.0 gist.github.com
|
| 9 |
+
0.0.0.0 gist.githubusercontent.com
|
| 10 |
+
0.0.0.0 gitlab.com
|
| 11 |
+
0.0.0.0 bitbucket.org
|
| 12 |
+
0.0.0.0 sourceforge.net
|
| 13 |
+
0.0.0.0 git.kernel.org
|
| 14 |
+
0.0.0.0 chromium.googlesource.com
|
| 15 |
+
0.0.0.0 android.googlesource.com
|
| 16 |
+
0.0.0.0 sourcegraph.com
|
| 17 |
+
0.0.0.0 bugs.chromium.org
|
| 18 |
+
0.0.0.0 issues.oss-fuzz.com
|
| 19 |
+
0.0.0.0 oss-fuzz.com
|
| 20 |
+
0.0.0.0 osv.dev
|
| 21 |
+
0.0.0.0 api.osv.dev
|
| 22 |
+
0.0.0.0 bugzilla.mozilla.org
|
| 23 |
+
0.0.0.0 proxy.golang.org
|
| 24 |
+
0.0.0.0 sum.golang.org
|
| 25 |
+
0.0.0.0 pkg.go.dev
|
| 26 |
+
0.0.0.0 google.com
|
| 27 |
+
0.0.0.0 www.google.com
|
| 28 |
+
0.0.0.0 bing.com
|
| 29 |
+
0.0.0.0 www.bing.com
|
| 30 |
+
0.0.0.0 duckduckgo.com
|
| 31 |
+
0.0.0.0 html.duckduckgo.com
|
| 32 |
+
0.0.0.0 search.brave.com
|
| 33 |
+
0.0.0.0 stackoverflow.com
|
tasks/format-code-task-000072/environment/setup/setup.sh
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into
|
| 3 |
+
# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
[ -f "$M/ready" ] && exit 0
|
| 6 |
+
chmod 700 "$M"
|
| 7 |
+
fail() { echo "setup: $*" >&2; exit 1; }
|
| 8 |
+
# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs
|
| 9 |
+
write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; }
|
| 10 |
+
|
| 11 |
+
# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code).
|
| 12 |
+
CWD=/testbed
|
| 13 |
+
git config --global --add safe.directory "$CWD"
|
| 14 |
+
cd "$CWD" || fail "no working directory $CWD"
|
| 15 |
+
if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit
|
| 16 |
+
git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty
|
| 17 |
+
fi
|
| 18 |
+
BASE=$(git rev-parse HEAD 2>/dev/null)
|
| 19 |
+
[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD"
|
| 20 |
+
echo "$BASE" > "$M/base"
|
| 21 |
+
# Images are built with history truncated at the base. If one is not, the fix could be read out of git log,
|
| 22 |
+
# so .git is hidden while the agent works and put back for grading.
|
| 23 |
+
LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true)
|
| 24 |
+
rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true
|
| 25 |
+
git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1
|
| 26 |
+
find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true
|
| 27 |
+
if [ "$LATER" -gt 0 ]; then
|
| 28 |
+
mv "$CWD/.git" "$M/git-hidden"
|
| 29 |
+
echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works"
|
| 30 |
+
fi
|
| 31 |
+
write_blocklist
|
| 32 |
+
|
| 33 |
+
touch "$M/ready"
|
| 34 |
+
echo "setup done"
|
tasks/format-code-task-000072/tests/test.patch
ADDED
|
@@ -0,0 +1,1032 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/datadog/tests/cassettes/TestAccDatadogIntegrationAzure.freeze b/datadog/tests/cassettes/TestAccDatadogIntegrationAzure.freeze
|
| 2 |
+
index 2f181d5c51..640da7bc9b 100644
|
| 3 |
+
--- a/datadog/tests/cassettes/TestAccDatadogIntegrationAzure.freeze
|
| 4 |
+
+++ b/datadog/tests/cassettes/TestAccDatadogIntegrationAzure.freeze
|
| 5 |
+
@@ -1 +1 @@
|
| 6 |
+
-2021-10-28T16:26:13.057136-04:00
|
| 7 |
+
|
| 8 |
+
+2021-11-09T17:40:54.549623+01:00
|
| 9 |
+
|
| 10 |
+
diff --git a/datadog/tests/cassettes/TestAccDatadogIntegrationAzure.yaml b/datadog/tests/cassettes/TestAccDatadogIntegrationAzure.yaml
|
| 11 |
+
index 7be2867f1c..16c0cf056e 100644
|
| 12 |
+
--- a/datadog/tests/cassettes/TestAccDatadogIntegrationAzure.yaml
|
| 13 |
+
+++ b/datadog/tests/cassettes/TestAccDatadogIntegrationAzure.yaml
|
| 14 |
+
@@ -3,19 +3,19 @@ version: 1
|
| 15 |
+
interactions:
|
| 16 |
+
- request:
|
| 17 |
+
body: |
|
| 18 |
+
- {"client_id":"testc7f6-1234-5678-9101-3fcbf464test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"foo:bar,buzz:lightyear","tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773"}
|
| 19 |
+
+ {"automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"foo:bar,buzz:lightyear","tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054"}
|
| 20 |
+
form: {}
|
| 21 |
+
headers:
|
| 22 |
+
Accept:
|
| 23 |
+
- application/json
|
| 24 |
+
Content-Length:
|
| 25 |
+
- - "211"
|
| 26 |
+
+ - "228"
|
| 27 |
+
Content-Type:
|
| 28 |
+
- application/json
|
| 29 |
+
Dd-Operation-Id:
|
| 30 |
+
- CreateAzureIntegration
|
| 31 |
+
User-Agent:
|
| 32 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 33 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 34 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 35 |
+
method: POST
|
| 36 |
+
response:
|
| 37 |
+
@@ -32,13 +32,15 @@ interactions:
|
| 38 |
+
Content-Type:
|
| 39 |
+
- application/json
|
| 40 |
+
Date:
|
| 41 |
+
- - Thu, 28 Oct 2021 20:26:16 GMT
|
| 42 |
+
+ - Tue, 09 Nov 2021 16:40:58 GMT
|
| 43 |
+
Pragma:
|
| 44 |
+
- no-cache
|
| 45 |
+
Strict-Transport-Security:
|
| 46 |
+
- max-age=15724800;
|
| 47 |
+
X-Content-Type-Options:
|
| 48 |
+
- nosniff
|
| 49 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 50 |
+
+ - "1692"
|
| 51 |
+
X-Frame-Options:
|
| 52 |
+
- SAMEORIGIN
|
| 53 |
+
status: 200 OK
|
| 54 |
+
@@ -53,11 +55,11 @@ interactions:
|
| 55 |
+
Dd-Operation-Id:
|
| 56 |
+
- ListAzureIntegration
|
| 57 |
+
User-Agent:
|
| 58 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 59 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 60 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 61 |
+
method: GET
|
| 62 |
+
response:
|
| 63 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451360","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451660","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452319","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452663","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-73061-1629707067","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 64 |
+
+ body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636473129","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80208-1636035966","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80608-1636466533","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 65 |
+
headers:
|
| 66 |
+
Cache-Control:
|
| 67 |
+
- no-cache
|
| 68 |
+
@@ -68,7 +70,7 @@ interactions:
|
| 69 |
+
Content-Type:
|
| 70 |
+
- application/json
|
| 71 |
+
Date:
|
| 72 |
+
- - Thu, 28 Oct 2021 20:26:16 GMT
|
| 73 |
+
+ - Tue, 09 Nov 2021 16:40:58 GMT
|
| 74 |
+
Pragma:
|
| 75 |
+
- no-cache
|
| 76 |
+
Strict-Transport-Security:
|
| 77 |
+
@@ -77,6 +79,8 @@ interactions:
|
| 78 |
+
- Accept-Encoding
|
| 79 |
+
X-Content-Type-Options:
|
| 80 |
+
- nosniff
|
| 81 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 82 |
+
+ - "109"
|
| 83 |
+
X-Frame-Options:
|
| 84 |
+
- SAMEORIGIN
|
| 85 |
+
status: 200 OK
|
| 86 |
+
@@ -84,19 +88,19 @@ interactions:
|
| 87 |
+
duration: ""
|
| 88 |
+
- request:
|
| 89 |
+
body: |
|
| 90 |
+
- {"client_id":"testc7f6-1234-5678-9101-3fcbf123test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"foo:bar,buzz:lightyear","tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773"}
|
| 91 |
+
+ {"automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"foo:bar,buzz:lightyear","tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054"}
|
| 92 |
+
form: {}
|
| 93 |
+
headers:
|
| 94 |
+
Accept:
|
| 95 |
+
- application/json
|
| 96 |
+
Content-Length:
|
| 97 |
+
- - "211"
|
| 98 |
+
+ - "228"
|
| 99 |
+
Content-Type:
|
| 100 |
+
- application/json
|
| 101 |
+
Dd-Operation-Id:
|
| 102 |
+
- CreateAzureIntegration
|
| 103 |
+
User-Agent:
|
| 104 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 105 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 106 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 107 |
+
method: POST
|
| 108 |
+
response:
|
| 109 |
+
@@ -113,13 +117,15 @@ interactions:
|
| 110 |
+
Content-Type:
|
| 111 |
+
- application/json
|
| 112 |
+
Date:
|
| 113 |
+
- - Thu, 28 Oct 2021 20:26:18 GMT
|
| 114 |
+
+ - Tue, 09 Nov 2021 16:40:59 GMT
|
| 115 |
+
Pragma:
|
| 116 |
+
- no-cache
|
| 117 |
+
Strict-Transport-Security:
|
| 118 |
+
- max-age=15724800;
|
| 119 |
+
X-Content-Type-Options:
|
| 120 |
+
- nosniff
|
| 121 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 122 |
+
+ - "1449"
|
| 123 |
+
X-Frame-Options:
|
| 124 |
+
- SAMEORIGIN
|
| 125 |
+
status: 200 OK
|
| 126 |
+
@@ -134,11 +140,11 @@ interactions:
|
| 127 |
+
Dd-Operation-Id:
|
| 128 |
+
- ListAzureIntegration
|
| 129 |
+
User-Agent:
|
| 130 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 131 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 132 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 133 |
+
method: GET
|
| 134 |
+
response:
|
| 135 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451360","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451660","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452319","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452663","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-73061-1629707067","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 136 |
+
+ body: '[{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636473129","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80208-1636035966","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80608-1636466533","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 137 |
+
headers:
|
| 138 |
+
Cache-Control:
|
| 139 |
+
- no-cache
|
| 140 |
+
@@ -149,7 +155,7 @@ interactions:
|
| 141 |
+
Content-Type:
|
| 142 |
+
- application/json
|
| 143 |
+
Date:
|
| 144 |
+
- - Thu, 28 Oct 2021 20:26:19 GMT
|
| 145 |
+
+ - Tue, 09 Nov 2021 16:40:59 GMT
|
| 146 |
+
Pragma:
|
| 147 |
+
- no-cache
|
| 148 |
+
Strict-Transport-Security:
|
| 149 |
+
@@ -158,6 +164,8 @@ interactions:
|
| 150 |
+
- Accept-Encoding
|
| 151 |
+
X-Content-Type-Options:
|
| 152 |
+
- nosniff
|
| 153 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 154 |
+
+ - "96"
|
| 155 |
+
X-Frame-Options:
|
| 156 |
+
- SAMEORIGIN
|
| 157 |
+
status: 200 OK
|
| 158 |
+
@@ -172,11 +180,11 @@ interactions:
|
| 159 |
+
Dd-Operation-Id:
|
| 160 |
+
- ListAzureIntegration
|
| 161 |
+
User-Agent:
|
| 162 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 163 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 164 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 165 |
+
method: GET
|
| 166 |
+
response:
|
| 167 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451360","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451660","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452319","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452663","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-73061-1629707067","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 168 |
+
+ body: '[{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636473129","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80208-1636035966","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80608-1636466533","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 169 |
+
headers:
|
| 170 |
+
Cache-Control:
|
| 171 |
+
- no-cache
|
| 172 |
+
@@ -187,7 +195,7 @@ interactions:
|
| 173 |
+
Content-Type:
|
| 174 |
+
- application/json
|
| 175 |
+
Date:
|
| 176 |
+
- - Thu, 28 Oct 2021 20:26:19 GMT
|
| 177 |
+
+ - Tue, 09 Nov 2021 16:41:00 GMT
|
| 178 |
+
Pragma:
|
| 179 |
+
- no-cache
|
| 180 |
+
Strict-Transport-Security:
|
| 181 |
+
@@ -196,6 +204,8 @@ interactions:
|
| 182 |
+
- Accept-Encoding
|
| 183 |
+
X-Content-Type-Options:
|
| 184 |
+
- nosniff
|
| 185 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 186 |
+
+ - "83"
|
| 187 |
+
X-Frame-Options:
|
| 188 |
+
- SAMEORIGIN
|
| 189 |
+
status: 200 OK
|
| 190 |
+
@@ -210,11 +220,11 @@ interactions:
|
| 191 |
+
Dd-Operation-Id:
|
| 192 |
+
- ListAzureIntegration
|
| 193 |
+
User-Agent:
|
| 194 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 195 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 196 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 197 |
+
method: GET
|
| 198 |
+
response:
|
| 199 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451360","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451660","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452319","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452663","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-73061-1629707067","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 200 |
+
+ body: '[{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636473129","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80208-1636035966","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80608-1636466533","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 201 |
+
headers:
|
| 202 |
+
Cache-Control:
|
| 203 |
+
- no-cache
|
| 204 |
+
@@ -225,7 +235,7 @@ interactions:
|
| 205 |
+
Content-Type:
|
| 206 |
+
- application/json
|
| 207 |
+
Date:
|
| 208 |
+
- - Thu, 28 Oct 2021 20:26:19 GMT
|
| 209 |
+
+ - Tue, 09 Nov 2021 16:41:00 GMT
|
| 210 |
+
Pragma:
|
| 211 |
+
- no-cache
|
| 212 |
+
Strict-Transport-Security:
|
| 213 |
+
@@ -234,6 +244,8 @@ interactions:
|
| 214 |
+
- Accept-Encoding
|
| 215 |
+
X-Content-Type-Options:
|
| 216 |
+
- nosniff
|
| 217 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 218 |
+
+ - "90"
|
| 219 |
+
X-Frame-Options:
|
| 220 |
+
- SAMEORIGIN
|
| 221 |
+
status: 200 OK
|
| 222 |
+
@@ -248,11 +260,11 @@ interactions:
|
| 223 |
+
Dd-Operation-Id:
|
| 224 |
+
- ListAzureIntegration
|
| 225 |
+
User-Agent:
|
| 226 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 227 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 228 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 229 |
+
method: GET
|
| 230 |
+
response:
|
| 231 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451360","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451660","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452319","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452663","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-73061-1629707067","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 232 |
+
+ body: '[{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636473129","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80208-1636035966","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80608-1636466533","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 233 |
+
headers:
|
| 234 |
+
Cache-Control:
|
| 235 |
+
- no-cache
|
| 236 |
+
@@ -263,7 +275,7 @@ interactions:
|
| 237 |
+
Content-Type:
|
| 238 |
+
- application/json
|
| 239 |
+
Date:
|
| 240 |
+
- - Thu, 28 Oct 2021 20:26:20 GMT
|
| 241 |
+
+ - Tue, 09 Nov 2021 16:41:01 GMT
|
| 242 |
+
Pragma:
|
| 243 |
+
- no-cache
|
| 244 |
+
Strict-Transport-Security:
|
| 245 |
+
@@ -272,6 +284,8 @@ interactions:
|
| 246 |
+
- Accept-Encoding
|
| 247 |
+
X-Content-Type-Options:
|
| 248 |
+
- nosniff
|
| 249 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 250 |
+
+ - "66"
|
| 251 |
+
X-Frame-Options:
|
| 252 |
+
- SAMEORIGIN
|
| 253 |
+
status: 200 OK
|
| 254 |
+
@@ -286,11 +300,11 @@ interactions:
|
| 255 |
+
Dd-Operation-Id:
|
| 256 |
+
- ListAzureIntegration
|
| 257 |
+
User-Agent:
|
| 258 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 259 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 260 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 261 |
+
method: GET
|
| 262 |
+
response:
|
| 263 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451360","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451660","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452319","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452663","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-73061-1629707067","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 264 |
+
+ body: '[{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636473129","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80208-1636035966","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80608-1636466533","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 265 |
+
headers:
|
| 266 |
+
Cache-Control:
|
| 267 |
+
- no-cache
|
| 268 |
+
@@ -301,7 +315,7 @@ interactions:
|
| 269 |
+
Content-Type:
|
| 270 |
+
- application/json
|
| 271 |
+
Date:
|
| 272 |
+
- - Thu, 28 Oct 2021 20:26:20 GMT
|
| 273 |
+
+ - Tue, 09 Nov 2021 16:41:01 GMT
|
| 274 |
+
Pragma:
|
| 275 |
+
- no-cache
|
| 276 |
+
Strict-Transport-Security:
|
| 277 |
+
@@ -310,6 +324,8 @@ interactions:
|
| 278 |
+
- Accept-Encoding
|
| 279 |
+
X-Content-Type-Options:
|
| 280 |
+
- nosniff
|
| 281 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 282 |
+
+ - "73"
|
| 283 |
+
X-Frame-Options:
|
| 284 |
+
- SAMEORIGIN
|
| 285 |
+
status: 200 OK
|
| 286 |
+
@@ -324,11 +340,11 @@ interactions:
|
| 287 |
+
Dd-Operation-Id:
|
| 288 |
+
- ListAzureIntegration
|
| 289 |
+
User-Agent:
|
| 290 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 291 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 292 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 293 |
+
method: GET
|
| 294 |
+
response:
|
| 295 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451360","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451660","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452319","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452663","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-73061-1629707067","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 296 |
+
+ body: '[{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636473129","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80208-1636035966","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80608-1636466533","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 297 |
+
headers:
|
| 298 |
+
Cache-Control:
|
| 299 |
+
- no-cache
|
| 300 |
+
@@ -339,7 +355,7 @@ interactions:
|
| 301 |
+
Content-Type:
|
| 302 |
+
- application/json
|
| 303 |
+
Date:
|
| 304 |
+
- - Thu, 28 Oct 2021 20:26:20 GMT
|
| 305 |
+
+ - Tue, 09 Nov 2021 16:41:01 GMT
|
| 306 |
+
Pragma:
|
| 307 |
+
- no-cache
|
| 308 |
+
Strict-Transport-Security:
|
| 309 |
+
@@ -348,6 +364,8 @@ interactions:
|
| 310 |
+
- Accept-Encoding
|
| 311 |
+
X-Content-Type-Options:
|
| 312 |
+
- nosniff
|
| 313 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 314 |
+
+ - "81"
|
| 315 |
+
X-Frame-Options:
|
| 316 |
+
- SAMEORIGIN
|
| 317 |
+
status: 200 OK
|
| 318 |
+
@@ -355,19 +373,19 @@ interactions:
|
| 319 |
+
duration: ""
|
| 320 |
+
- request:
|
| 321 |
+
body: |
|
| 322 |
+
- {"client_id":"testc7f6-1234-5678-9101-3fcbf123test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"foo:bar,buzz:lightyear","tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773"}
|
| 323 |
+
+ {"automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"foo:bar,buzz:lightyear","tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054"}
|
| 324 |
+
form: {}
|
| 325 |
+
headers:
|
| 326 |
+
Accept:
|
| 327 |
+
- application/json
|
| 328 |
+
Content-Length:
|
| 329 |
+
- - "211"
|
| 330 |
+
+ - "228"
|
| 331 |
+
Content-Type:
|
| 332 |
+
- application/json
|
| 333 |
+
Dd-Operation-Id:
|
| 334 |
+
- DeleteAzureIntegration
|
| 335 |
+
User-Agent:
|
| 336 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 337 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 338 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 339 |
+
method: DELETE
|
| 340 |
+
response:
|
| 341 |
+
@@ -384,13 +402,15 @@ interactions:
|
| 342 |
+
Content-Type:
|
| 343 |
+
- application/json
|
| 344 |
+
Date:
|
| 345 |
+
- - Thu, 28 Oct 2021 20:26:21 GMT
|
| 346 |
+
+ - Tue, 09 Nov 2021 16:41:02 GMT
|
| 347 |
+
Pragma:
|
| 348 |
+
- no-cache
|
| 349 |
+
Strict-Transport-Security:
|
| 350 |
+
- max-age=15724800;
|
| 351 |
+
X-Content-Type-Options:
|
| 352 |
+
- nosniff
|
| 353 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 354 |
+
+ - "128"
|
| 355 |
+
X-Frame-Options:
|
| 356 |
+
- SAMEORIGIN
|
| 357 |
+
status: 200 OK
|
| 358 |
+
@@ -398,19 +418,19 @@ interactions:
|
| 359 |
+
duration: ""
|
| 360 |
+
- request:
|
| 361 |
+
body: |
|
| 362 |
+
- {"client_id":"testc7f6-1234-5678-9101-3fcbf464test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"","new_client_id":"testc7f6-1234-5678-9101-3fcbf464test","new_tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773"}
|
| 363 |
+
+ {"automute":true,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"","new_client_id":"testc7f6-1234-5678-9101-3fcbf464test","new_tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054"}
|
| 364 |
+
form: {}
|
| 365 |
+
headers:
|
| 366 |
+
Accept:
|
| 367 |
+
- application/json
|
| 368 |
+
Content-Length:
|
| 369 |
+
- - "315"
|
| 370 |
+
+ - "331"
|
| 371 |
+
Content-Type:
|
| 372 |
+
- application/json
|
| 373 |
+
Dd-Operation-Id:
|
| 374 |
+
- UpdateAzureIntegration
|
| 375 |
+
User-Agent:
|
| 376 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 377 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 378 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 379 |
+
method: PUT
|
| 380 |
+
response:
|
| 381 |
+
@@ -427,7 +447,7 @@ interactions:
|
| 382 |
+
Content-Type:
|
| 383 |
+
- application/json
|
| 384 |
+
Date:
|
| 385 |
+
- - Thu, 28 Oct 2021 20:26:23 GMT
|
| 386 |
+
+ - Tue, 09 Nov 2021 16:41:04 GMT
|
| 387 |
+
Pragma:
|
| 388 |
+
- no-cache
|
| 389 |
+
Strict-Transport-Security:
|
| 390 |
+
@@ -448,11 +468,11 @@ interactions:
|
| 391 |
+
Dd-Operation-Id:
|
| 392 |
+
- ListAzureIntegration
|
| 393 |
+
User-Agent:
|
| 394 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 395 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 396 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 397 |
+
method: GET
|
| 398 |
+
response:
|
| 399 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451360","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451660","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452319","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452663","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-73061-1629707067","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 400 |
+
+ body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636473129","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":true,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80208-1636035966","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80608-1636466533","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 401 |
+
headers:
|
| 402 |
+
Cache-Control:
|
| 403 |
+
- no-cache
|
| 404 |
+
@@ -463,7 +483,7 @@ interactions:
|
| 405 |
+
Content-Type:
|
| 406 |
+
- application/json
|
| 407 |
+
Date:
|
| 408 |
+
- - Thu, 28 Oct 2021 20:26:23 GMT
|
| 409 |
+
+ - Tue, 09 Nov 2021 16:41:04 GMT
|
| 410 |
+
Pragma:
|
| 411 |
+
- no-cache
|
| 412 |
+
Strict-Transport-Security:
|
| 413 |
+
@@ -472,6 +492,8 @@ interactions:
|
| 414 |
+
- Accept-Encoding
|
| 415 |
+
X-Content-Type-Options:
|
| 416 |
+
- nosniff
|
| 417 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 418 |
+
+ - "100"
|
| 419 |
+
X-Frame-Options:
|
| 420 |
+
- SAMEORIGIN
|
| 421 |
+
status: 200 OK
|
| 422 |
+
@@ -486,11 +508,11 @@ interactions:
|
| 423 |
+
Dd-Operation-Id:
|
| 424 |
+
- ListAzureIntegration
|
| 425 |
+
User-Agent:
|
| 426 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 427 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 428 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 429 |
+
method: GET
|
| 430 |
+
response:
|
| 431 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451360","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451660","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452319","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452663","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-73061-1629707067","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 432 |
+
+ body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636473129","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":true,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80208-1636035966","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80608-1636466533","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 433 |
+
headers:
|
| 434 |
+
Cache-Control:
|
| 435 |
+
- no-cache
|
| 436 |
+
@@ -501,7 +523,7 @@ interactions:
|
| 437 |
+
Content-Type:
|
| 438 |
+
- application/json
|
| 439 |
+
Date:
|
| 440 |
+
- - Thu, 28 Oct 2021 20:26:23 GMT
|
| 441 |
+
+ - Tue, 09 Nov 2021 16:41:04 GMT
|
| 442 |
+
Pragma:
|
| 443 |
+
- no-cache
|
| 444 |
+
Strict-Transport-Security:
|
| 445 |
+
@@ -510,6 +532,8 @@ interactions:
|
| 446 |
+
- Accept-Encoding
|
| 447 |
+
X-Content-Type-Options:
|
| 448 |
+
- nosniff
|
| 449 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 450 |
+
+ - "80"
|
| 451 |
+
X-Frame-Options:
|
| 452 |
+
- SAMEORIGIN
|
| 453 |
+
status: 200 OK
|
| 454 |
+
@@ -524,11 +548,11 @@ interactions:
|
| 455 |
+
Dd-Operation-Id:
|
| 456 |
+
- ListAzureIntegration
|
| 457 |
+
User-Agent:
|
| 458 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 459 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 460 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 461 |
+
method: GET
|
| 462 |
+
response:
|
| 463 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451360","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451660","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452319","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452663","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-73061-1629707067","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 464 |
+
+ body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636473129","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054","automute":true,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80208-1636035966","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80608-1636466533","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 465 |
+
headers:
|
| 466 |
+
Cache-Control:
|
| 467 |
+
- no-cache
|
| 468 |
+
@@ -539,7 +563,7 @@ interactions:
|
| 469 |
+
Content-Type:
|
| 470 |
+
- application/json
|
| 471 |
+
Date:
|
| 472 |
+
- - Thu, 28 Oct 2021 20:26:24 GMT
|
| 473 |
+
+ - Tue, 09 Nov 2021 16:41:05 GMT
|
| 474 |
+
Pragma:
|
| 475 |
+
- no-cache
|
| 476 |
+
Strict-Transport-Security:
|
| 477 |
+
@@ -548,6 +572,8 @@ interactions:
|
| 478 |
+
- Accept-Encoding
|
| 479 |
+
X-Content-Type-Options:
|
| 480 |
+
- nosniff
|
| 481 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 482 |
+
+ - "231"
|
| 483 |
+
X-Frame-Options:
|
| 484 |
+
- SAMEORIGIN
|
| 485 |
+
status: 200 OK
|
| 486 |
+
@@ -555,19 +581,19 @@ interactions:
|
| 487 |
+
duration: ""
|
| 488 |
+
- request:
|
| 489 |
+
body: |
|
| 490 |
+
- {"client_id":"testc7f6-1234-5678-9101-3fcbf464test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"","tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452773"}
|
| 491 |
+
+ {"automute":true,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"","tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636476054"}
|
| 492 |
+
form: {}
|
| 493 |
+
headers:
|
| 494 |
+
Accept:
|
| 495 |
+
- application/json
|
| 496 |
+
Content-Length:
|
| 497 |
+
- - "189"
|
| 498 |
+
+ - "205"
|
| 499 |
+
Content-Type:
|
| 500 |
+
- application/json
|
| 501 |
+
Dd-Operation-Id:
|
| 502 |
+
- DeleteAzureIntegration
|
| 503 |
+
User-Agent:
|
| 504 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 505 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 506 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 507 |
+
method: DELETE
|
| 508 |
+
response:
|
| 509 |
+
@@ -584,13 +610,15 @@ interactions:
|
| 510 |
+
Content-Type:
|
| 511 |
+
- application/json
|
| 512 |
+
Date:
|
| 513 |
+
- - Thu, 28 Oct 2021 20:26:24 GMT
|
| 514 |
+
+ - Tue, 09 Nov 2021 16:41:06 GMT
|
| 515 |
+
Pragma:
|
| 516 |
+
- no-cache
|
| 517 |
+
Strict-Transport-Security:
|
| 518 |
+
- max-age=15724800;
|
| 519 |
+
X-Content-Type-Options:
|
| 520 |
+
- nosniff
|
| 521 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 522 |
+
+ - "105"
|
| 523 |
+
X-Frame-Options:
|
| 524 |
+
- SAMEORIGIN
|
| 525 |
+
status: 200 OK
|
| 526 |
+
@@ -605,11 +633,11 @@ interactions:
|
| 527 |
+
Dd-Operation-Id:
|
| 528 |
+
- ListAzureIntegration
|
| 529 |
+
User-Agent:
|
| 530 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 531 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.5.1+dev (go go1.16.5; os darwin; arch amd64)
|
| 532 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 533 |
+
method: GET
|
| 534 |
+
response:
|
| 535 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451360","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451660","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452319","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635452663","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf123test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1635451549","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-73061-1629707067","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 536 |
+
+ body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogIntegrationAzure-local-1636473129","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":"foo:bar,buzz:lightyear"},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80208-1636035966","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-80608-1636466533","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 537 |
+
headers:
|
| 538 |
+
Cache-Control:
|
| 539 |
+
- no-cache
|
| 540 |
+
@@ -620,7 +648,7 @@ interactions:
|
| 541 |
+
Content-Type:
|
| 542 |
+
- application/json
|
| 543 |
+
Date:
|
| 544 |
+
- - Thu, 28 Oct 2021 20:26:24 GMT
|
| 545 |
+
+ - Tue, 09 Nov 2021 16:41:06 GMT
|
| 546 |
+
Pragma:
|
| 547 |
+
- no-cache
|
| 548 |
+
Strict-Transport-Security:
|
| 549 |
+
@@ -629,6 +657,8 @@ interactions:
|
| 550 |
+
- Accept-Encoding
|
| 551 |
+
X-Content-Type-Options:
|
| 552 |
+
- nosniff
|
| 553 |
+
+ X-Envoy-Upstream-Service-Time:
|
| 554 |
+
+ - "117"
|
| 555 |
+
X-Frame-Options:
|
| 556 |
+
- SAMEORIGIN
|
| 557 |
+
status: 200 OK
|
| 558 |
+
diff --git a/datadog/tests/cassettes/TestAccDatadogLogsArchiveAzure_basic.freeze b/datadog/tests/cassettes/TestAccDatadogLogsArchiveAzure_basic.freeze
|
| 559 |
+
index 14c734444a..db2b5de8b6 100644
|
| 560 |
+
--- a/datadog/tests/cassettes/TestAccDatadogLogsArchiveAzure_basic.freeze
|
| 561 |
+
+++ b/datadog/tests/cassettes/TestAccDatadogLogsArchiveAzure_basic.freeze
|
| 562 |
+
@@ -1 +1 @@
|
| 563 |
+
-2021-06-29T17:45:38.413586+02:00
|
| 564 |
+
|
| 565 |
+
+2021-11-01T16:22:40.665642-04:00
|
| 566 |
+
|
| 567 |
+
diff --git a/datadog/tests/cassettes/TestAccDatadogLogsArchiveAzure_basic.yaml b/datadog/tests/cassettes/TestAccDatadogLogsArchiveAzure_basic.yaml
|
| 568 |
+
index d62f4e57df..04b1be9188 100644
|
| 569 |
+
--- a/datadog/tests/cassettes/TestAccDatadogLogsArchiveAzure_basic.yaml
|
| 570 |
+
+++ b/datadog/tests/cassettes/TestAccDatadogLogsArchiveAzure_basic.yaml
|
| 571 |
+
@@ -3,17 +3,19 @@ version: 1
|
| 572 |
+
interactions:
|
| 573 |
+
- request:
|
| 574 |
+
body: |
|
| 575 |
+
- {"client_id":"testc7f6-1234-5678-9101-3fcbf464test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"","tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1624981538"}
|
| 576 |
+
+ {"automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"","tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1635798160"}
|
| 577 |
+
form: {}
|
| 578 |
+
headers:
|
| 579 |
+
Accept:
|
| 580 |
+
- application/json
|
| 581 |
+
+ Content-Length:
|
| 582 |
+
+ - "212"
|
| 583 |
+
Content-Type:
|
| 584 |
+
- application/json
|
| 585 |
+
Dd-Operation-Id:
|
| 586 |
+
- CreateAzureIntegration
|
| 587 |
+
User-Agent:
|
| 588 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.1.1+dev (go go1.16; os darwin; arch amd64)
|
| 589 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 590 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 591 |
+
method: POST
|
| 592 |
+
response:
|
| 593 |
+
@@ -30,15 +32,13 @@ interactions:
|
| 594 |
+
Content-Type:
|
| 595 |
+
- application/json
|
| 596 |
+
Date:
|
| 597 |
+
- - Tue, 29 Jun 2021 15:45:41 GMT
|
| 598 |
+
+ - Mon, 01 Nov 2021 20:22:43 GMT
|
| 599 |
+
Pragma:
|
| 600 |
+
- no-cache
|
| 601 |
+
Strict-Transport-Security:
|
| 602 |
+
- max-age=15724800;
|
| 603 |
+
X-Content-Type-Options:
|
| 604 |
+
- nosniff
|
| 605 |
+
- X-Dd-Debug:
|
| 606 |
+
- - F5gm0Rce1/Abr9/0Fw8HAqWfiz0FdiH8er/AXnN6lOn3L6KyGgbsLCwgPlob1No8
|
| 607 |
+
X-Frame-Options:
|
| 608 |
+
- SAMEORIGIN
|
| 609 |
+
status: 200 OK
|
| 610 |
+
@@ -53,11 +53,11 @@ interactions:
|
| 611 |
+
Dd-Operation-Id:
|
| 612 |
+
- ListAzureIntegration
|
| 613 |
+
User-Agent:
|
| 614 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.1.1+dev (go go1.16; os darwin; arch amd64)
|
| 615 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 616 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 617 |
+
method: GET
|
| 618 |
+
response:
|
| 619 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1624981538","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"Test-Go-TestAzureListandDelete-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-tt1620302652","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"Test-Go-TestUpdateAzureAccount-1620842745-updated","automute":false,"client_id":"testc7f6-1234-5678-9101-uu1620842745","host_filters":"test:foo,test:bar"}]'
|
| 620 |
+
+ body: '[{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1635798160","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 621 |
+
headers:
|
| 622 |
+
Cache-Control:
|
| 623 |
+
- no-cache
|
| 624 |
+
@@ -68,7 +68,7 @@ interactions:
|
| 625 |
+
Content-Type:
|
| 626 |
+
- application/json
|
| 627 |
+
Date:
|
| 628 |
+
- - Tue, 29 Jun 2021 15:45:41 GMT
|
| 629 |
+
+ - Mon, 01 Nov 2021 20:22:43 GMT
|
| 630 |
+
Pragma:
|
| 631 |
+
- no-cache
|
| 632 |
+
Strict-Transport-Security:
|
| 633 |
+
@@ -77,8 +77,6 @@ interactions:
|
| 634 |
+
- Accept-Encoding
|
| 635 |
+
X-Content-Type-Options:
|
| 636 |
+
- nosniff
|
| 637 |
+
- X-Dd-Debug:
|
| 638 |
+
- - JpIJLwIH2nFlZOC+u71rq7aAOL43MLZN3MUsL+gpYHdZz5QLUOG8Jysf8kVK6tPU
|
| 639 |
+
X-Frame-Options:
|
| 640 |
+
- SAMEORIGIN
|
| 641 |
+
status: 200 OK
|
| 642 |
+
@@ -86,21 +84,23 @@ interactions:
|
| 643 |
+
duration: ""
|
| 644 |
+
- request:
|
| 645 |
+
body: |
|
| 646 |
+
- {"data":{"attributes":{"destination":{"container":"my-container","integration":{"client_id":"testc7f6-1234-5678-9101-3fcbf464test","tenant_id":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1624981538"},"path":"/path/blou","storage_account":"storageaccount","type":"azure"},"include_tags":false,"name":"my first azure archive","query":"service:toto","rehydration_tags":[]},"type":"archives"}}
|
| 647 |
+
+ {"data":{"attributes":{"destination":{"container":"my-container","integration":{"client_id":"testc7f6-1234-5678-9101-3fcbf464test","tenant_id":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1635798160"},"path":"/path/blou","storage_account":"storageaccount","type":"azure"},"include_tags":false,"name":"my first azure archive","query":"service:toto","rehydration_tags":[]},"type":"archives"}}
|
| 648 |
+
form: {}
|
| 649 |
+
headers:
|
| 650 |
+
Accept:
|
| 651 |
+
- application/json
|
| 652 |
+
+ Content-Length:
|
| 653 |
+
+ - "393"
|
| 654 |
+
Content-Type:
|
| 655 |
+
- application/json
|
| 656 |
+
Dd-Operation-Id:
|
| 657 |
+
- CreateLogsArchive
|
| 658 |
+
User-Agent:
|
| 659 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.1.1+dev (go go1.16; os darwin; arch amd64)
|
| 660 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 661 |
+
url: https://api.datadoghq.com/api/v2/logs/config/archives
|
| 662 |
+
method: POST
|
| 663 |
+
response:
|
| 664 |
+
- body: '{"data":{"type":"archives","id":"n_XDSxVpScepiBnyhysj_A","attributes":{"name":"my first azure archive","query":"service:toto","state":"UNKNOWN","destination":{"container":"my-container","storage_account":"storageaccount","path":"/path/blou","type":"azure","integration":{"tenant_id":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1624981538","client_id":"testc7f6-1234-5678-9101-3fcbf464test"}},"rehydration_tags":[],"include_tags":false}}}'
|
| 665 |
+
+ body: '{"data":{"type":"archives","id":"EKb3-dVIS-KPD2tuPjavSg","attributes":{"name":"my first azure archive","query":"service:toto","state":"UNKNOWN","destination":{"container":"my-container","storage_account":"storageaccount","path":"/path/blou","type":"azure","integration":{"tenant_id":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1635798160","client_id":"testc7f6-1234-5678-9101-3fcbf464test"}},"rehydration_tags":[],"include_tags":false}}}'
|
| 666 |
+
headers:
|
| 667 |
+
Cache-Control:
|
| 668 |
+
- no-cache
|
| 669 |
+
@@ -111,7 +111,7 @@ interactions:
|
| 670 |
+
Content-Type:
|
| 671 |
+
- application/json
|
| 672 |
+
Date:
|
| 673 |
+
- - Tue, 29 Jun 2021 15:45:41 GMT
|
| 674 |
+
+ - Mon, 01 Nov 2021 20:22:44 GMT
|
| 675 |
+
Pragma:
|
| 676 |
+
- no-cache
|
| 677 |
+
Strict-Transport-Security:
|
| 678 |
+
@@ -120,8 +120,6 @@ interactions:
|
| 679 |
+
- Accept-Encoding
|
| 680 |
+
X-Content-Type-Options:
|
| 681 |
+
- nosniff
|
| 682 |
+
- X-Dd-Debug:
|
| 683 |
+
- - HbtaOKlJ6OCrx9tMXO6ivMTrEM+g0c93HDp08trmOmgdHozC5J+vn10F0H4WPjCU
|
| 684 |
+
X-Frame-Options:
|
| 685 |
+
- SAMEORIGIN
|
| 686 |
+
X-Ratelimit-Limit:
|
| 687 |
+
@@ -131,7 +129,7 @@ interactions:
|
| 688 |
+
X-Ratelimit-Remaining:
|
| 689 |
+
- "29"
|
| 690 |
+
X-Ratelimit-Reset:
|
| 691 |
+
- - "9"
|
| 692 |
+
+ - "6"
|
| 693 |
+
status: 200 OK
|
| 694 |
+
code: 200
|
| 695 |
+
duration: ""
|
| 696 |
+
@@ -144,11 +142,11 @@ interactions:
|
| 697 |
+
Dd-Operation-Id:
|
| 698 |
+
- GetLogsArchive
|
| 699 |
+
User-Agent:
|
| 700 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.1.1+dev (go go1.16; os darwin; arch amd64)
|
| 701 |
+
- url: https://api.datadoghq.com/api/v2/logs/config/archives/n_XDSxVpScepiBnyhysj_A
|
| 702 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 703 |
+
+ url: https://api.datadoghq.com/api/v2/logs/config/archives/EKb3-dVIS-KPD2tuPjavSg
|
| 704 |
+
method: GET
|
| 705 |
+
response:
|
| 706 |
+
- body: '{"data":{"type":"archives","id":"n_XDSxVpScepiBnyhysj_A","attributes":{"name":"my first azure archive","query":"service:toto","state":"UNKNOWN","destination":{"container":"my-container","storage_account":"storageaccount","path":"/path/blou","type":"azure","integration":{"tenant_id":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1624981538","client_id":"testc7f6-1234-5678-9101-3fcbf464test"}},"rehydration_tags":[],"include_tags":false}}}'
|
| 707 |
+
+ body: '{"data":{"type":"archives","id":"EKb3-dVIS-KPD2tuPjavSg","attributes":{"name":"my first azure archive","query":"service:toto","state":"UNKNOWN","destination":{"container":"my-container","storage_account":"storageaccount","path":"/path/blou","type":"azure","integration":{"tenant_id":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1635798160","client_id":"testc7f6-1234-5678-9101-3fcbf464test"}},"rehydration_tags":[],"include_tags":false}}}'
|
| 708 |
+
headers:
|
| 709 |
+
Cache-Control:
|
| 710 |
+
- no-cache
|
| 711 |
+
@@ -159,7 +157,7 @@ interactions:
|
| 712 |
+
Content-Type:
|
| 713 |
+
- application/json
|
| 714 |
+
Date:
|
| 715 |
+
- - Tue, 29 Jun 2021 15:45:41 GMT
|
| 716 |
+
+ - Mon, 01 Nov 2021 20:22:44 GMT
|
| 717 |
+
Pragma:
|
| 718 |
+
- no-cache
|
| 719 |
+
Strict-Transport-Security:
|
| 720 |
+
@@ -168,8 +166,6 @@ interactions:
|
| 721 |
+
- Accept-Encoding
|
| 722 |
+
X-Content-Type-Options:
|
| 723 |
+
- nosniff
|
| 724 |
+
- X-Dd-Debug:
|
| 725 |
+
- - PhosSd3Ch1B6B0DXI71steKUi7XhPDttnPiIP1NdXTw0VJNWpoUnYyBmODS5ne3q
|
| 726 |
+
X-Frame-Options:
|
| 727 |
+
- SAMEORIGIN
|
| 728 |
+
X-Ratelimit-Limit:
|
| 729 |
+
@@ -179,7 +175,7 @@ interactions:
|
| 730 |
+
X-Ratelimit-Remaining:
|
| 731 |
+
- "29"
|
| 732 |
+
X-Ratelimit-Reset:
|
| 733 |
+
- - "9"
|
| 734 |
+
+ - "6"
|
| 735 |
+
status: 200 OK
|
| 736 |
+
code: 200
|
| 737 |
+
duration: ""
|
| 738 |
+
@@ -192,11 +188,11 @@ interactions:
|
| 739 |
+
Dd-Operation-Id:
|
| 740 |
+
- ListAzureIntegration
|
| 741 |
+
User-Agent:
|
| 742 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.1.1+dev (go go1.16; os darwin; arch amd64)
|
| 743 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 744 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 745 |
+
method: GET
|
| 746 |
+
response:
|
| 747 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1624981538","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"Test-Go-TestAzureListandDelete-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-tt1620302652","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"Test-Go-TestUpdateAzureAccount-1620842745-updated","automute":false,"client_id":"testc7f6-1234-5678-9101-uu1620842745","host_filters":"test:foo,test:bar"}]'
|
| 748 |
+
+ body: '[{"errors":[],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1635798160","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""}]'
|
| 749 |
+
headers:
|
| 750 |
+
Cache-Control:
|
| 751 |
+
- no-cache
|
| 752 |
+
@@ -207,7 +203,7 @@ interactions:
|
| 753 |
+
Content-Type:
|
| 754 |
+
- application/json
|
| 755 |
+
Date:
|
| 756 |
+
- - Tue, 29 Jun 2021 15:45:42 GMT
|
| 757 |
+
+ - Mon, 01 Nov 2021 20:22:45 GMT
|
| 758 |
+
Pragma:
|
| 759 |
+
- no-cache
|
| 760 |
+
Strict-Transport-Security:
|
| 761 |
+
@@ -216,8 +212,6 @@ interactions:
|
| 762 |
+
- Accept-Encoding
|
| 763 |
+
X-Content-Type-Options:
|
| 764 |
+
- nosniff
|
| 765 |
+
- X-Dd-Debug:
|
| 766 |
+
- - tpRCH6w417YjBovRJ8VmtuXmNONVYiRp2c8d2AxjPdGBn8PCtgG4vAztrx3qUZAN
|
| 767 |
+
X-Frame-Options:
|
| 768 |
+
- SAMEORIGIN
|
| 769 |
+
status: 200 OK
|
| 770 |
+
@@ -232,11 +226,11 @@ interactions:
|
| 771 |
+
Dd-Operation-Id:
|
| 772 |
+
- GetLogsArchive
|
| 773 |
+
User-Agent:
|
| 774 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.1.1+dev (go go1.16; os darwin; arch amd64)
|
| 775 |
+
- url: https://api.datadoghq.com/api/v2/logs/config/archives/n_XDSxVpScepiBnyhysj_A
|
| 776 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 777 |
+
+ url: https://api.datadoghq.com/api/v2/logs/config/archives/EKb3-dVIS-KPD2tuPjavSg
|
| 778 |
+
method: GET
|
| 779 |
+
response:
|
| 780 |
+
- body: '{"data":{"type":"archives","id":"n_XDSxVpScepiBnyhysj_A","attributes":{"name":"my first azure archive","query":"service:toto","state":"UNKNOWN","destination":{"container":"my-container","storage_account":"storageaccount","path":"/path/blou","type":"azure","integration":{"tenant_id":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1624981538","client_id":"testc7f6-1234-5678-9101-3fcbf464test"}},"rehydration_tags":[],"include_tags":false}}}'
|
| 781 |
+
+ body: '{"data":{"type":"archives","id":"EKb3-dVIS-KPD2tuPjavSg","attributes":{"name":"my first azure archive","query":"service:toto","state":"UNKNOWN","destination":{"container":"my-container","storage_account":"storageaccount","path":"/path/blou","type":"azure","integration":{"tenant_id":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1635798160","client_id":"testc7f6-1234-5678-9101-3fcbf464test"}},"rehydration_tags":[],"include_tags":false}}}'
|
| 782 |
+
headers:
|
| 783 |
+
Cache-Control:
|
| 784 |
+
- no-cache
|
| 785 |
+
@@ -247,7 +241,7 @@ interactions:
|
| 786 |
+
Content-Type:
|
| 787 |
+
- application/json
|
| 788 |
+
Date:
|
| 789 |
+
- - Tue, 29 Jun 2021 15:45:42 GMT
|
| 790 |
+
+ - Mon, 01 Nov 2021 20:22:45 GMT
|
| 791 |
+
Pragma:
|
| 792 |
+
- no-cache
|
| 793 |
+
Strict-Transport-Security:
|
| 794 |
+
@@ -256,8 +250,6 @@ interactions:
|
| 795 |
+
- Accept-Encoding
|
| 796 |
+
X-Content-Type-Options:
|
| 797 |
+
- nosniff
|
| 798 |
+
- X-Dd-Debug:
|
| 799 |
+
- - SY1h8ScsWq+kYmtbh63ltMLFAZsQjqfrgvdfAoRX+9TzT1sgMBRYaFRwfWWRRe9a
|
| 800 |
+
X-Frame-Options:
|
| 801 |
+
- SAMEORIGIN
|
| 802 |
+
X-Ratelimit-Limit:
|
| 803 |
+
@@ -267,7 +259,7 @@ interactions:
|
| 804 |
+
X-Ratelimit-Remaining:
|
| 805 |
+
- "28"
|
| 806 |
+
X-Ratelimit-Reset:
|
| 807 |
+
- - "8"
|
| 808 |
+
+ - "5"
|
| 809 |
+
status: 200 OK
|
| 810 |
+
code: 200
|
| 811 |
+
duration: ""
|
| 812 |
+
@@ -280,8 +272,8 @@ interactions:
|
| 813 |
+
Dd-Operation-Id:
|
| 814 |
+
- DeleteLogsArchive
|
| 815 |
+
User-Agent:
|
| 816 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.1.1+dev (go go1.16; os darwin; arch amd64)
|
| 817 |
+
- url: https://api.datadoghq.com/api/v2/logs/config/archives/n_XDSxVpScepiBnyhysj_A
|
| 818 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 819 |
+
+ url: https://api.datadoghq.com/api/v2/logs/config/archives/EKb3-dVIS-KPD2tuPjavSg
|
| 820 |
+
method: DELETE
|
| 821 |
+
response:
|
| 822 |
+
body: ""
|
| 823 |
+
@@ -294,18 +286,14 @@ interactions:
|
| 824 |
+
- "0"
|
| 825 |
+
Content-Security-Policy:
|
| 826 |
+
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
|
| 827 |
+
- Content-Type:
|
| 828 |
+
- - application/json
|
| 829 |
+
Date:
|
| 830 |
+
- - Tue, 29 Jun 2021 15:45:43 GMT
|
| 831 |
+
+ - Mon, 01 Nov 2021 20:22:46 GMT
|
| 832 |
+
Pragma:
|
| 833 |
+
- no-cache
|
| 834 |
+
Strict-Transport-Security:
|
| 835 |
+
- max-age=15724800;
|
| 836 |
+
X-Content-Type-Options:
|
| 837 |
+
- nosniff
|
| 838 |
+
- X-Dd-Debug:
|
| 839 |
+
- - LcgNasIYBRkNppmD6mCKE9J6iv0eEjosuuHR5V5zw2fWbR54i39C8dhdK8zDq/40
|
| 840 |
+
X-Frame-Options:
|
| 841 |
+
- SAMEORIGIN
|
| 842 |
+
X-Ratelimit-Limit:
|
| 843 |
+
@@ -315,23 +303,25 @@ interactions:
|
| 844 |
+
X-Ratelimit-Remaining:
|
| 845 |
+
- "28"
|
| 846 |
+
X-Ratelimit-Reset:
|
| 847 |
+
- - "7"
|
| 848 |
+
+ - "4"
|
| 849 |
+
status: 204 No Content
|
| 850 |
+
code: 204
|
| 851 |
+
duration: ""
|
| 852 |
+
- request:
|
| 853 |
+
body: |
|
| 854 |
+
- {"client_id":"testc7f6-1234-5678-9101-3fcbf464test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"","tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1624981538"}
|
| 855 |
+
+ {"automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","host_filters":"","tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-local-1635798160"}
|
| 856 |
+
form: {}
|
| 857 |
+
headers:
|
| 858 |
+
Accept:
|
| 859 |
+
- application/json
|
| 860 |
+
+ Content-Length:
|
| 861 |
+
+ - "212"
|
| 862 |
+
Content-Type:
|
| 863 |
+
- application/json
|
| 864 |
+
Dd-Operation-Id:
|
| 865 |
+
- DeleteAzureIntegration
|
| 866 |
+
User-Agent:
|
| 867 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.1.1+dev (go go1.16; os darwin; arch amd64)
|
| 868 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 869 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 870 |
+
method: DELETE
|
| 871 |
+
response:
|
| 872 |
+
@@ -348,15 +338,13 @@ interactions:
|
| 873 |
+
Content-Type:
|
| 874 |
+
- application/json
|
| 875 |
+
Date:
|
| 876 |
+
- - Tue, 29 Jun 2021 15:45:43 GMT
|
| 877 |
+
+ - Mon, 01 Nov 2021 20:22:47 GMT
|
| 878 |
+
Pragma:
|
| 879 |
+
- no-cache
|
| 880 |
+
Strict-Transport-Security:
|
| 881 |
+
- max-age=15724800;
|
| 882 |
+
X-Content-Type-Options:
|
| 883 |
+
- nosniff
|
| 884 |
+
- X-Dd-Debug:
|
| 885 |
+
- - EFjE6I+AUQmTiNqZcuE1nqoFeAjWD0Xtzy3edDrinkwlU/Wzr/2Dbl5kWk3qLVaQ
|
| 886 |
+
X-Frame-Options:
|
| 887 |
+
- SAMEORIGIN
|
| 888 |
+
status: 200 OK
|
| 889 |
+
@@ -371,11 +359,11 @@ interactions:
|
| 890 |
+
Dd-Operation-Id:
|
| 891 |
+
- GetLogsArchive
|
| 892 |
+
User-Agent:
|
| 893 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.1.1+dev (go go1.16; os darwin; arch amd64)
|
| 894 |
+
- url: https://api.datadoghq.com/api/v2/logs/config/archives/n_XDSxVpScepiBnyhysj_A
|
| 895 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 896 |
+
+ url: https://api.datadoghq.com/api/v2/logs/config/archives/EKb3-dVIS-KPD2tuPjavSg
|
| 897 |
+
method: GET
|
| 898 |
+
response:
|
| 899 |
+
- body: '{"errors": ["Archive n_XDSxVpScepiBnyhysj_A not found"]}'
|
| 900 |
+
+ body: '{"errors": ["Archive EKb3-dVIS-KPD2tuPjavSg not found"]}'
|
| 901 |
+
headers:
|
| 902 |
+
Cache-Control:
|
| 903 |
+
- no-cache
|
| 904 |
+
@@ -386,7 +374,7 @@ interactions:
|
| 905 |
+
Content-Type:
|
| 906 |
+
- application/json
|
| 907 |
+
Date:
|
| 908 |
+
- - Tue, 29 Jun 2021 15:45:43 GMT
|
| 909 |
+
+ - Mon, 01 Nov 2021 20:22:47 GMT
|
| 910 |
+
Pragma:
|
| 911 |
+
- no-cache
|
| 912 |
+
Strict-Transport-Security:
|
| 913 |
+
@@ -404,7 +392,7 @@ interactions:
|
| 914 |
+
X-Ratelimit-Remaining:
|
| 915 |
+
- "27"
|
| 916 |
+
X-Ratelimit-Reset:
|
| 917 |
+
- - "7"
|
| 918 |
+
+ - "3"
|
| 919 |
+
status: 404 Not Found
|
| 920 |
+
code: 404
|
| 921 |
+
duration: ""
|
| 922 |
+
@@ -417,34 +405,32 @@ interactions:
|
| 923 |
+
Dd-Operation-Id:
|
| 924 |
+
- ListAzureIntegration
|
| 925 |
+
User-Agent:
|
| 926 |
+
- - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 1.0.0) datadog-api-client-go/1.1.1+dev (go go1.16; os darwin; arch amd64)
|
| 927 |
+
+ - terraform-provider-datadog/dev (terraform 2.7.0; terraform-cli 0.14.7) datadog-api-client-go/1.5.1+dev (go go1.17; os darwin; arch amd64)
|
| 928 |
+
url: https://api.datadoghq.com/api/v1/integration/azure
|
| 929 |
+
method: GET
|
| 930 |
+
response:
|
| 931 |
+
- body: '[{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basic-62270-1620302653","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"tf-TestAccDatadogLogsArchiveAzure_basicDeprecated-62270-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-3fcbf464test","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"Test-Go-TestAzureListandDelete-1620302652","automute":false,"client_id":"testc7f6-1234-5678-9101-tt1620302652","host_filters":""},{"errors":["Invalid credentials. Datadog could not authenticate with Azure."],"warnings":[],"tenant_name":"Test-Go-TestUpdateAzureAccount-1620842745-updated","automute":false,"client_id":"testc7f6-1234-5678-9101-uu1620842745","host_filters":"test:foo,test:bar"}]'
|
| 932 |
+
+ body: '{"errors": ["Azure Integration not yet installed. Please install before performing this action."]}'
|
| 933 |
+
headers:
|
| 934 |
+
Cache-Control:
|
| 935 |
+
- no-cache
|
| 936 |
+
Connection:
|
| 937 |
+
- keep-alive
|
| 938 |
+
+ Content-Length:
|
| 939 |
+
+ - "98"
|
| 940 |
+
Content-Security-Policy:
|
| 941 |
+
- frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report
|
| 942 |
+
Content-Type:
|
| 943 |
+
- application/json
|
| 944 |
+
Date:
|
| 945 |
+
- - Tue, 29 Jun 2021 15:45:43 GMT
|
| 946 |
+
+ - Mon, 01 Nov 2021 20:22:47 GMT
|
| 947 |
+
Pragma:
|
| 948 |
+
- no-cache
|
| 949 |
+
Strict-Transport-Security:
|
| 950 |
+
- max-age=15724800;
|
| 951 |
+
- Vary:
|
| 952 |
+
- - Accept-Encoding
|
| 953 |
+
X-Content-Type-Options:
|
| 954 |
+
- nosniff
|
| 955 |
+
- X-Dd-Debug:
|
| 956 |
+
- - vdJ3/nHEY1ioXQ6pQrBVvsQK1s4yyc+wufBMPSoXql71qZVuP/xMdtNo6DafhOAk
|
| 957 |
+
X-Frame-Options:
|
| 958 |
+
- SAMEORIGIN
|
| 959 |
+
- status: 200 OK
|
| 960 |
+
- code: 200
|
| 961 |
+
+ status: 400 Bad Request
|
| 962 |
+
+ code: 400
|
| 963 |
+
duration: ""
|
| 964 |
+
diff --git a/datadog/tests/resource_datadog_integration_azure_test.go b/datadog/tests/resource_datadog_integration_azure_test.go
|
| 965 |
+
index 531344289a..6286690034 100644
|
| 966 |
+
--- a/datadog/tests/resource_datadog_integration_azure_test.go
|
| 967 |
+
+++ b/datadog/tests/resource_datadog_integration_azure_test.go
|
| 968 |
+
@@ -25,6 +25,7 @@ resource "datadog_integration_azure" "an_azure_integration" {
|
| 969 |
+
}
|
| 970 |
+
|
| 971 |
+
resource "datadog_integration_azure" "an_azure_integration_two" {
|
| 972 |
+
+ depends_on = [datadog_integration_azure.an_azure_integration]
|
| 973 |
+
tenant_name = "%[1]s"
|
| 974 |
+
client_id = "testc7f6-1234-5678-9101-3fcbf123test"
|
| 975 |
+
client_secret = "testingx./Sw*g/Y33t..R1cH+hScMDt"
|
| 976 |
+
@@ -38,6 +39,7 @@ resource "datadog_integration_azure" "an_azure_integration" {
|
| 977 |
+
tenant_name = "%s"
|
| 978 |
+
client_id = "testc7f6-1234-5678-9101-3fcbf464test"
|
| 979 |
+
client_secret = "testingx./Sw*g/Y33t..R1cH+hScMDt"
|
| 980 |
+
+ automute = true
|
| 981 |
+
}`, uniq)
|
| 982 |
+
}
|
| 983 |
+
|
| 984 |
+
@@ -68,7 +70,9 @@ func TestAccDatadogIntegrationAzure(t *testing.T) {
|
| 985 |
+
"datadog_integration_azure.an_azure_integration",
|
| 986 |
+
"host_filters", "foo:bar,buzz:lightyear"),
|
| 987 |
+
resource.TestCheckResourceAttr(
|
| 988 |
+
- "datadog_integration_azure.an_azure_integration_two",
|
| 989 |
+
+ "datadog_integration_azure.an_azure_integration",
|
| 990 |
+
+ "automute", "false"),
|
| 991 |
+
+ resource.TestCheckResourceAttr("datadog_integration_azure.an_azure_integration_two",
|
| 992 |
+
"tenant_name", tenantName),
|
| 993 |
+
resource.TestCheckResourceAttr(
|
| 994 |
+
"datadog_integration_azure.an_azure_integration_two",
|
| 995 |
+
@@ -91,6 +95,9 @@ func TestAccDatadogIntegrationAzure(t *testing.T) {
|
| 996 |
+
resource.TestCheckResourceAttr(
|
| 997 |
+
"datadog_integration_azure.an_azure_integration",
|
| 998 |
+
"host_filters", ""),
|
| 999 |
+
+ resource.TestCheckResourceAttr(
|
| 1000 |
+
+ "datadog_integration_azure.an_azure_integration",
|
| 1001 |
+
+ "automute", "true"),
|
| 1002 |
+
),
|
| 1003 |
+
},
|
| 1004 |
+
},
|
| 1005 |
+
diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64
|
| 1006 |
+
new file mode 100644
|
| 1007 |
+
--- /dev/null
|
| 1008 |
+
+++ b/mimo_build_env.tar.gz.b64
|
| 1009 |
+
@@ -0,0 +1,12 @@
|
| 1010 |
+
+H4sIAAAAAAAAA+2Tb0/bMBDG+zqf4tCkFbQlaQpppU1MqihsaExMpS8nRa5zTTKldmY75Y/48Luk
|
| 1011 |
+
+0AIa4w1omrjfmyRn5+7xPedgVhdlmqBahp2XokcM47h9Eg+f7XsU96NosBsNm3gUxcO4A/GLKbpD
|
| 1012 |
+
+bZ0wAB2jtfvbvqfW/1OCjf8OrUukXiyESgObP1+NJ/yP4t3+2v+9YeP/3iAadKD3fBIe55X7L1No
|
| 1013 |
+
+jZ9h6nlv4FDZ2iBIbQxKB581LNHYQisvxaVvzwsnc8g0REF/F/qfQoqGqi5LuL4GZ2pschwraimF
|
| 1014 |
+
+pmiMmGuzgF4QxUEMxRyUdlAZtKgcbJ+Nv0Kqz1WpRWqhFI0OmF1CinNRl+495TrPCypYW7RASR1C
|
| 1015 |
+
+k0+4W1WkoweFoqGthCtmJQIpzMHdVvZ/Wtq0pPr9oLfjkYAtuJlw8JebffD2/lG27izdlrp3WsgM
|
| 1016 |
+
+VuD/gm6TPO5+BJej8oCQtSnBt2cn4Gvq7aIK17mCq6KC3LnKfghDgyUKOliQC0un1KYKSNpmc7jq
|
| 1017 |
+
+2iaQrAJJWaj6IhGLdLDXJGyL1qpJ/eeCPllcWxOWWooynBUqXOnMFzqFdxcPF9c/e/OisXN841Az
|
| 1018 |
+
+DPRHTU1OsUKVopIFWi9rw2sjm18mtWr6AXSzMnQgpMTKCSUpQhZb8rNQGUhhLTrylFpZikvYnhwe
|
| 1019 |
+
+nE7G+3NRWtzxpkfJ6OBgP4LVSzI9nExGR6eTb8n30fTL/mOq4W4W+NEelSS2s0WW+4a0daf0NZJy
|
| 1020 |
+
+LJxIdXasHGaGBkir0RWN//X95ROd2ZGRebHEdrl7kzUI09WG9gLZEHxXLFDXDqJ+b+H965vNMAzD
|
| 1021 |
+
+MAzDMAzDMAzDMAzDMAzDMAzDMMxr4TfczteTACgAAA==
|
| 1022 |
+
diff --git a/mimo_test_command.sh b/mimo_test_command.sh
|
| 1023 |
+
new file mode 100755
|
| 1024 |
+
--- /dev/null
|
| 1025 |
+
+++ b/mimo_test_command.sh
|
| 1026 |
+
@@ -0,0 +1,6 @@
|
| 1027 |
+
+#!/usr/bin/env bash
|
| 1028 |
+
+
|
| 1029 |
+
+set -uo pipefail
|
| 1030 |
+
+cd /testbed || exit 1
|
| 1031 |
+
+base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1
|
| 1032 |
+
+exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh'
|
tasks/format-code-task-000072/tests/test.sh
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the
|
| 3 |
+
# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
CWD=/testbed
|
| 6 |
+
V=/logs/verifier
|
| 7 |
+
mkdir -p "$V"
|
| 8 |
+
BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; }
|
| 9 |
+
cd "$CWD" || exit 1
|
| 10 |
+
if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi
|
| 11 |
+
# the agent's change against the base, so its own commits count too
|
| 12 |
+
git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff"
|
| 13 |
+
git reset -q
|
| 14 |
+
if ! (
|
| 15 |
+
while IFS= read -r tf; do
|
| 16 |
+
[ -z "$tf" ] && continue
|
| 17 |
+
if git cat-file -e $BASE:"$tf" 2>/dev/null; then
|
| 18 |
+
git checkout $BASE -- "$tf" 2>/dev/null || true
|
| 19 |
+
else
|
| 20 |
+
git rm -f --cached "$tf" >/dev/null 2>&1 || true
|
| 21 |
+
rm -f "$tf"
|
| 22 |
+
fi
|
| 23 |
+
done <<'EOF_RESET_TEST_FILES'
|
| 24 |
+
datadog/tests/cassettes/TestAccDatadogIntegrationAzure.freeze
|
| 25 |
+
datadog/tests/cassettes/TestAccDatadogIntegrationAzure.yaml
|
| 26 |
+
datadog/tests/cassettes/TestAccDatadogLogsArchiveAzure_basic.freeze
|
| 27 |
+
datadog/tests/cassettes/TestAccDatadogLogsArchiveAzure_basic.yaml
|
| 28 |
+
datadog/tests/resource_datadog_integration_azure_test.go
|
| 29 |
+
mimo_build_env.tar.gz.b64
|
| 30 |
+
mimo_test_command.sh
|
| 31 |
+
EOF_RESET_TEST_FILES
|
| 32 |
+
|
| 33 |
+
); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi
|
| 34 |
+
if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then
|
| 35 |
+
cat "$V/apply.log" >&2
|
| 36 |
+
echo "the hidden tests could not be applied (testbed problem, not scored)" >&2
|
| 37 |
+
exit 1
|
| 38 |
+
fi
|
| 39 |
+
timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1
|
| 40 |
+
RC=$?
|
| 41 |
+
tail -c 12000 "$V/test_output.log"
|
| 42 |
+
if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi
|
| 43 |
+
echo "test command exited $RC"
|
tasks/format-code-task-000072/tests/test_command.sh
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
bash /testbed/mimo_test_command.sh
|
tasks/format-code-task-000073/environment/Dockerfile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The task's image, pinned by digest (the same as [environment].docker_image).
|
| 2 |
+
# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy.
|
| 3 |
+
FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:942c824088d3f8711fae9910bd12d3f7e6c70adc5d086b61a828fb154b33b895
|
tasks/format-code-task-000073/environment/setup/files/blocklist
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# mimo answer-leak blocklist (mimoagent)
|
| 2 |
+
0.0.0.0 github.com
|
| 3 |
+
0.0.0.0 www.github.com
|
| 4 |
+
0.0.0.0 api.github.com
|
| 5 |
+
0.0.0.0 raw.githubusercontent.com
|
| 6 |
+
0.0.0.0 codeload.github.com
|
| 7 |
+
0.0.0.0 objects.githubusercontent.com
|
| 8 |
+
0.0.0.0 gist.github.com
|
| 9 |
+
0.0.0.0 gist.githubusercontent.com
|
| 10 |
+
0.0.0.0 gitlab.com
|
| 11 |
+
0.0.0.0 bitbucket.org
|
| 12 |
+
0.0.0.0 sourceforge.net
|
| 13 |
+
0.0.0.0 git.kernel.org
|
| 14 |
+
0.0.0.0 chromium.googlesource.com
|
| 15 |
+
0.0.0.0 android.googlesource.com
|
| 16 |
+
0.0.0.0 sourcegraph.com
|
| 17 |
+
0.0.0.0 bugs.chromium.org
|
| 18 |
+
0.0.0.0 issues.oss-fuzz.com
|
| 19 |
+
0.0.0.0 oss-fuzz.com
|
| 20 |
+
0.0.0.0 osv.dev
|
| 21 |
+
0.0.0.0 api.osv.dev
|
| 22 |
+
0.0.0.0 bugzilla.mozilla.org
|
| 23 |
+
0.0.0.0 proxy.golang.org
|
| 24 |
+
0.0.0.0 sum.golang.org
|
| 25 |
+
0.0.0.0 pkg.go.dev
|
| 26 |
+
0.0.0.0 google.com
|
| 27 |
+
0.0.0.0 www.google.com
|
| 28 |
+
0.0.0.0 bing.com
|
| 29 |
+
0.0.0.0 www.bing.com
|
| 30 |
+
0.0.0.0 duckduckgo.com
|
| 31 |
+
0.0.0.0 html.duckduckgo.com
|
| 32 |
+
0.0.0.0 search.brave.com
|
| 33 |
+
0.0.0.0 stackoverflow.com
|
tasks/format-code-task-000073/environment/setup/setup.sh
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into
|
| 3 |
+
# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
[ -f "$M/ready" ] && exit 0
|
| 6 |
+
chmod 700 "$M"
|
| 7 |
+
fail() { echo "setup: $*" >&2; exit 1; }
|
| 8 |
+
# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs
|
| 9 |
+
write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; }
|
| 10 |
+
|
| 11 |
+
# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code).
|
| 12 |
+
CWD=/testbed
|
| 13 |
+
git config --global --add safe.directory "$CWD"
|
| 14 |
+
cd "$CWD" || fail "no working directory $CWD"
|
| 15 |
+
if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit
|
| 16 |
+
git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty
|
| 17 |
+
fi
|
| 18 |
+
BASE=$(git rev-parse HEAD 2>/dev/null)
|
| 19 |
+
[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD"
|
| 20 |
+
echo "$BASE" > "$M/base"
|
| 21 |
+
# Images are built with history truncated at the base. If one is not, the fix could be read out of git log,
|
| 22 |
+
# so .git is hidden while the agent works and put back for grading.
|
| 23 |
+
LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true)
|
| 24 |
+
rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true
|
| 25 |
+
git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1
|
| 26 |
+
find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true
|
| 27 |
+
if [ "$LATER" -gt 0 ]; then
|
| 28 |
+
mv "$CWD/.git" "$M/git-hidden"
|
| 29 |
+
echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works"
|
| 30 |
+
fi
|
| 31 |
+
write_blocklist
|
| 32 |
+
|
| 33 |
+
touch "$M/ready"
|
| 34 |
+
echo "setup done"
|
tasks/format-code-task-000073/tests/test.patch
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/test/ordered_list_in_blockquote.md b/test/ordered_list_in_blockquote.md
|
| 2 |
+
new file mode 100644
|
| 3 |
+
index 000000000..1cc5d9163
|
| 4 |
+
--- /dev/null
|
| 5 |
+
+++ b/test/ordered_list_in_blockquote.md
|
| 6 |
+
@@ -0,0 +1,9 @@
|
| 7 |
+
+> 1. The simplest ordered list in blockquote
|
| 8 |
+
+
|
| 9 |
+
+1. ol
|
| 10 |
+
+
|
| 11 |
+
+ > 1. ol-li-blockquote-ol-li
|
| 12 |
+
+ > 1. ol-li-blockquote-ol-li-ol-li {MD027}
|
| 13 |
+
+
|
| 14 |
+
+> 1. blockquote-ol-li
|
| 15 |
+
+> 1. blockquote-ol-li-ol-li {MD027}
|
| 16 |
+
diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64
|
| 17 |
+
new file mode 100644
|
| 18 |
+
--- /dev/null
|
| 19 |
+
+++ b/mimo_build_env.tar.gz.b64
|
| 20 |
+
@@ -0,0 +1,5 @@
|
| 21 |
+
+H4sIAAAAAAAAA+3SUY6DIBAGYJ97irlAKWiV4xh1SMpWoUXc3eMvmjRtNtn1pU3T9P9eZgKTAPkR
|
| 22 |
+
+7WR7ro373GWPIhNdlktNftelV2WuVKW1lEUmU5cKlQ+70Y1pjE0gyoL38b+5tf0XJa75RzPGuvPD
|
| 23 |
+
+0DgW4+F+Z6zlr/L9Jf9KF2lO7atcZyTvd4W/vXn+HdMSfGt4407f5DybydlI8+JuaMKR/ZfrrYvb
|
| 24 |
+
+eUV8jLSN5AObYLjubfoy1tVt77vjefLRiIE3z34TAAAAAAAAAAAAAAAAAAAAAMC7+AGUwv93ACgA
|
| 25 |
+
+AA==
|
| 26 |
+
diff --git a/mimo_test_command.sh b/mimo_test_command.sh
|
| 27 |
+
new file mode 100755
|
| 28 |
+
--- /dev/null
|
| 29 |
+
+++ b/mimo_test_command.sh
|
| 30 |
+
@@ -0,0 +1,6 @@
|
| 31 |
+
+#!/usr/bin/env bash
|
| 32 |
+
+
|
| 33 |
+
+set -uo pipefail
|
| 34 |
+
+cd /testbed || exit 1
|
| 35 |
+
+base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1
|
| 36 |
+
+exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh'
|
tasks/format-code-task-000073/tests/test.sh
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the
|
| 3 |
+
# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
CWD=/testbed
|
| 6 |
+
V=/logs/verifier
|
| 7 |
+
mkdir -p "$V"
|
| 8 |
+
BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; }
|
| 9 |
+
cd "$CWD" || exit 1
|
| 10 |
+
if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi
|
| 11 |
+
# the agent's change against the base, so its own commits count too
|
| 12 |
+
git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff"
|
| 13 |
+
git reset -q
|
| 14 |
+
if ! (
|
| 15 |
+
while IFS= read -r tf; do
|
| 16 |
+
[ -z "$tf" ] && continue
|
| 17 |
+
if git cat-file -e $BASE:"$tf" 2>/dev/null; then
|
| 18 |
+
git checkout $BASE -- "$tf" 2>/dev/null || true
|
| 19 |
+
else
|
| 20 |
+
git rm -f --cached "$tf" >/dev/null 2>&1 || true
|
| 21 |
+
rm -f "$tf"
|
| 22 |
+
fi
|
| 23 |
+
done <<'EOF_RESET_TEST_FILES'
|
| 24 |
+
test/ordered_list_in_blockquote.md
|
| 25 |
+
mimo_build_env.tar.gz.b64
|
| 26 |
+
mimo_test_command.sh
|
| 27 |
+
EOF_RESET_TEST_FILES
|
| 28 |
+
|
| 29 |
+
); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi
|
| 30 |
+
if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then
|
| 31 |
+
cat "$V/apply.log" >&2
|
| 32 |
+
echo "the hidden tests could not be applied (testbed problem, not scored)" >&2
|
| 33 |
+
exit 1
|
| 34 |
+
fi
|
| 35 |
+
timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1
|
| 36 |
+
RC=$?
|
| 37 |
+
tail -c 12000 "$V/test_output.log"
|
| 38 |
+
if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi
|
| 39 |
+
echo "test command exited $RC"
|
tasks/format-code-task-000073/tests/test_command.sh
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
bash /testbed/mimo_test_command.sh
|
tasks/format-code-task-000075/environment/Dockerfile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The task's image, pinned by digest (the same as [environment].docker_image).
|
| 2 |
+
# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy.
|
| 3 |
+
FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:c7dab750bea597d686b55b6072e32cbc6daec8afd526ba9645c5b26715b8ec70
|
tasks/format-code-task-000075/environment/setup/files/blocklist
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# mimo answer-leak blocklist (mimoagent)
|
| 2 |
+
0.0.0.0 github.com
|
| 3 |
+
0.0.0.0 www.github.com
|
| 4 |
+
0.0.0.0 api.github.com
|
| 5 |
+
0.0.0.0 raw.githubusercontent.com
|
| 6 |
+
0.0.0.0 codeload.github.com
|
| 7 |
+
0.0.0.0 objects.githubusercontent.com
|
| 8 |
+
0.0.0.0 gist.github.com
|
| 9 |
+
0.0.0.0 gist.githubusercontent.com
|
| 10 |
+
0.0.0.0 gitlab.com
|
| 11 |
+
0.0.0.0 bitbucket.org
|
| 12 |
+
0.0.0.0 sourceforge.net
|
| 13 |
+
0.0.0.0 git.kernel.org
|
| 14 |
+
0.0.0.0 chromium.googlesource.com
|
| 15 |
+
0.0.0.0 android.googlesource.com
|
| 16 |
+
0.0.0.0 sourcegraph.com
|
| 17 |
+
0.0.0.0 bugs.chromium.org
|
| 18 |
+
0.0.0.0 issues.oss-fuzz.com
|
| 19 |
+
0.0.0.0 oss-fuzz.com
|
| 20 |
+
0.0.0.0 osv.dev
|
| 21 |
+
0.0.0.0 api.osv.dev
|
| 22 |
+
0.0.0.0 bugzilla.mozilla.org
|
| 23 |
+
0.0.0.0 proxy.golang.org
|
| 24 |
+
0.0.0.0 sum.golang.org
|
| 25 |
+
0.0.0.0 pkg.go.dev
|
| 26 |
+
0.0.0.0 google.com
|
| 27 |
+
0.0.0.0 www.google.com
|
| 28 |
+
0.0.0.0 bing.com
|
| 29 |
+
0.0.0.0 www.bing.com
|
| 30 |
+
0.0.0.0 duckduckgo.com
|
| 31 |
+
0.0.0.0 html.duckduckgo.com
|
| 32 |
+
0.0.0.0 search.brave.com
|
| 33 |
+
0.0.0.0 stackoverflow.com
|
tasks/format-code-task-000075/environment/setup/setup.sh
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into
|
| 3 |
+
# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
[ -f "$M/ready" ] && exit 0
|
| 6 |
+
chmod 700 "$M"
|
| 7 |
+
fail() { echo "setup: $*" >&2; exit 1; }
|
| 8 |
+
# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs
|
| 9 |
+
write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; }
|
| 10 |
+
|
| 11 |
+
# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code).
|
| 12 |
+
CWD=/testbed
|
| 13 |
+
git config --global --add safe.directory "$CWD"
|
| 14 |
+
cd "$CWD" || fail "no working directory $CWD"
|
| 15 |
+
if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit
|
| 16 |
+
git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty
|
| 17 |
+
fi
|
| 18 |
+
BASE=$(git rev-parse HEAD 2>/dev/null)
|
| 19 |
+
[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD"
|
| 20 |
+
echo "$BASE" > "$M/base"
|
| 21 |
+
# Images are built with history truncated at the base. If one is not, the fix could be read out of git log,
|
| 22 |
+
# so .git is hidden while the agent works and put back for grading.
|
| 23 |
+
LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true)
|
| 24 |
+
rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true
|
| 25 |
+
git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1
|
| 26 |
+
find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true
|
| 27 |
+
if [ "$LATER" -gt 0 ]; then
|
| 28 |
+
mv "$CWD/.git" "$M/git-hidden"
|
| 29 |
+
echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works"
|
| 30 |
+
fi
|
| 31 |
+
write_blocklist
|
| 32 |
+
|
| 33 |
+
touch "$M/ready"
|
| 34 |
+
echo "setup done"
|
tasks/format-code-task-000075/tests/test.patch
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/config/lfu_defaults_test.go b/config/lfu_defaults_test.go
|
| 2 |
+
new file mode 100644
|
| 3 |
+
index 000000000..5d1fdfe25
|
| 4 |
+
--- /dev/null
|
| 5 |
+
+++ b/config/lfu_defaults_test.go
|
| 6 |
+
@@ -0,0 +1,83 @@
|
| 7 |
+
+package config
|
| 8 |
+
+
|
| 9 |
+
+import (
|
| 10 |
+
+ "reflect"
|
| 11 |
+
+ "testing"
|
| 12 |
+
+)
|
| 13 |
+
+
|
| 14 |
+
+func serverNumericFieldWithDefault(t *testing.T, want int64) reflect.Value {
|
| 15 |
+
+ t.Helper()
|
| 16 |
+
+ server := reflect.ValueOf(&DiceConfig.Server).Elem()
|
| 17 |
+
+ for i := 0; i < server.NumField(); i++ {
|
| 18 |
+
+ field := server.Field(i)
|
| 19 |
+
+ switch field.Kind() {
|
| 20 |
+
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
| 21 |
+
+ if field.Int() == want {
|
| 22 |
+
+ return field
|
| 23 |
+
+ }
|
| 24 |
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
| 25 |
+
+ if field.Uint() == uint64(want) {
|
| 26 |
+
+ return field
|
| 27 |
+
+ }
|
| 28 |
+
+ case reflect.Float32, reflect.Float64:
|
| 29 |
+
+ if field.Float() == float64(want) {
|
| 30 |
+
+ return field
|
| 31 |
+
+ }
|
| 32 |
+
+ }
|
| 33 |
+
+ }
|
| 34 |
+
+ t.Fatalf("server config option with numeric default %d is not available", want)
|
| 35 |
+
+ return reflect.Value{}
|
| 36 |
+
+}
|
| 37 |
+
+
|
| 38 |
+
+func numericFieldValue(t *testing.T, field reflect.Value) float64 {
|
| 39 |
+
+ t.Helper()
|
| 40 |
+
+ switch field.Kind() {
|
| 41 |
+
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
| 42 |
+
+ return float64(field.Int())
|
| 43 |
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
| 44 |
+
+ return float64(field.Uint())
|
| 45 |
+
+ case reflect.Float32, reflect.Float64:
|
| 46 |
+
+ return field.Float()
|
| 47 |
+
+ default:
|
| 48 |
+
+ t.Fatalf("server config field kind = %s, want numeric", field.Kind())
|
| 49 |
+
+ return 0
|
| 50 |
+
+ }
|
| 51 |
+
+}
|
| 52 |
+
+
|
| 53 |
+
+func setNumericField(t *testing.T, field reflect.Value, value float64) {
|
| 54 |
+
+ t.Helper()
|
| 55 |
+
+ switch field.Kind() {
|
| 56 |
+
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
| 57 |
+
+ field.SetInt(int64(value))
|
| 58 |
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
| 59 |
+
+ if value < 0 {
|
| 60 |
+
+ t.Fatalf("cannot set unsigned server config field to %g", value)
|
| 61 |
+
+ }
|
| 62 |
+
+ field.SetUint(uint64(value))
|
| 63 |
+
+ case reflect.Float32, reflect.Float64:
|
| 64 |
+
+ field.SetFloat(value)
|
| 65 |
+
+ default:
|
| 66 |
+
+ t.Fatalf("server config field kind = %s, want numeric", field.Kind())
|
| 67 |
+
+ }
|
| 68 |
+
+}
|
| 69 |
+
+
|
| 70 |
+
+func TestDefaultEvictionPolicyIsAllKeysLFU(t *testing.T) {
|
| 71 |
+
+ if DiceConfig.Server.EvictionPolicy != "allkeys-lfu" {
|
| 72 |
+
+ t.Fatalf("default eviction policy = %q, want allkeys-lfu", DiceConfig.Server.EvictionPolicy)
|
| 73 |
+
+ }
|
| 74 |
+
+}
|
| 75 |
+
+
|
| 76 |
+
+func TestLFULogFactorDefaultAndCanBeSet(t *testing.T) {
|
| 77 |
+
+ field := serverNumericFieldWithDefault(t, 10)
|
| 78 |
+
+ if got := numericFieldValue(t, field); got != 10 {
|
| 79 |
+
+ t.Fatalf("default LFU growth factor = %g, want 10", got)
|
| 80 |
+
+ }
|
| 81 |
+
+
|
| 82 |
+
+ original := numericFieldValue(t, field)
|
| 83 |
+
+ t.Cleanup(func() { setNumericField(t, field, original) })
|
| 84 |
+
+
|
| 85 |
+
+ setNumericField(t, field, 37)
|
| 86 |
+
+ if got := numericFieldValue(t, field); got != 37 {
|
| 87 |
+
+ t.Fatalf("LFU growth factor config did not retain runtime value, got %g", got)
|
| 88 |
+
+ }
|
| 89 |
+
+}
|
| 90 |
+
diff --git a/internal/store/lfu_behavior_test.go b/internal/store/lfu_behavior_test.go
|
| 91 |
+
new file mode 100644
|
| 92 |
+
index 000000000..ccb247774
|
| 93 |
+
--- /dev/null
|
| 94 |
+
+++ b/internal/store/lfu_behavior_test.go
|
| 95 |
+
@@ -0,0 +1,291 @@
|
| 96 |
+
+package store
|
| 97 |
+
+
|
| 98 |
+
+import (
|
| 99 |
+
+ "reflect"
|
| 100 |
+
+ "testing"
|
| 101 |
+
+ "time"
|
| 102 |
+
+
|
| 103 |
+
+ "github.com/dicedb/dice/config"
|
| 104 |
+
+ "github.com/dicedb/dice/internal/object"
|
| 105 |
+
+)
|
| 106 |
+
+
|
| 107 |
+
+func serverNumericFieldWithDefault(t *testing.T, want int64) reflect.Value {
|
| 108 |
+
+ t.Helper()
|
| 109 |
+
+ server := reflect.ValueOf(&config.DiceConfig.Server).Elem()
|
| 110 |
+
+ for i := 0; i < server.NumField(); i++ {
|
| 111 |
+
+ field := server.Field(i)
|
| 112 |
+
+ switch field.Kind() {
|
| 113 |
+
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
| 114 |
+
+ if field.Int() == want {
|
| 115 |
+
+ return field
|
| 116 |
+
+ }
|
| 117 |
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
| 118 |
+
+ if field.Uint() == uint64(want) {
|
| 119 |
+
+ return field
|
| 120 |
+
+ }
|
| 121 |
+
+ case reflect.Float32, reflect.Float64:
|
| 122 |
+
+ if field.Float() == float64(want) {
|
| 123 |
+
+ return field
|
| 124 |
+
+ }
|
| 125 |
+
+ }
|
| 126 |
+
+ }
|
| 127 |
+
+ t.Fatalf("server config option with numeric default %d is not available", want)
|
| 128 |
+
+ return reflect.Value{}
|
| 129 |
+
+}
|
| 130 |
+
+
|
| 131 |
+
+func numericFieldValue(t *testing.T, field reflect.Value) float64 {
|
| 132 |
+
+ t.Helper()
|
| 133 |
+
+ switch field.Kind() {
|
| 134 |
+
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
| 135 |
+
+ return float64(field.Int())
|
| 136 |
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
| 137 |
+
+ return float64(field.Uint())
|
| 138 |
+
+ case reflect.Float32, reflect.Float64:
|
| 139 |
+
+ return field.Float()
|
| 140 |
+
+ default:
|
| 141 |
+
+ t.Fatalf("server config field kind = %s, want numeric", field.Kind())
|
| 142 |
+
+ return 0
|
| 143 |
+
+ }
|
| 144 |
+
+}
|
| 145 |
+
+
|
| 146 |
+
+func setNumericField(t *testing.T, field reflect.Value, value float64) {
|
| 147 |
+
+ t.Helper()
|
| 148 |
+
+ switch field.Kind() {
|
| 149 |
+
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
|
| 150 |
+
+ field.SetInt(int64(value))
|
| 151 |
+
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
| 152 |
+
+ if value < 0 {
|
| 153 |
+
+ t.Fatalf("cannot set unsigned server config field to %g", value)
|
| 154 |
+
+ }
|
| 155 |
+
+ field.SetUint(uint64(value))
|
| 156 |
+
+ case reflect.Float32, reflect.Float64:
|
| 157 |
+
+ field.SetFloat(value)
|
| 158 |
+
+ default:
|
| 159 |
+
+ t.Fatalf("server config field kind = %s, want numeric", field.Kind())
|
| 160 |
+
+ }
|
| 161 |
+
+}
|
| 162 |
+
+
|
| 163 |
+
+func withEvictionSettings(t *testing.T, policy string, ratio float64, keysLimit int, logFactor int) {
|
| 164 |
+
+ t.Helper()
|
| 165 |
+
+ originalPolicy := config.DiceConfig.Server.EvictionPolicy
|
| 166 |
+
+ originalRatio := config.DiceConfig.Server.EvictionRatio
|
| 167 |
+
+ originalKeysLimit := config.DiceConfig.Server.KeysLimit
|
| 168 |
+
+ growthFactorField := serverNumericFieldWithDefault(t, 10)
|
| 169 |
+
+ originalLogFactorValue := numericFieldValue(t, growthFactorField)
|
| 170 |
+
+ t.Cleanup(func() {
|
| 171 |
+
+ config.DiceConfig.Server.EvictionPolicy = originalPolicy
|
| 172 |
+
+ config.DiceConfig.Server.EvictionRatio = originalRatio
|
| 173 |
+
+ config.DiceConfig.Server.KeysLimit = originalKeysLimit
|
| 174 |
+
+ setNumericField(t, growthFactorField, originalLogFactorValue)
|
| 175 |
+
+ })
|
| 176 |
+
+ if policy != "" {
|
| 177 |
+
+ config.DiceConfig.Server.EvictionPolicy = policy
|
| 178 |
+
+ }
|
| 179 |
+
+ config.DiceConfig.Server.EvictionRatio = ratio
|
| 180 |
+
+ config.DiceConfig.Server.KeysLimit = keysLimit
|
| 181 |
+
+ setNumericField(t, growthFactorField, float64(logFactor))
|
| 182 |
+
+}
|
| 183 |
+
+
|
| 184 |
+
+func putTestKey(s *Store, key string) {
|
| 185 |
+
+ s.Put(key, &object.Obj{})
|
| 186 |
+
+}
|
| 187 |
+
+
|
| 188 |
+
+func touchKeyManyTimes(t *testing.T, s *Store, key string, count int) {
|
| 189 |
+
+ t.Helper()
|
| 190 |
+
+ for i := 0; i < count; i++ {
|
| 191 |
+
+ if got := s.Get(key); got == nil {
|
| 192 |
+
+ t.Fatalf("expected key %q to exist while building access frequency", key)
|
| 193 |
+
+ }
|
| 194 |
+
+ }
|
| 195 |
+
+}
|
| 196 |
+
+
|
| 197 |
+
+func assertKeyPresent(t *testing.T, s *Store, key string) {
|
| 198 |
+
+ t.Helper()
|
| 199 |
+
+ if got := s.Get(key); got == nil {
|
| 200 |
+
+ t.Fatalf("expected key %q to survive eviction", key)
|
| 201 |
+
+ }
|
| 202 |
+
+}
|
| 203 |
+
+
|
| 204 |
+
+func assertKeyMissing(t *testing.T, s *Store, key string) {
|
| 205 |
+
+ t.Helper()
|
| 206 |
+
+ if got := s.Get(key); got != nil {
|
| 207 |
+
+ t.Fatalf("expected key %q to be evicted", key)
|
| 208 |
+
+ }
|
| 209 |
+
+}
|
| 210 |
+
+
|
| 211 |
+
+func countMissing(t *testing.T, s *Store, keys ...string) int {
|
| 212 |
+
+ t.Helper()
|
| 213 |
+
+ missing := 0
|
| 214 |
+
+ for _, key := range keys {
|
| 215 |
+
+ if s.Get(key) == nil {
|
| 216 |
+
+ missing++
|
| 217 |
+
+ }
|
| 218 |
+
+ }
|
| 219 |
+
+ return missing
|
| 220 |
+
+}
|
| 221 |
+
+
|
| 222 |
+
+func TestAllKeysLFUPreservesFrequentlyAccessedKeysAgainstRecentColdKeys(t *testing.T) {
|
| 223 |
+
+ withEvictionSettings(t, "allkeys-lfu", 0.40, 5, 1)
|
| 224 |
+
+ s := NewStore(nil)
|
| 225 |
+
+
|
| 226 |
+
+ hotKeys := []string{"alpha-hot-1", "alpha-hot-2"}
|
| 227 |
+
+ coldKeys := []string{"beta-cold-1", "beta-cold-2", "beta-cold-3"}
|
| 228 |
+
+ for _, key := range hotKeys {
|
| 229 |
+
+ putTestKey(s, key)
|
| 230 |
+
+ touchKeyManyTimes(t, s, key, 220)
|
| 231 |
+
+ }
|
| 232 |
+
+
|
| 233 |
+
+ time.Sleep(1100 * time.Millisecond)
|
| 234 |
+
+ for _, key := range coldKeys {
|
| 235 |
+
+ putTestKey(s, key)
|
| 236 |
+
+ }
|
| 237 |
+
+ putTestKey(s, "alpha-trigger")
|
| 238 |
+
+
|
| 239 |
+
+ assertKeyPresent(t, s, "alpha-hot-1")
|
| 240 |
+
+ assertKeyPresent(t, s, "alpha-hot-2")
|
| 241 |
+
+ if missing := countMissing(t, s, coldKeys...); missing < 2 {
|
| 242 |
+
+ t.Fatalf("LFU eviction removed %d cold keys, want at least 2; this looks like recency-only eviction", missing)
|
| 243 |
+
+ }
|
| 244 |
+
+}
|
| 245 |
+
+
|
| 246 |
+
+func TestAllKeysLFUUsesAccessFrequencyForNeutralKeyNames(t *testing.T) {
|
| 247 |
+
+ withEvictionSettings(t, "allkeys-lfu", 0.50, 2, 1)
|
| 248 |
+
+ s := NewStore(nil)
|
| 249 |
+
+
|
| 250 |
+
+ putTestKey(s, "session:primary")
|
| 251 |
+
+ touchKeyManyTimes(t, s, "session:primary", 220)
|
| 252 |
+
+ time.Sleep(1100 * time.Millisecond)
|
| 253 |
+
+ putTestKey(s, "session:secondary")
|
| 254 |
+
+ putTestKey(s, "session:trigger")
|
| 255 |
+
+
|
| 256 |
+
+ assertKeyPresent(t, s, "session:primary")
|
| 257 |
+
+ assertKeyMissing(t, s, "session:secondary")
|
| 258 |
+
+}
|
| 259 |
+
+
|
| 260 |
+
+func TestAllKeysLFUTieBreaksByIdleTime(t *testing.T) {
|
| 261 |
+
+ withEvictionSettings(t, "allkeys-lfu", 0.50, 2, 10)
|
| 262 |
+
+ s := NewStore(nil)
|
| 263 |
+
+
|
| 264 |
+
+ putTestKey(s, "same-frequency-old")
|
| 265 |
+
+ time.Sleep(1100 * time.Millisecond)
|
| 266 |
+
+ putTestKey(s, "same-frequency-new")
|
| 267 |
+
+ putTestKey(s, "same-frequency-trigger")
|
| 268 |
+
+
|
| 269 |
+
+ assertKeyMissing(t, s, "same-frequency-old")
|
| 270 |
+
+ assertKeyPresent(t, s, "same-frequency-new")
|
| 271 |
+
+}
|
| 272 |
+
+
|
| 273 |
+
+func TestDefaultPolicyUsesLFUBehaviorWhenUnspecified(t *testing.T) {
|
| 274 |
+
+ withEvictionSettings(t, "", 0.50, 2, 1)
|
| 275 |
+
+ if config.DiceConfig.Server.EvictionPolicy != "allkeys-lfu" {
|
| 276 |
+
+ t.Fatalf("test requires the package default policy to be allkeys-lfu, got %q", config.DiceConfig.Server.EvictionPolicy)
|
| 277 |
+
+ }
|
| 278 |
+
+ s := NewStore(nil)
|
| 279 |
+
+
|
| 280 |
+
+ putTestKey(s, "default-hot")
|
| 281 |
+
+ touchKeyManyTimes(t, s, "default-hot", 220)
|
| 282 |
+
+ time.Sleep(1100 * time.Millisecond)
|
| 283 |
+
+ putTestKey(s, "default-recent-cold")
|
| 284 |
+
+ putTestKey(s, "default-trigger")
|
| 285 |
+
+
|
| 286 |
+
+ assertKeyPresent(t, s, "default-hot")
|
| 287 |
+
+ assertKeyMissing(t, s, "default-recent-cold")
|
| 288 |
+
+}
|
| 289 |
+
+
|
| 290 |
+
+func TestLFULogFactorLowProtectsFrequentlyAccessedKey(t *testing.T) {
|
| 291 |
+
+ withEvictionSettings(t, "allkeys-lfu", 0.50, 2, 1)
|
| 292 |
+
+ s := NewStore(nil)
|
| 293 |
+
+
|
| 294 |
+
+ putTestKey(s, "low-factor-hot")
|
| 295 |
+
+ touchKeyManyTimes(t, s, "low-factor-hot", 200)
|
| 296 |
+
+ time.Sleep(1100 * time.Millisecond)
|
| 297 |
+
+ putTestKey(s, "low-factor-cold")
|
| 298 |
+
+ touchKeyManyTimes(t, s, "low-factor-cold", 1)
|
| 299 |
+
+ putTestKey(s, "low-factor-trigger")
|
| 300 |
+
+
|
| 301 |
+
+ assertKeyPresent(t, s, "low-factor-hot")
|
| 302 |
+
+ assertKeyMissing(t, s, "low-factor-cold")
|
| 303 |
+
+}
|
| 304 |
+
+
|
| 305 |
+
+func TestLFULogFactorHighSlowsFrequencyGrowth(t *testing.T) {
|
| 306 |
+
+ withEvictionSettings(t, "allkeys-lfu", 0.50, 2, 100)
|
| 307 |
+
+ s := NewStore(nil)
|
| 308 |
+
+
|
| 309 |
+
+ putTestKey(s, "high-factor-hot")
|
| 310 |
+
+ touchKeyManyTimes(t, s, "high-factor-hot", 1)
|
| 311 |
+
+ time.Sleep(1100 * time.Millisecond)
|
| 312 |
+
+ putTestKey(s, "high-factor-cold")
|
| 313 |
+
+ touchKeyManyTimes(t, s, "high-factor-cold", 1)
|
| 314 |
+
+ putTestKey(s, "high-factor-trigger")
|
| 315 |
+
+
|
| 316 |
+
+ assertKeyMissing(t, s, "high-factor-hot")
|
| 317 |
+
+ assertKeyPresent(t, s, "high-factor-cold")
|
| 318 |
+
+}
|
| 319 |
+
+
|
| 320 |
+
+func TestLFULogFactorZeroMakesRepeatedAccessesDeterministicallyStronger(t *testing.T) {
|
| 321 |
+
+ withEvictionSettings(t, "allkeys-lfu", 0.50, 2, 0)
|
| 322 |
+
+
|
| 323 |
+
+ cases := [][3]string{
|
| 324 |
+
+ {"factor-zero-a-primary", "factor-zero-a-secondary", "factor-zero-a-trigger"},
|
| 325 |
+
+ {"factor-zero-b-primary", "factor-zero-b-secondary", "factor-zero-b-trigger"},
|
| 326 |
+
+ {"factor-zero-c-primary", "factor-zero-c-secondary", "factor-zero-c-trigger"},
|
| 327 |
+
+ }
|
| 328 |
+
+
|
| 329 |
+
+ for _, keys := range cases {
|
| 330 |
+
+ s := NewStore(nil)
|
| 331 |
+
+ putTestKey(s, keys[0])
|
| 332 |
+
+ touchKeyManyTimes(t, s, keys[0], 2)
|
| 333 |
+
+ time.Sleep(1100 * time.Millisecond)
|
| 334 |
+
+ putTestKey(s, keys[1])
|
| 335 |
+
+ touchKeyManyTimes(t, s, keys[1], 1)
|
| 336 |
+
+ putTestKey(s, keys[2])
|
| 337 |
+
+
|
| 338 |
+
+ assertKeyPresent(t, s, keys[0])
|
| 339 |
+
+ assertKeyMissing(t, s, keys[1])
|
| 340 |
+
+ }
|
| 341 |
+
+}
|
| 342 |
+
+
|
| 343 |
+
+func TestLFUFrequencyDoesNotWrapAfterManyAccesses(t *testing.T) {
|
| 344 |
+
+ withEvictionSettings(t, "allkeys-lfu", 0.50, 2, 1)
|
| 345 |
+
+ s := NewStore(nil)
|
| 346 |
+
+
|
| 347 |
+
+ putTestKey(s, "wrap-resistant-hot")
|
| 348 |
+
+ touchKeyManyTimes(t, s, "wrap-resistant-hot", 512)
|
| 349 |
+
+ time.Sleep(1100 * time.Millisecond)
|
| 350 |
+
+ putTestKey(s, "wrap-resistant-cold")
|
| 351 |
+
+ putTestKey(s, "wrap-resistant-trigger")
|
| 352 |
+
+
|
| 353 |
+
+ assertKeyPresent(t, s, "wrap-resistant-hot")
|
| 354 |
+
+ assertKeyMissing(t, s, "wrap-resistant-cold")
|
| 355 |
+
+}
|
| 356 |
+
+
|
| 357 |
+
+func TestLFUFrequencySaturatesInsteadOfWrappingUnderDeterministicGrowth(t *testing.T) {
|
| 358 |
+
+ withEvictionSettings(t, "allkeys-lfu", 0.50, 2, 0)
|
| 359 |
+
+ s := NewStore(nil)
|
| 360 |
+
+
|
| 361 |
+
+ putTestKey(s, "wrap-neutral-primary")
|
| 362 |
+
+ touchKeyManyTimes(t, s, "wrap-neutral-primary", 260)
|
| 363 |
+
+ time.Sleep(1100 * time.Millisecond)
|
| 364 |
+
+ putTestKey(s, "wrap-neutral-secondary")
|
| 365 |
+
+ touchKeyManyTimes(t, s, "wrap-neutral-secondary", 20)
|
| 366 |
+
+ putTestKey(s, "wrap-neutral-trigger")
|
| 367 |
+
+
|
| 368 |
+
+ assertKeyPresent(t, s, "wrap-neutral-primary")
|
| 369 |
+
+ assertKeyMissing(t, s, "wrap-neutral-secondary")
|
| 370 |
+
+}
|
| 371 |
+
+
|
| 372 |
+
+func TestLFUBookkeepingDoesNotCorruptLRUIdleOrdering(t *testing.T) {
|
| 373 |
+
+ withEvictionSettings(t, "allkeys-lfu", 0.50, 2, 1)
|
| 374 |
+
+ s := NewStore(nil)
|
| 375 |
+
+
|
| 376 |
+
+ putTestKey(s, "lfu-metadata-old")
|
| 377 |
+
+ touchKeyManyTimes(t, s, "lfu-metadata-old", 220)
|
| 378 |
+
+
|
| 379 |
+
+ time.Sleep(1100 * time.Millisecond)
|
| 380 |
+
+ config.DiceConfig.Server.EvictionPolicy = "allkeys-lru"
|
| 381 |
+
+ putTestKey(s, "plain-lru-new")
|
| 382 |
+
+ putTestKey(s, "plain-lru-trigger")
|
| 383 |
+
+
|
| 384 |
+
+ assertKeyMissing(t, s, "lfu-metadata-old")
|
| 385 |
+
+ assertKeyPresent(t, s, "plain-lru-new")
|
| 386 |
+
+}
|
| 387 |
+
diff --git a/mimo_test_command.sh b/mimo_test_command.sh
|
| 388 |
+
new file mode 100755
|
| 389 |
+
--- /dev/null
|
| 390 |
+
+++ b/mimo_test_command.sh
|
| 391 |
+
@@ -0,0 +1,36 @@
|
| 392 |
+
+#!/bin/bash
|
| 393 |
+
+set -euo pipefail
|
| 394 |
+
+
|
| 395 |
+
+cd /testbed
|
| 396 |
+
+
|
| 397 |
+
+
|
| 398 |
+
+dev-switch go 1.23
|
| 399 |
+
+
|
| 400 |
+
+
|
| 401 |
+
+case "${1:-}" in
|
| 402 |
+
+ base)
|
| 403 |
+
+ go test -v -race -count=1 ./internal/server/utils/...
|
| 404 |
+
+ go test -v -race -count=1 ./internal/store -run '^(TestDelExpiry|TestAOF|TestAOFWithExat)$'
|
| 405 |
+
+ ;;
|
| 406 |
+
+ new)
|
| 407 |
+
+ go test -v -race -count=1 ./config -run '^(TestDefaultEvictionPolicyIsAllKeysLFU|TestLFULogFactorDefaultAndCanBeSet)$'
|
| 408 |
+
+ for test_name in \
|
| 409 |
+
+ TestAllKeysLFUPreservesFrequentlyAccessedKeysAgainstRecentColdKeys \
|
| 410 |
+
+ TestAllKeysLFUUsesAccessFrequencyForNeutralKeyNames \
|
| 411 |
+
+ TestAllKeysLFUTieBreaksByIdleTime \
|
| 412 |
+
+ TestDefaultPolicyUsesLFUBehaviorWhenUnspecified \
|
| 413 |
+
+ TestLFULogFactorLowProtectsFrequentlyAccessedKey \
|
| 414 |
+
+ TestLFULogFactorHighSlowsFrequencyGrowth \
|
| 415 |
+
+ TestLFULogFactorZeroMakesRepeatedAccessesDeterministicallyStronger \
|
| 416 |
+
+ TestLFUFrequencyDoesNotWrapAfterManyAccesses \
|
| 417 |
+
+ TestLFUFrequencySaturatesInsteadOfWrappingUnderDeterministicGrowth \
|
| 418 |
+
+ TestLFUBookkeepingDoesNotCorruptLRUIdleOrdering
|
| 419 |
+
+ do
|
| 420 |
+
+ go test -v -race -count=1 ./internal/store -run "^${test_name}$"
|
| 421 |
+
+ done
|
| 422 |
+
+ ;;
|
| 423 |
+
+ *)
|
| 424 |
+
+ echo "usage: $0 base|new"
|
| 425 |
+
+ exit 2
|
| 426 |
+
+ ;;
|
| 427 |
+
+esac
|
tasks/format-code-task-000075/tests/test.sh
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the
|
| 3 |
+
# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
CWD=/testbed
|
| 6 |
+
V=/logs/verifier
|
| 7 |
+
mkdir -p "$V"
|
| 8 |
+
BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; }
|
| 9 |
+
cd "$CWD" || exit 1
|
| 10 |
+
if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi
|
| 11 |
+
# the agent's change against the base, so its own commits count too
|
| 12 |
+
git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff"
|
| 13 |
+
git reset -q
|
| 14 |
+
if ! (
|
| 15 |
+
while IFS= read -r tf; do
|
| 16 |
+
[ -z "$tf" ] && continue
|
| 17 |
+
if git cat-file -e $BASE:"$tf" 2>/dev/null; then
|
| 18 |
+
git checkout $BASE -- "$tf" 2>/dev/null || true
|
| 19 |
+
else
|
| 20 |
+
git rm -f --cached "$tf" >/dev/null 2>&1 || true
|
| 21 |
+
rm -f "$tf"
|
| 22 |
+
fi
|
| 23 |
+
done <<'EOF_RESET_TEST_FILES'
|
| 24 |
+
config/lfu_defaults_test.go
|
| 25 |
+
internal/store/lfu_behavior_test.go
|
| 26 |
+
mimo_test_command.sh
|
| 27 |
+
EOF_RESET_TEST_FILES
|
| 28 |
+
|
| 29 |
+
); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi
|
| 30 |
+
if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then
|
| 31 |
+
cat "$V/apply.log" >&2
|
| 32 |
+
echo "the hidden tests could not be applied (testbed problem, not scored)" >&2
|
| 33 |
+
exit 1
|
| 34 |
+
fi
|
| 35 |
+
timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1
|
| 36 |
+
RC=$?
|
| 37 |
+
tail -c 12000 "$V/test_output.log"
|
| 38 |
+
if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi
|
| 39 |
+
echo "test command exited $RC"
|
tasks/format-code-task-000075/tests/test_command.sh
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
bash /testbed/mimo_test_command.sh base && bash /testbed/mimo_test_command.sh new
|
tasks/format-code-task-000080/environment/Dockerfile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The task's image, pinned by digest (the same as [environment].docker_image).
|
| 2 |
+
# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy.
|
| 3 |
+
FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:a3b7c0a528714bb1188a746b1313d6cfb39977fb528582821d54458706181c5b
|
tasks/format-code-task-000080/environment/setup/files/blocklist
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# mimo answer-leak blocklist (mimoagent)
|
| 2 |
+
0.0.0.0 github.com
|
| 3 |
+
0.0.0.0 www.github.com
|
| 4 |
+
0.0.0.0 api.github.com
|
| 5 |
+
0.0.0.0 raw.githubusercontent.com
|
| 6 |
+
0.0.0.0 codeload.github.com
|
| 7 |
+
0.0.0.0 objects.githubusercontent.com
|
| 8 |
+
0.0.0.0 gist.github.com
|
| 9 |
+
0.0.0.0 gist.githubusercontent.com
|
| 10 |
+
0.0.0.0 gitlab.com
|
| 11 |
+
0.0.0.0 bitbucket.org
|
| 12 |
+
0.0.0.0 sourceforge.net
|
| 13 |
+
0.0.0.0 git.kernel.org
|
| 14 |
+
0.0.0.0 chromium.googlesource.com
|
| 15 |
+
0.0.0.0 android.googlesource.com
|
| 16 |
+
0.0.0.0 sourcegraph.com
|
| 17 |
+
0.0.0.0 bugs.chromium.org
|
| 18 |
+
0.0.0.0 issues.oss-fuzz.com
|
| 19 |
+
0.0.0.0 oss-fuzz.com
|
| 20 |
+
0.0.0.0 osv.dev
|
| 21 |
+
0.0.0.0 api.osv.dev
|
| 22 |
+
0.0.0.0 bugzilla.mozilla.org
|
| 23 |
+
0.0.0.0 proxy.golang.org
|
| 24 |
+
0.0.0.0 sum.golang.org
|
| 25 |
+
0.0.0.0 pkg.go.dev
|
| 26 |
+
0.0.0.0 google.com
|
| 27 |
+
0.0.0.0 www.google.com
|
| 28 |
+
0.0.0.0 bing.com
|
| 29 |
+
0.0.0.0 www.bing.com
|
| 30 |
+
0.0.0.0 duckduckgo.com
|
| 31 |
+
0.0.0.0 html.duckduckgo.com
|
| 32 |
+
0.0.0.0 search.brave.com
|
| 33 |
+
0.0.0.0 stackoverflow.com
|
tasks/format-code-task-000080/environment/setup/setup.sh
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into
|
| 3 |
+
# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
[ -f "$M/ready" ] && exit 0
|
| 6 |
+
chmod 700 "$M"
|
| 7 |
+
fail() { echo "setup: $*" >&2; exit 1; }
|
| 8 |
+
# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs
|
| 9 |
+
write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; }
|
| 10 |
+
|
| 11 |
+
# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code).
|
| 12 |
+
CWD=/testbed
|
| 13 |
+
git config --global --add safe.directory "$CWD"
|
| 14 |
+
cd "$CWD" || fail "no working directory $CWD"
|
| 15 |
+
if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit
|
| 16 |
+
git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty
|
| 17 |
+
fi
|
| 18 |
+
BASE=$(git rev-parse HEAD 2>/dev/null)
|
| 19 |
+
[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD"
|
| 20 |
+
echo "$BASE" > "$M/base"
|
| 21 |
+
# Images are built with history truncated at the base. If one is not, the fix could be read out of git log,
|
| 22 |
+
# so .git is hidden while the agent works and put back for grading.
|
| 23 |
+
LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true)
|
| 24 |
+
rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true
|
| 25 |
+
git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1
|
| 26 |
+
find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true
|
| 27 |
+
if [ "$LATER" -gt 0 ]; then
|
| 28 |
+
mv "$CWD/.git" "$M/git-hidden"
|
| 29 |
+
echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works"
|
| 30 |
+
fi
|
| 31 |
+
write_blocklist
|
| 32 |
+
|
| 33 |
+
touch "$M/ready"
|
| 34 |
+
echo "setup done"
|
tasks/format-code-task-000080/tests/test.patch
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/tests/test_hsmtool_encryption.py b/tests/test_hsmtool_encryption.py
|
| 2 |
+
new file mode 100644
|
| 3 |
+
index 000000000..bca7030fb
|
| 4 |
+
--- /dev/null
|
| 5 |
+
+++ b/tests/test_hsmtool_encryption.py
|
| 6 |
+
@@ -0,0 +1,161 @@
|
| 7 |
+
+
|
| 8 |
+
+
|
| 9 |
+
+
|
| 10 |
+
+
|
| 11 |
+
+
|
| 12 |
+
+
|
| 13 |
+
+
|
| 14 |
+
+
|
| 15 |
+
+import os
|
| 16 |
+
+import select
|
| 17 |
+
+import subprocess
|
| 18 |
+
+import time
|
| 19 |
+
+
|
| 20 |
+
+HSMTOOL = "tools/hsmtool"
|
| 21 |
+
+PLAINTEXT_LEN = 32
|
| 22 |
+
+ENCRYPTED_LEN = 73
|
| 23 |
+
+
|
| 24 |
+
+
|
| 25 |
+
+def _run_hsmtool(args, inputs, timeout=60):
|
| 26 |
+
+
|
| 27 |
+
+
|
| 28 |
+
+
|
| 29 |
+
+
|
| 30 |
+
+
|
| 31 |
+
+
|
| 32 |
+
+
|
| 33 |
+
+
|
| 34 |
+
+ inputs = list(inputs)
|
| 35 |
+
+ master, slave = os.openpty()
|
| 36 |
+
+ proc = subprocess.Popen(
|
| 37 |
+
+ [HSMTOOL, *args],
|
| 38 |
+
+ stdin=slave,
|
| 39 |
+
+ stdout=subprocess.PIPE,
|
| 40 |
+
+ stderr=subprocess.STDOUT,
|
| 41 |
+
+ )
|
| 42 |
+
+ os.close(slave)
|
| 43 |
+
+
|
| 44 |
+
+ out = b""
|
| 45 |
+
+ handled_newlines = 0
|
| 46 |
+
+ fd = proc.stdout.fileno()
|
| 47 |
+
+ deadline = time.time() + timeout
|
| 48 |
+
+ try:
|
| 49 |
+
+ while True:
|
| 50 |
+
+ if time.time() > deadline:
|
| 51 |
+
+ proc.kill()
|
| 52 |
+
+ out += b"<TIMEOUT>"
|
| 53 |
+
+ break
|
| 54 |
+
+ ready, _, _ = select.select([fd], [], [], 0.2)
|
| 55 |
+
+ if ready:
|
| 56 |
+
+ chunk = os.read(fd, 4096)
|
| 57 |
+
+ if not chunk:
|
| 58 |
+
+ break
|
| 59 |
+
+ out += chunk
|
| 60 |
+
+ seen = out.count(b"\n")
|
| 61 |
+
+
|
| 62 |
+
+
|
| 63 |
+
+ while inputs and seen > handled_newlines:
|
| 64 |
+
+ line = inputs.pop(0)
|
| 65 |
+
+
|
| 66 |
+
+
|
| 67 |
+
+ time.sleep(0.05)
|
| 68 |
+
+ try:
|
| 69 |
+
+ os.write(master, line.encode())
|
| 70 |
+
+ except OSError:
|
| 71 |
+
+ pass
|
| 72 |
+
+ handled_newlines += 1
|
| 73 |
+
+ elif proc.poll() is not None:
|
| 74 |
+
+ try:
|
| 75 |
+
+ while True:
|
| 76 |
+
+ chunk = os.read(fd, 4096)
|
| 77 |
+
+ if not chunk:
|
| 78 |
+
+ break
|
| 79 |
+
+ out += chunk
|
| 80 |
+
+ except OSError:
|
| 81 |
+
+ pass
|
| 82 |
+
+ break
|
| 83 |
+
+ finally:
|
| 84 |
+
+ proc.stdout.close()
|
| 85 |
+
+ rc = proc.wait()
|
| 86 |
+
+ os.close(master)
|
| 87 |
+
+ return rc, out.decode(errors="replace")
|
| 88 |
+
+
|
| 89 |
+
+
|
| 90 |
+
+def _write_secret(path, data):
|
| 91 |
+
+ with open(path, "wb") as f:
|
| 92 |
+
+ f.write(data)
|
| 93 |
+
+
|
| 94 |
+
+
|
| 95 |
+
+def test_encrypt_password_mismatch_aborts(tmp_path):
|
| 96 |
+
+
|
| 97 |
+
+ seed = bytes(range(PLAINTEXT_LEN))
|
| 98 |
+
+ path = str(tmp_path / "hsm_secret")
|
| 99 |
+
+ _write_secret(path, seed)
|
| 100 |
+
+
|
| 101 |
+
+ rc, out = _run_hsmtool(["encrypt", path], ["hunter2cool\n", "hunter2typo\n"])
|
| 102 |
+
+
|
| 103 |
+
+
|
| 104 |
+
+ assert rc != 0, out
|
| 105 |
+
+
|
| 106 |
+
+ with open(path, "rb") as f:
|
| 107 |
+
+ after = f.read()
|
| 108 |
+
+ assert after == seed
|
| 109 |
+
+ assert len(after) == PLAINTEXT_LEN
|
| 110 |
+
+
|
| 111 |
+
+
|
| 112 |
+
+def test_encrypt_then_decrypt_roundtrip(tmp_path):
|
| 113 |
+
+
|
| 114 |
+
+ seed = bytes((i * 7 + 3) % 256 for i in range(PLAINTEXT_LEN))
|
| 115 |
+
+ path = str(tmp_path / "hsm_secret")
|
| 116 |
+
+ _write_secret(path, seed)
|
| 117 |
+
+
|
| 118 |
+
+ password = "a-correct-horse-battery-staple"
|
| 119 |
+
+
|
| 120 |
+
+ rc, out = _run_hsmtool(["encrypt", path], [password + "\n", password + "\n"])
|
| 121 |
+
+ assert rc == 0, out
|
| 122 |
+
+ with open(path, "rb") as f:
|
| 123 |
+
+ encrypted = f.read()
|
| 124 |
+
+
|
| 125 |
+
+ assert len(encrypted) == ENCRYPTED_LEN
|
| 126 |
+
+ assert encrypted != seed
|
| 127 |
+
+
|
| 128 |
+
+ rc, out = _run_hsmtool(["decrypt", path], [password + "\n"])
|
| 129 |
+
+ assert rc == 0, out
|
| 130 |
+
+ with open(path, "rb") as f:
|
| 131 |
+
+ recovered = f.read()
|
| 132 |
+
+ assert recovered == seed
|
| 133 |
+
+
|
| 134 |
+
+
|
| 135 |
+
+def test_invalid_size_rejected_on_encrypt(tmp_path):
|
| 136 |
+
+
|
| 137 |
+
+ password = "some-decent-password"
|
| 138 |
+
+ for size in (16, 40, 64, 100):
|
| 139 |
+
+ path = str(tmp_path / f"hsm_secret_{size}")
|
| 140 |
+
+ data = bytes((i + 1) % 256 for i in range(size))
|
| 141 |
+
+ _write_secret(path, data)
|
| 142 |
+
+
|
| 143 |
+
+ rc, out = _run_hsmtool(
|
| 144 |
+
+ ["encrypt", path], [password + "\n", password + "\n"]
|
| 145 |
+
+ )
|
| 146 |
+
+
|
| 147 |
+
+ assert rc != 0, (size, out)
|
| 148 |
+
+ assert "invalid" in out.lower(), (size, out)
|
| 149 |
+
+
|
| 150 |
+
+ with open(path, "rb") as f:
|
| 151 |
+
+ assert f.read() == data, size
|
| 152 |
+
+
|
| 153 |
+
+
|
| 154 |
+
+def test_invalid_size_rejected_on_decrypt(tmp_path):
|
| 155 |
+
+
|
| 156 |
+
+ password = "some-decent-password"
|
| 157 |
+
+ for size in (16, 40, 64, 100):
|
| 158 |
+
+ path = str(tmp_path / f"hsm_secret_{size}")
|
| 159 |
+
+ data = bytes((i * 3 + 5) % 256 for i in range(size))
|
| 160 |
+
+ _write_secret(path, data)
|
| 161 |
+
+
|
| 162 |
+
+ rc, out = _run_hsmtool(["decrypt", path], [password + "\n"])
|
| 163 |
+
+
|
| 164 |
+
+ assert rc != 0, (size, out)
|
| 165 |
+
+ assert "invalid" in out.lower(), (size, out)
|
| 166 |
+
+ with open(path, "rb") as f:
|
| 167 |
+
+ assert f.read() == data, size
|
| 168 |
+
diff --git a/mimo_test_command.sh b/mimo_test_command.sh
|
| 169 |
+
new file mode 100755
|
| 170 |
+
--- /dev/null
|
| 171 |
+
+++ b/mimo_test_command.sh
|
| 172 |
+
@@ -0,0 +1,21 @@
|
| 173 |
+
+#!/usr/bin/env bash
|
| 174 |
+
+
|
| 175 |
+
+
|
| 176 |
+
+
|
| 177 |
+
+set -euo pipefail
|
| 178 |
+
+HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
| 179 |
+
+cd /testbed
|
| 180 |
+
+
|
| 181 |
+
+
|
| 182 |
+
+
|
| 183 |
+
+
|
| 184 |
+
+
|
| 185 |
+
+make tools/hsmtool
|
| 186 |
+
+
|
| 187 |
+
+
|
| 188 |
+
+
|
| 189 |
+
+make common/test/run-derive_basepoints
|
| 190 |
+
+./common/test/run-derive_basepoints
|
| 191 |
+
+
|
| 192 |
+
+
|
| 193 |
+
+python3 -m pytest tests/test_hsmtool_encryption.py -q -p no:cacheprovider
|
tasks/format-code-task-000080/tests/test.sh
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the
|
| 3 |
+
# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
CWD=/testbed
|
| 6 |
+
V=/logs/verifier
|
| 7 |
+
mkdir -p "$V"
|
| 8 |
+
BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; }
|
| 9 |
+
cd "$CWD" || exit 1
|
| 10 |
+
if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi
|
| 11 |
+
# the agent's change against the base, so its own commits count too
|
| 12 |
+
git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff"
|
| 13 |
+
git reset -q
|
| 14 |
+
if ! (
|
| 15 |
+
while IFS= read -r tf; do
|
| 16 |
+
[ -z "$tf" ] && continue
|
| 17 |
+
if git cat-file -e $BASE:"$tf" 2>/dev/null; then
|
| 18 |
+
git checkout $BASE -- "$tf" 2>/dev/null || true
|
| 19 |
+
else
|
| 20 |
+
git rm -f --cached "$tf" >/dev/null 2>&1 || true
|
| 21 |
+
rm -f "$tf"
|
| 22 |
+
fi
|
| 23 |
+
done <<'EOF_RESET_TEST_FILES'
|
| 24 |
+
tests/test_hsmtool_encryption.py
|
| 25 |
+
mimo_test_command.sh
|
| 26 |
+
EOF_RESET_TEST_FILES
|
| 27 |
+
|
| 28 |
+
); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi
|
| 29 |
+
if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then
|
| 30 |
+
cat "$V/apply.log" >&2
|
| 31 |
+
echo "the hidden tests could not be applied (testbed problem, not scored)" >&2
|
| 32 |
+
exit 1
|
| 33 |
+
fi
|
| 34 |
+
timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1
|
| 35 |
+
RC=$?
|
| 36 |
+
tail -c 12000 "$V/test_output.log"
|
| 37 |
+
if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi
|
| 38 |
+
echo "test command exited $RC"
|
tasks/format-code-task-000080/tests/test_command.sh
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
bash /testbed/mimo_test_command.sh
|
tasks/format-code-task-000081/environment/Dockerfile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The task's image, pinned by digest (the same as [environment].docker_image).
|
| 2 |
+
# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy.
|
| 3 |
+
FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:18ac41f5a2e66c62b657c71671521f8d8a9dead4a8676bae43908df5bfeb1779
|
tasks/format-code-task-000081/environment/setup/files/blocklist
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# mimo answer-leak blocklist (mimoagent)
|
| 2 |
+
0.0.0.0 github.com
|
| 3 |
+
0.0.0.0 www.github.com
|
| 4 |
+
0.0.0.0 api.github.com
|
| 5 |
+
0.0.0.0 raw.githubusercontent.com
|
| 6 |
+
0.0.0.0 codeload.github.com
|
| 7 |
+
0.0.0.0 objects.githubusercontent.com
|
| 8 |
+
0.0.0.0 gist.github.com
|
| 9 |
+
0.0.0.0 gist.githubusercontent.com
|
| 10 |
+
0.0.0.0 gitlab.com
|
| 11 |
+
0.0.0.0 bitbucket.org
|
| 12 |
+
0.0.0.0 sourceforge.net
|
| 13 |
+
0.0.0.0 git.kernel.org
|
| 14 |
+
0.0.0.0 chromium.googlesource.com
|
| 15 |
+
0.0.0.0 android.googlesource.com
|
| 16 |
+
0.0.0.0 sourcegraph.com
|
| 17 |
+
0.0.0.0 bugs.chromium.org
|
| 18 |
+
0.0.0.0 issues.oss-fuzz.com
|
| 19 |
+
0.0.0.0 oss-fuzz.com
|
| 20 |
+
0.0.0.0 osv.dev
|
| 21 |
+
0.0.0.0 api.osv.dev
|
| 22 |
+
0.0.0.0 bugzilla.mozilla.org
|
| 23 |
+
0.0.0.0 proxy.golang.org
|
| 24 |
+
0.0.0.0 sum.golang.org
|
| 25 |
+
0.0.0.0 pkg.go.dev
|
| 26 |
+
0.0.0.0 google.com
|
| 27 |
+
0.0.0.0 www.google.com
|
| 28 |
+
0.0.0.0 bing.com
|
| 29 |
+
0.0.0.0 www.bing.com
|
| 30 |
+
0.0.0.0 duckduckgo.com
|
| 31 |
+
0.0.0.0 html.duckduckgo.com
|
| 32 |
+
0.0.0.0 search.brave.com
|
| 33 |
+
0.0.0.0 stackoverflow.com
|
tasks/format-code-task-000081/environment/setup/setup.sh
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Runs once, as root, before the agent starts: Harbor's [environment.healthcheck] unpacks this folder into
|
| 3 |
+
# /var/lib/mimo and runs it. Generated by mimo_harbor; see its README for how each step maps to Xiaomi's harness.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
[ -f "$M/ready" ] && exit 0
|
| 6 |
+
chmod 700 "$M"
|
| 7 |
+
fail() { echo "setup: $*" >&2; exit 1; }
|
| 8 |
+
# the answer-leak blocklist (mimoagent), applied to /etc/hosts by the agent right after it installs
|
| 9 |
+
write_blocklist() { cp "$M/files/blocklist" "$M/blocklist"; }
|
| 10 |
+
|
| 11 |
+
# Code: mimoagent environments/datasets/opensource_code.py + base.py, as the explorer runs it (app/runner/domains.py Code).
|
| 12 |
+
CWD=/testbed
|
| 13 |
+
git config --global --add safe.directory "$CWD"
|
| 14 |
+
cd "$CWD" || fail "no working directory $CWD"
|
| 15 |
+
if ! git rev-parse --git-dir >/dev/null 2>&1; then # a bare source tree: give it a baseline commit
|
| 16 |
+
git init -q && git add -A && git -c user.name=mimo -c user.email=mimo@localhost commit -q -m baseline --allow-empty
|
| 17 |
+
fi
|
| 18 |
+
BASE=$(git rev-parse HEAD 2>/dev/null)
|
| 19 |
+
[ ${#BASE} -eq 40 ] || fail "could not resolve the base commit in $CWD"
|
| 20 |
+
echo "$BASE" > "$M/base"
|
| 21 |
+
# Images are built with history truncated at the base. If one is not, the fix could be read out of git log,
|
| 22 |
+
# so .git is hidden while the agent works and put back for grading.
|
| 23 |
+
LATER=$(git rev-list --all --not "$BASE" 2>/dev/null | head -n 5 | grep -c . || true)
|
| 24 |
+
rm -f /tmp/fail.log /tmp/pass.log /tmp/patch.diff /tmp/test_patch.diff /tmp/*.log 2>/dev/null; rm -rf /tmp/claude-0 /tmp/claude-* /tmp/testem-* /tmp/puppeteer_dev_chrome_profile-* 2>/dev/null; rm -f /tmp/test_files.json 2>/dev/null; rm -rf /tmp/jest_* /tmp/jest-* /tmp/build /tmp/build_env 2>/dev/null; rm -rf /tmp/pytest-of-root /tmp/pytest-* /tmp/.pytest_cache /tmp/__pycache__ 2>/dev/null; rm -rf /tmp/go-build* /tmp/standards /tmp/wordpress /tmp/zig-* /tmp/testbase /tmp/testbed 2>/dev/null; rm -f /tmp/tmp*.tmp /tmp/*.bak /tmp/expect* /tmp/butwas* 2>/dev/null; rm -rf /root/.cache/go-build 2>/dev/null; rm -rf /tests 2>/dev/null; find /logs -mindepth 1 -delete 2>/dev/null; mkdir -p /logs/agent /logs/verifier /logs/artifacts; chmod 777 /logs/agent /logs/verifier /logs/artifacts; find /var/log -type f -delete 2>/dev/null || true; rm -rf /var/lib/postgresql/*/*/log /var/lib/postgresql/*/*/pg_log 2>/dev/null || true; find /var/lib/mysql /var/lib/mongodb -type f -name '*.log' -delete 2>/dev/null || true; rm -rf /root/.npm/_logs /root/.babel.json /root/.pytest_cache 2>/dev/null || true; find / -maxdepth 4 -xdev -name task_description.md -path '*/.build_env/*' -delete 2>/dev/null || true; true
|
| 25 |
+
git clean -fdx --exclude=node_modules --exclude=bower_components --exclude=.husky --exclude=vendor --exclude=third_party --exclude=_deps --exclude=vcpkg_installed --exclude=.venv --exclude=venv --exclude=.gradle --exclude=target --exclude=.build --exclude=lib --exclude=.bundle --exclude=Manifest.toml --exclude=_build --exclude=.stack-work --exclude=dist-newstyle >/dev/null 2>&1
|
| 26 |
+
find /root/.m2 -type f \( -name '*-SNAPSHOT.jar' -o -name '*-SNAPSHOT-sources.jar' -o -name '*-SNAPSHOT-tests.jar' -o -name '*-SNAPSHOT-test-sources.jar' \) -delete 2>/dev/null; rm -rf /root/.julia/compiled 2>/dev/null; rm -rf /root/.gradle/caches/build-cache-* /root/.gradle/daemon 2>/dev/null; rm -rf /root/.gradle/caches/*/scripts /root/.gradle/caches/jars-* 2>/dev/null; rm -rf /root/.cache/bazel 2>/dev/null; true
|
| 27 |
+
if [ "$LATER" -gt 0 ]; then
|
| 28 |
+
mv "$CWD/.git" "$M/git-hidden"
|
| 29 |
+
echo "history not truncated at ${BASE:0:12}: .git hidden while the agent works"
|
| 30 |
+
fi
|
| 31 |
+
write_blocklist
|
| 32 |
+
|
| 33 |
+
touch "$M/ready"
|
| 34 |
+
echo "setup done"
|
tasks/format-code-task-000081/tests/test.patch
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/testing/test_runner.py b/testing/test_runner.py
|
| 2 |
+
index eef1d5ed..d7f3cf2f 100644
|
| 3 |
+
--- a/testing/test_runner.py
|
| 4 |
+
+++ b/testing/test_runner.py
|
| 5 |
+
@@ -47,7 +47,7 @@ def non_zero_args5(a, b=1, **kwargs):
|
| 6 |
+
|
| 7 |
+
with utils.TempDir() as temp:
|
| 8 |
+
dpath = temp.dpath
|
| 9 |
+
- modpath = join(dpath, 'test_zero.py')
|
| 10 |
+
+ modpath = join(dpath, 'test_zero_args.py')
|
| 11 |
+
|
| 12 |
+
with open(modpath, 'w') as file:
|
| 13 |
+
file.write(source)
|
| 14 |
+
@@ -60,6 +60,212 @@ def non_zero_args5(a, b=1, **kwargs):
|
| 15 |
+
'zero_args3', 'zero_args4'])
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
+def test_list():
|
| 19 |
+
+ from xdoctest import runner
|
| 20 |
+
+
|
| 21 |
+
+ source = utils.codeblock(
|
| 22 |
+
+ '''
|
| 23 |
+
+ # --- HELPERS ---
|
| 24 |
+
+ def real_test1(a=1):
|
| 25 |
+
+ """
|
| 26 |
+
+ Example:
|
| 27 |
+
+ >>> pass
|
| 28 |
+
+ """
|
| 29 |
+
+ pass
|
| 30 |
+
+
|
| 31 |
+
+ def fake_test1(a=1):
|
| 32 |
+
+ pass
|
| 33 |
+
+
|
| 34 |
+
+ def real_test2():
|
| 35 |
+
+ """
|
| 36 |
+
+ Example:
|
| 37 |
+
+ >>> pass
|
| 38 |
+
+ """
|
| 39 |
+
+ pass
|
| 40 |
+
+
|
| 41 |
+
+ def fake_test2():
|
| 42 |
+
+ pass
|
| 43 |
+
+ ''')
|
| 44 |
+
+
|
| 45 |
+
+ with utils.TempDir() as temp:
|
| 46 |
+
+ dpath = temp.dpath
|
| 47 |
+
+ modpath = join(dpath, 'test_list.py')
|
| 48 |
+
+
|
| 49 |
+
+ with open(modpath, 'w') as file:
|
| 50 |
+
+ file.write(source)
|
| 51 |
+
+
|
| 52 |
+
+ with utils.CaptureStdout() as cap:
|
| 53 |
+
+ runner.doctest_module(modpath, 'list', argv=[''])
|
| 54 |
+
+
|
| 55 |
+
+ assert 'real_test1' in cap.text
|
| 56 |
+
+ assert 'real_test2' in cap.text
|
| 57 |
+
+ assert 'fake_test1' not in cap.text
|
| 58 |
+
+ assert 'fake_test2' not in cap.text
|
| 59 |
+
+
|
| 60 |
+
+
|
| 61 |
+
+ with utils.CaptureStdout() as cap:
|
| 62 |
+
+ runner.doctest_module(modpath, None, argv=[''])
|
| 63 |
+
+
|
| 64 |
+
+ assert 'real_test1' in cap.text
|
| 65 |
+
+ assert 'real_test2' in cap.text
|
| 66 |
+
+ assert 'fake_test1' not in cap.text
|
| 67 |
+
+ assert 'fake_test2' not in cap.text
|
| 68 |
+
+
|
| 69 |
+
+
|
| 70 |
+
+def test_example_run():
|
| 71 |
+
+ from xdoctest import runner
|
| 72 |
+
+
|
| 73 |
+
+ source = utils.codeblock(
|
| 74 |
+
+ '''
|
| 75 |
+
+ def foo():
|
| 76 |
+
+ """
|
| 77 |
+
+ Example:
|
| 78 |
+
+ >>> print('i wanna see this')
|
| 79 |
+
+ """
|
| 80 |
+
+ ''')
|
| 81 |
+
+
|
| 82 |
+
+ with utils.TempDir() as temp:
|
| 83 |
+
+ dpath = temp.dpath
|
| 84 |
+
+ modpath = join(dpath, 'test_example_run.py')
|
| 85 |
+
+
|
| 86 |
+
+ with open(modpath, 'w') as file:
|
| 87 |
+
+ file.write(source)
|
| 88 |
+
+
|
| 89 |
+
+ with utils.CaptureStdout() as cap:
|
| 90 |
+
+ runner.doctest_module(modpath, 'foo', argv=[''])
|
| 91 |
+
+
|
| 92 |
+
+ assert 'i wanna see this' in cap.text
|
| 93 |
+
+
|
| 94 |
+
+
|
| 95 |
+
+def test_all_disabled():
|
| 96 |
+
+ """
|
| 97 |
+
+ pytest testing/test_runner.py::test_all_disabled -s
|
| 98 |
+
+ """
|
| 99 |
+
+ from xdoctest import runner
|
| 100 |
+
+
|
| 101 |
+
+ source = utils.codeblock(
|
| 102 |
+
+ '''
|
| 103 |
+
+ def foo():
|
| 104 |
+
+ """
|
| 105 |
+
+ Example:
|
| 106 |
+
+ >>> # DISABLE_DOCTEST
|
| 107 |
+
+ >>> print('all will not print this')
|
| 108 |
+
+ """
|
| 109 |
+
+
|
| 110 |
+
+ def bar():
|
| 111 |
+
+ """
|
| 112 |
+
+ Example:
|
| 113 |
+
+ >>> print('all will print this')
|
| 114 |
+
+ """
|
| 115 |
+
+ ''')
|
| 116 |
+
+
|
| 117 |
+
+ with utils.TempDir() as temp:
|
| 118 |
+
+ dpath = temp.dpath
|
| 119 |
+
+ modpath = join(dpath, 'test_all_disabled.py')
|
| 120 |
+
+
|
| 121 |
+
+ with open(modpath, 'w') as file:
|
| 122 |
+
+ file.write(source)
|
| 123 |
+
+
|
| 124 |
+
+
|
| 125 |
+
+ with utils.CaptureStdout() as cap:
|
| 126 |
+
+ runner.doctest_module(modpath, 'all', argv=[''])
|
| 127 |
+
+ assert 'all will print this' in cap.text
|
| 128 |
+
+ assert 'all will not print this' not in cap.text
|
| 129 |
+
+
|
| 130 |
+
+
|
| 131 |
+
+ with utils.CaptureStdout() as cap:
|
| 132 |
+
+ runner.doctest_module(modpath, 'foo', argv=[''])
|
| 133 |
+
+ assert 'all will not print this' in cap.text
|
| 134 |
+
+
|
| 135 |
+
+
|
| 136 |
+
+def test_failure():
|
| 137 |
+
+ """
|
| 138 |
+
+ pytest testing/test_runner.py::test_all_disabled -s
|
| 139 |
+
+ """
|
| 140 |
+
+ from xdoctest import runner
|
| 141 |
+
+
|
| 142 |
+
+ source = utils.codeblock(
|
| 143 |
+
+ '''
|
| 144 |
+
+ def test1():
|
| 145 |
+
+ """
|
| 146 |
+
+ Example:
|
| 147 |
+
+ >>> pass
|
| 148 |
+
+ """
|
| 149 |
+
+
|
| 150 |
+
+ def test2():
|
| 151 |
+
+ """
|
| 152 |
+
+ Example:
|
| 153 |
+
+ >>> assert False
|
| 154 |
+
+ """
|
| 155 |
+
+ ''')
|
| 156 |
+
+
|
| 157 |
+
+ with utils.TempDir() as temp:
|
| 158 |
+
+ dpath = temp.dpath
|
| 159 |
+
+ modpath = join(dpath, 'test_failure.py')
|
| 160 |
+
+
|
| 161 |
+
+ with open(modpath, 'w') as file:
|
| 162 |
+
+ file.write(source)
|
| 163 |
+
+
|
| 164 |
+
+
|
| 165 |
+
+ with utils.CaptureStdout() as cap:
|
| 166 |
+
+ try:
|
| 167 |
+
+ runner.doctest_module(modpath, 'all', argv=[''], verbose=0)
|
| 168 |
+
+ except Exception:
|
| 169 |
+
+ pass
|
| 170 |
+
+
|
| 171 |
+
+ assert '.F' in cap.text
|
| 172 |
+
+ assert '1 / 2 passed' in cap.text
|
| 173 |
+
+
|
| 174 |
+
+
|
| 175 |
+
+def test_run_zero_arg():
|
| 176 |
+
+ """
|
| 177 |
+
+ pytest testing/test_runner.py::test_run_zero_arg -s
|
| 178 |
+
+ """
|
| 179 |
+
+ from xdoctest import runner
|
| 180 |
+
+
|
| 181 |
+
+ source = utils.codeblock(
|
| 182 |
+
+ '''
|
| 183 |
+
+ def zero_arg_print():
|
| 184 |
+
+ print('running zero arg')
|
| 185 |
+
+ ''')
|
| 186 |
+
+
|
| 187 |
+
+ with utils.TempDir() as temp:
|
| 188 |
+
+ dpath = temp.dpath
|
| 189 |
+
+ modpath = join(dpath, 'test_run_zero_arg.py')
|
| 190 |
+
+
|
| 191 |
+
+ with open(modpath, 'w') as file:
|
| 192 |
+
+ file.write(source)
|
| 193 |
+
+
|
| 194 |
+
+
|
| 195 |
+
+ with utils.CaptureStdout() as cap:
|
| 196 |
+
+ try:
|
| 197 |
+
+ runner.doctest_module(modpath, 'all', argv=[''], verbose=3)
|
| 198 |
+
+ except Exception:
|
| 199 |
+
+ pass
|
| 200 |
+
+ assert 'running zero arg' not in cap.text
|
| 201 |
+
+
|
| 202 |
+
+ with utils.CaptureStdout() as cap:
|
| 203 |
+
+ try:
|
| 204 |
+
+ runner.doctest_module(modpath, 'zero_arg_print', argv=[''], verbose=3)
|
| 205 |
+
+ except Exception:
|
| 206 |
+
+ pass
|
| 207 |
+
+
|
| 208 |
+
+ assert 'running zero arg' in cap.text
|
| 209 |
+
+
|
| 210 |
+
+
|
| 211 |
+
+def test_parse_cmdline():
|
| 212 |
+
+ """
|
| 213 |
+
+ pytest testing/test_runner.py::test_parse_cmdline -s
|
| 214 |
+
+ """
|
| 215 |
+
+ from xdoctest import runner
|
| 216 |
+
+
|
| 217 |
+
+ runner._parse_commandline(command=None, style=None, verbose=None, argv=None)
|
| 218 |
+
+
|
| 219 |
+
+ assert 'freeform' == runner._parse_commandline(command=None, style=None, verbose=None, argv=['--freeform'])[1]
|
| 220 |
+
+ assert 'google' == runner._parse_commandline(command=None, style=None, verbose=None, argv=['--google'])[1]
|
| 221 |
+
+ assert None is runner._parse_commandline(command=None, style=None, verbose=None, argv=['--google'])[0]
|
| 222 |
+
+
|
| 223 |
+
+
|
| 224 |
+
if __name__ == '__main__':
|
| 225 |
+
r"""
|
| 226 |
+
CommandLine:
|
| 227 |
+
diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64
|
| 228 |
+
new file mode 100644
|
| 229 |
+
--- /dev/null
|
| 230 |
+
+++ b/mimo_build_env.tar.gz.b64
|
| 231 |
+
@@ -0,0 +1,8 @@
|
| 232 |
+
+H4sIAAAAAAAAA+3TzYrbMBAA4Jz9FMP2khz8l42zUGihb1D6AkG2Zu2hiiT0423evvJP0lJo97Kh
|
| 233 |
+
+lM53iEI0nhl5lKKNpOQJ9Vhu7qVKnppmXpNf1/l73ezr/aGp60OKq+tjVW+guVtHP4k+CAewccaE
|
| 234 |
+
+P8W9tv+PKn7MP6APp86cz0LLwg9vV+O1+T89Hm7zr+b5H477agPV27Xwe//5/DsJ8+BblFn2Dj51
|
| 235 |
+
+gUYREMKAYNF58gF1gM+XMBgNj8URRnIhCpVuDGw1okQJz8aBwwJ9JyxCukJWhF3mTXQdQjm9ubIY
|
| 236 |
+
+0wOnb9J0U7WyJV2KtdZU9wuSToNQCq4h8OzMGdYcW5QURKtwB8EAah8dAvZ9rkh/BfIpGP2QWbJw
|
| 237 |
+
+zZPj7WCQ59rkpG0MsP9YShxLHZWa60Y9HzXdgR4DLIVJIbxQGOadWz/2siwq9qRBkp/6kSnHdn5X
|
| 238 |
+
+y8+D8Ov5qSVF4ZKa8xH9kk/jC7o10S6zyzvNz9fU0wfpfvkjuqg1usJeIB8ht6DN+1sruYEHIaWx
|
| 239 |
+
+wX9IW8vjKfMStkY9ZH/7bjHGGGOMMcYYY4wxxhhjjDHGGGOMsfv7Dv3spYUAKAAA
|
| 240 |
+
diff --git a/mimo_test_command.sh b/mimo_test_command.sh
|
| 241 |
+
new file mode 100755
|
| 242 |
+
--- /dev/null
|
| 243 |
+
+++ b/mimo_test_command.sh
|
| 244 |
+
@@ -0,0 +1,6 @@
|
| 245 |
+
+#!/usr/bin/env bash
|
| 246 |
+
+
|
| 247 |
+
+set -uo pipefail
|
| 248 |
+
+cd /testbed || exit 1
|
| 249 |
+
+base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1
|
| 250 |
+
+exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh'
|
tasks/format-code-task-000081/tests/test.sh
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Code grading, mimoagent opensource_code.py: reset the files the hidden test patch touches, apply it, run the
|
| 3 |
+
# task's test command; reward 1 when it exits 0. A testbed failure (reset or apply) writes no reward: not scored.
|
| 4 |
+
M=/var/lib/mimo
|
| 5 |
+
CWD=/testbed
|
| 6 |
+
V=/logs/verifier
|
| 7 |
+
mkdir -p "$V"
|
| 8 |
+
BASE=$(cat "$M/base" 2>/dev/null) || { echo "setup never ran (no $M/base)" >&2; exit 1; }
|
| 9 |
+
cd "$CWD" || exit 1
|
| 10 |
+
if [ -d "$M/git-hidden" ]; then rm -rf "$CWD/.git"; mv "$M/git-hidden" "$CWD/.git"; fi
|
| 11 |
+
# the agent's change against the base, so its own commits count too
|
| 12 |
+
git add -A >/dev/null 2>&1 && git -c core.fileMode=false diff --cached "$BASE" > "$V/agent.diff"
|
| 13 |
+
git reset -q
|
| 14 |
+
if ! (
|
| 15 |
+
while IFS= read -r tf; do
|
| 16 |
+
[ -z "$tf" ] && continue
|
| 17 |
+
if git cat-file -e $BASE:"$tf" 2>/dev/null; then
|
| 18 |
+
git checkout $BASE -- "$tf" 2>/dev/null || true
|
| 19 |
+
else
|
| 20 |
+
git rm -f --cached "$tf" >/dev/null 2>&1 || true
|
| 21 |
+
rm -f "$tf"
|
| 22 |
+
fi
|
| 23 |
+
done <<'EOF_RESET_TEST_FILES'
|
| 24 |
+
testing/test_runner.py
|
| 25 |
+
mimo_build_env.tar.gz.b64
|
| 26 |
+
mimo_test_command.sh
|
| 27 |
+
EOF_RESET_TEST_FILES
|
| 28 |
+
|
| 29 |
+
); then echo "could not reset the test files (testbed problem, not scored)" >&2; exit 1; fi
|
| 30 |
+
if ! git apply --verbose /tests/test.patch > "$V/apply.log" 2>&1; then
|
| 31 |
+
cat "$V/apply.log" >&2
|
| 32 |
+
echo "the hidden tests could not be applied (testbed problem, not scored)" >&2
|
| 33 |
+
exit 1
|
| 34 |
+
fi
|
| 35 |
+
timeout 1800 sh -c "$(cat /tests/test_command.sh)" > "$V/test_output.log" 2>&1
|
| 36 |
+
RC=$?
|
| 37 |
+
tail -c 12000 "$V/test_output.log"
|
| 38 |
+
if [ $RC -eq 0 ]; then echo 1 > "$V/reward.txt"; else echo 0 > "$V/reward.txt"; fi
|
| 39 |
+
echo "test command exited $RC"
|
tasks/format-code-task-000081/tests/test_command.sh
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
bash /testbed/mimo_test_command.sh
|
tasks/format-code-task-000087/environment/Dockerfile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The task's image, pinned by digest (the same as [environment].docker_image).
|
| 2 |
+
# Setup runs at start from [environment.healthcheck]; environment/setup/ is its readable copy.
|
| 3 |
+
FROM docker.io/xiaomimimo/mimo-v2.6-rl-oss@sha256:7ccc494b08b3f8f4b2dd67c2957845ff95ce2a2af29201ad9abe4ed14d548399
|
tasks/format-code-task-000087/environment/setup/files/blocklist
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# mimo answer-leak blocklist (mimoagent)
|
| 2 |
+
0.0.0.0 github.com
|
| 3 |
+
0.0.0.0 www.github.com
|
| 4 |
+
0.0.0.0 api.github.com
|
| 5 |
+
0.0.0.0 raw.githubusercontent.com
|
| 6 |
+
0.0.0.0 codeload.github.com
|
| 7 |
+
0.0.0.0 objects.githubusercontent.com
|
| 8 |
+
0.0.0.0 gist.github.com
|
| 9 |
+
0.0.0.0 gist.githubusercontent.com
|
| 10 |
+
0.0.0.0 gitlab.com
|
| 11 |
+
0.0.0.0 bitbucket.org
|
| 12 |
+
0.0.0.0 sourceforge.net
|
| 13 |
+
0.0.0.0 git.kernel.org
|
| 14 |
+
0.0.0.0 chromium.googlesource.com
|
| 15 |
+
0.0.0.0 android.googlesource.com
|
| 16 |
+
0.0.0.0 sourcegraph.com
|
| 17 |
+
0.0.0.0 bugs.chromium.org
|
| 18 |
+
0.0.0.0 issues.oss-fuzz.com
|
| 19 |
+
0.0.0.0 oss-fuzz.com
|
| 20 |
+
0.0.0.0 osv.dev
|
| 21 |
+
0.0.0.0 api.osv.dev
|
| 22 |
+
0.0.0.0 bugzilla.mozilla.org
|
| 23 |
+
0.0.0.0 proxy.golang.org
|
| 24 |
+
0.0.0.0 sum.golang.org
|
| 25 |
+
0.0.0.0 pkg.go.dev
|
| 26 |
+
0.0.0.0 google.com
|
| 27 |
+
0.0.0.0 www.google.com
|
| 28 |
+
0.0.0.0 bing.com
|
| 29 |
+
0.0.0.0 www.bing.com
|
| 30 |
+
0.0.0.0 duckduckgo.com
|
| 31 |
+
0.0.0.0 html.duckduckgo.com
|
| 32 |
+
0.0.0.0 search.brave.com
|
| 33 |
+
0.0.0.0 stackoverflow.com
|