Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/result-server-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- "scripts/tests/fixtures/**"
- "scripts/tests/test_genesis_gpu_mlp_estimation.sh"
- "scripts/tests/test_result_profile_data.sh"
- "scripts/tests/test_process_and_send_results.sh"
- "scripts/tests/test_send_estimate_artifacts.sh"
- "scripts/tests/test_send_results_profile_data.sh"
- "scripts/test_estimate_submit.sh"
Expand Down Expand Up @@ -49,6 +50,7 @@ on:
- "scripts/tests/fixtures/**"
- "scripts/tests/test_genesis_gpu_mlp_estimation.sh"
- "scripts/tests/test_result_profile_data.sh"
- "scripts/tests/test_process_and_send_results.sh"
- "scripts/tests/test_send_estimate_artifacts.sh"
- "scripts/tests/test_send_results_profile_data.sh"
- "scripts/test_estimate_submit.sh"
Expand Down Expand Up @@ -127,6 +129,7 @@ jobs:
bash scripts/tests/test_bk_profiler.sh
bash scripts/tests/test_ncu_plan_generation.sh
bash scripts/tests/test_result_profile_data.sh
bash scripts/tests/test_process_and_send_results.sh
bash scripts/tests/test_send_results_profile_data.sh
bash scripts/tests/test_send_estimate_artifacts.sh
bash scripts/tests/test_estimation_gpu_kernel_ensemble_average.sh
Expand Down
1 change: 1 addition & 0 deletions scripts/result_server/process_and_send_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ work_dir="${project_dir}/send_results_workspace"
rm -rf "$work_dir"
mkdir -p "$work_dir"
cp -R results "$work_dir/results"
chmod -R u+rwX "$work_dir/results"

cd "$work_dir"
bash "$project_dir/scripts/collect_timing.sh"
Expand Down
62 changes: 62 additions & 0 deletions scripts/tests/test_process_and_send_results.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/bin/bash
set -euo pipefail

SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
REPO_DIR=$(cd "${SCRIPT_DIR}/../.." && pwd)

if ! command -v jq >/dev/null 2>&1; then
echo "jq not found; skipping process_and_send_results test"
exit 0
fi

TMP_DIR=$(mktemp -d)
trap 'chmod -R u+rwX "${TMP_DIR}" 2>/dev/null || true; rm -rf "${TMP_DIR}"' EXIT

mkdir -p "${TMP_DIR}/project/scripts/result_server" "${TMP_DIR}/project/results" "${TMP_DIR}/bin"
cp "${REPO_DIR}/scripts/collect_timing.sh" "${TMP_DIR}/project/scripts/collect_timing.sh"
cp "${REPO_DIR}/scripts/result.sh" "${TMP_DIR}/project/scripts/result.sh"
cp "${REPO_DIR}/scripts/result_server/send_results.sh" "${TMP_DIR}/project/scripts/result_server/send_results.sh"
cp "${REPO_DIR}/scripts/result_server/process_and_send_results.sh" "${TMP_DIR}/project/scripts/result_server/process_and_send_results.sh"

cat > "${TMP_DIR}/project/results/result" <<'EOF'
FOM:1.25 FOM_unit:s FOM_version:test Exp:CASE0 node_count:1 numproc_node:2 nthreads:3
EOF

printf '%s\n' 100 > "${TMP_DIR}/project/results/build_start"
printf '%s\n' 105 > "${TMP_DIR}/project/results/build_end"
printf '%s\n' 110 > "${TMP_DIR}/project/results/run_start"
printf '%s\n' 120 > "${TMP_DIR}/project/results/run_end"

cat > "${TMP_DIR}/bin/curl" <<'EOF'
#!/bin/bash
set -euo pipefail
if printf '%s\n' "$*" | grep -q '/api/ingest/result'; then
printf '%s\n' '{"id":"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee","timestamp":"20260728_070000"}'
exit 0
fi
printf '%s\n' '{"status":"ok"}'
EOF
chmod +x "${TMP_DIR}/bin/curl"

chmod -R a-w "${TMP_DIR}/project/results"
chmod -R a+rX "${TMP_DIR}/project/results"

export PATH="${TMP_DIR}/bin:${PATH}"
export RESULT_SERVER="https://example.invalid"
export RESULT_SERVER_KEY="dummy"

pushd "${TMP_DIR}/project" >/dev/null
bash scripts/result_server/process_and_send_results.sh qws Fugaku cross qws_Fugaku_build qws_Fugaku_N1_P2_T3_run 12345
popd >/dev/null

test ! -f "${TMP_DIR}/project/results/result0.json"
test -f "${TMP_DIR}/project/send_results_workspace/results/result0.json"
test -f "${TMP_DIR}/project/send_results_workspace/results/server_result_meta.json"
test -f "${TMP_DIR}/project/send_results_workspace/results/pipeline_timing.json"

jq -e '._server_uuid == "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"' \
"${TMP_DIR}/project/send_results_workspace/results/result0.json" >/dev/null
jq -e '."result0.json".uuid == "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"' \
"${TMP_DIR}/project/send_results_workspace/results/server_result_meta.json" >/dev/null

echo "process_and_send_results read-only artifact test passed"
Loading