Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions dokimi/changelog.d/20261205_130000_napetrov_arch-r14-3a.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!--
Copyright (C) 2026 Intel Corporation
SPDX-License-Identifier: Apache-2.0
-->

### Changed

- **No user-visible change.** The `commands` grader reads its run record with the shared run-record reader; the messages and their order are the same.
17 changes: 5 additions & 12 deletions dokimi/dokimi/repos/graders/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
from __future__ import annotations

import importlib
import json
import os
import posixpath
from pathlib import Path
from typing import Any

if __package__:
from . import hidden_tests
from . import hidden_tests, run_record
else: # a script under -I, loaded by main.py, which put this directory on sys.path
hidden_tests = importlib.import_module("hidden_tests")
run_record = importlib.import_module("run_record")

# Bump when a result for the same inputs changes (a metric or ``pass``).
VERSION = "1"
Expand Down Expand Up @@ -122,16 +122,9 @@ def steps(raw: dict[str, Any]) -> list[tuple[str, int, str, list[str]]]:


def _record(run_dir: Path) -> dict[str, Any]:
path = run_dir / RECORD
if not path.is_file():
raise ValueError(f"no {RECORD}: the commands did not run")
doc = json.loads(path.read_text(encoding="utf-8"))
if not isinstance(doc, dict):
raise ValueError(f"{RECORD} is not an object")
if doc.get("problem"): # the framework could not stage the hidden files
raise ValueError(str(doc["problem"]))
groups = doc.get("groups")
if not isinstance(groups, dict):
# read_run_record raises the framework's problem, if the record holds one
doc = run_record.read_run_record(run_dir, RECORD, "the commands did not run")
if not isinstance(doc.get("groups"), dict):
raise ValueError(f"{RECORD} has no groups")
return doc

Expand Down
Loading