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
18 changes: 17 additions & 1 deletion .github/actions/install-ci-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ inputs:
description: 'Docker base image for the test container'
required: false
default: 'ubuntu:24.04'
premerge:
description: 'Run smoke tests plus tests selected by Testmon coverage'
required: false
default: 'false'
testmon-data-dir:
description: 'Host directory for the persisted Testmon dependency database'
required: false
default: ''
test-filter:
description: 'pytest -k expression (empty = run everything)'
required: false
Expand All @@ -33,12 +41,20 @@ runs:
shell: bash
env:
BASE_IMAGE: ${{ inputs.base-image }}
PREMERGE: ${{ inputs.premerge }}
TESTMON_DATA_DIR: ${{ inputs.testmon-data-dir }}
TEST_FILTER: ${{ inputs.test-filter }}
run: |
args=(docker --gpu --base-image "$BASE_IMAGE"
--build-wheel
--testmon-data-dir "$TESTMON_DATA_DIR"
--results-dir "${{ github.workspace }}/results"
-- --tb=short -sv)
-- --tb=short -sv --testmon)
if [ "$PREMERGE" = "true" ]; then
args+=(--testmon-forceselect)
else
args+=(--testmon-noselect)
fi
[ -n "$TEST_FILTER" ] && args+=(-k "$TEST_FILTER")
# Make `python3` resolve to the uv-managed 3.12 for build.sh's gen_pyproject.py.
# --seed installs pip/setuptools/wheel into the venv so build.sh's `python3 -m pip install`
Expand Down
46 changes: 36 additions & 10 deletions .github/actions/run-package-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ inputs:
description: 'Comma-separated list of specific test files to include'
default: ''
required: false
test-node-ids-file:
description: 'TOML file containing exact pytest node IDs to run'
default: ''
required: false
test-node-ids-key:
description: 'Top-level key in test-node-ids-file containing the node IDs for this job'
default: ''
required: false
pytest-options:
description: 'Additional pytest options'
default: ''
Expand All @@ -81,6 +73,10 @@ inputs:
description: 'Test type stored on each uploaded omni-github test row'
default: 'pytest'
required: false
testmon-mode:
description: 'Override Testmon mode with select or collect'
default: ''
required: false
container-name:
description: 'Docker container name prefix (run-id is appended automatically)'
required: true
Expand Down Expand Up @@ -145,6 +141,36 @@ runs:
printf "🔵 Image pull took %dm %ds\n" $((elapsed/60)) $((elapsed%60))
echo "🔵 Docker Image Pulled in ${elapsed}s" >> "$GITHUB_STEP_SUMMARY"

- name: Select Testmon Mode
id: testmon-mode
shell: bash
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
REQUESTED_MODE: ${{ inputs.testmon-mode }}
run: |
mode="${REQUESTED_MODE:-collect}"
if [ -z "$REQUESTED_MODE" ] && [ "${{ github.event_name }}" = "pull_request" ]; then
if changed_files="$(gh api --paginate "repos/$REPO/pulls/$PR_NUMBER/files" --jq '.[].filename')"; then
relevant_files="$(grep -E '^(source|docker|tools|apps|scripts)/|^\.github/(workflows/(build|config)\.yaml|actions/)|^\.gitmodules$|^[^/]+\.(toml|yaml|yml|json|ini|cfg|conf|lock|sh|bat|ps1)$' <<< "$changed_files" | grep -vE '\.(md|rst|skip)$' || true)"
if [ -z "$relevant_files" ] || ! grep -qvE '\.py$' <<< "$relevant_files"; then
mode=select
fi
else
echo "::warning::Could not list changed files; running the full test suite"
fi
fi
echo "mode=$mode" >> "$GITHUB_OUTPUT"
echo "Testmon mode: $mode" >> "$GITHUB_STEP_SUMMARY"

- name: Restore Testmon Data
uses: actions/cache@v4
with:
path: .testmon/${{ inputs.container-name }}
key: testmon-${{ runner.arch }}-${{ inputs.container-name }}-${{ hashFiles('tools/conftest.py', 'tools/test_settings.py', '.github/actions/run-tests/action.yml', 'docker/Dockerfile.base', 'docker/Dockerfile.curobo', '.github/workflows/config.yaml') }}-${{ github.sha }}
restore-keys: testmon-${{ runner.arch }}-${{ inputs.container-name }}-${{ hashFiles('tools/conftest.py', 'tools/test_settings.py', '.github/actions/run-tests/action.yml', 'docker/Dockerfile.base', 'docker/Dockerfile.curobo', '.github/workflows/config.yaml') }}-

- name: Run Tests
uses: ./.github/actions/run-tests
with:
Expand All @@ -160,11 +186,11 @@ runs:
curobo-only: ${{ inputs.curobo-only }}
quarantined-only: ${{ inputs.quarantined-only }}
include-files: ${{ inputs.include-files }}
test-node-ids-file: ${{ inputs.test-node-ids-file }}
test-node-ids-key: ${{ inputs.test-node-ids-key }}
volume-mount-source: ${{ github.workspace }}
extra-pip-packages: ${{ inputs.extra-pip-packages }}
omni-github-test-type: ${{ inputs.omni-github-test-type }}
testmon-data-dir: .testmon/${{ inputs.container-name }}
testmon-mode: ${{ steps.testmon-mode.outputs.mode }}

- name: Check Test Results
if: always()
Expand Down
73 changes: 35 additions & 38 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ inputs:
description: 'Comma-separated list of specific test file paths to include (e.g., source/pkg/test/test_a.py,source/pkg/test/test_b.py)'
default: ''
required: false
test-node-ids-file:
description: 'TOML file containing exact pytest node IDs to run'
default: ''
required: false
test-node-ids-key:
description: 'Top-level key in test-node-ids-file containing the node IDs for this job'
default: ''
required: false
shard-index:
description: 'Zero-based index of this shard (used with shard-count to split tests across parallel jobs)'
default: ''
Expand All @@ -81,6 +73,14 @@ inputs:
description: 'Test type stored on each uploaded omni-github test row'
default: 'pytest'
required: false
testmon-data-dir:
description: 'Workspace-relative directory for the Testmon dependency database'
default: ''
required: false
testmon-mode:
description: 'Testmon mode: select affected tests, collect a full baseline, or off'
default: 'off'
required: false

runs:
using: composite
Expand All @@ -105,8 +105,8 @@ runs:
local shard_count="${13}"
local volume_mount_source="${14}"
local extra_pip_packages="${15}"
local test_node_ids_file="${16}"
local test_node_ids_key="${17}"
local testmon_data_dir="${16}"
local testmon_mode="${17}"
local logs_pid=""
local wait_pid=""
local docker_wait_file="/tmp/.docker_exit_${container_name}"
Expand All @@ -132,6 +132,9 @@ runs:
if [ -n "$extra_pip_packages" ]; then
echo "With extra pip packages: $extra_pip_packages"
fi
if [ "$testmon_mode" != "off" ]; then
echo "Testmon mode: $testmon_mode"
fi
if [ -n "$filter_pattern" ]; then
echo "With filter pattern: $filter_pattern"
fi
Expand All @@ -144,25 +147,10 @@ runs:
if [ -n "$include_files" ]; then
echo "Include files: $include_files"
fi
if [ -n "$test_node_ids_file" ]; then
echo "Test node IDs file: $test_node_ids_file"
fi
if [ -n "$test_node_ids_key" ]; then
echo "Test node IDs key: $test_node_ids_key"
fi
if [ -n "$shard_index" ] && [ -n "$shard_count" ]; then
echo "Shard: $shard_index of $shard_count"
fi

if [ -n "$test_node_ids_file" ] || [ -n "$test_node_ids_key" ]; then
if [ -z "$test_node_ids_file" ] || [ -z "$test_node_ids_key" ]; then
echo "Both test-node-ids-file and test-node-ids-key must be set together"
return 1
fi
export TEST_NODE_IDS_FILE="$test_node_ids_file"
export TEST_NODE_IDS_KEY="$test_node_ids_key"
fi

# Create reports directory
mkdir -p "$reports_dir"

Expand Down Expand Up @@ -199,16 +187,6 @@ runs:
echo "Setting TEST_INCLUDE_FILES=$include_files_compact"
fi

if [ -n "${TEST_NODE_IDS:-}" ]; then
docker_env_vars="$docker_env_vars -e TEST_NODE_IDS"
echo "Setting TEST_NODE_IDS"
fi

if [ -n "${TEST_NODE_IDS_FILE:-}" ]; then
docker_env_vars="$docker_env_vars -e TEST_NODE_IDS_FILE -e TEST_NODE_IDS_KEY"
echo "Setting TEST_NODE_IDS_FILE=$TEST_NODE_IDS_FILE TEST_NODE_IDS_KEY=$TEST_NODE_IDS_KEY"
fi

if [ -n "$shard_index" ] && [ -n "$shard_count" ]; then
docker_env_vars="$docker_env_vars -e TEST_SHARD_INDEX=$shard_index -e TEST_SHARD_COUNT=$shard_count"
echo "Setting TEST_SHARD_INDEX=$shard_index TEST_SHARD_COUNT=$shard_count"
Expand Down Expand Up @@ -243,6 +221,25 @@ runs:
docker_env_vars="$docker_env_vars -e TEST_EXTRA_PIP_PACKAGES"
fi

testmon_options=""
if [ -n "$testmon_data_dir" ]; then
mkdir -p "$testmon_data_dir"
docker_env_vars="$docker_env_vars -e TESTMON_DATAFILE=/workspace/isaaclab/$testmon_data_dir/.testmondata"
case "$testmon_mode" in
select)
if [ -s "$testmon_data_dir/.testmondata" ]; then
testmon_options="--testmon --testmon-forceselect"
else
echo "::warning::Testmon data is missing; collecting a full baseline"
testmon_options="--testmon --testmon-noselect"
fi
;;
collect) testmon_options="--testmon --testmon-noselect" ;;
off) ;;
*) echo "Unknown Testmon mode: $testmon_mode"; return 1 ;;
esac
fi

# Volume mount for deps-cache-hit mode: bind-mount the checked-out
# source code over /workspace/isaaclab instead of baking it into the image.
docker_volume_args=""
Expand Down Expand Up @@ -322,7 +319,7 @@ runs:
# set this detect-only flag, which makes cold asset downloads
# fall back to slow repeated retries.
unset HUB__ARGS__DETECT_ONLY
./isaaclab.sh -p -m pip install pytest pytest-mock junitparser flatdict flaky \"coverage>=7.6.1\"
./isaaclab.sh -p -m pip install pytest pytest-mock \"pytest-testmon>=2.2,<3\" junitparser flatdict flaky \"coverage>=7.6.1\"
if [ -n \"\${TEST_EXTRA_PIP_PACKAGES:-}\" ]; then
echo \"Installing extra pip packages: \${TEST_EXTRA_PIP_PACKAGES}\"
./isaaclab.sh -p -m pip install \${TEST_EXTRA_PIP_PACKAGES}
Expand All @@ -334,7 +331,7 @@ runs:
esac
fi
echo 'Starting pytest with path: $test_path'
./isaaclab.sh -p -m pytest --ignore=tools/conftest.py $test_path $pytest_options -v --junitxml=tests/$result_file
./isaaclab.sh -p -m pytest --ignore=tools/conftest.py $test_path $pytest_options $testmon_options -v --junitxml=tests/$result_file
"

# Stream container logs in background.
Expand Down Expand Up @@ -431,7 +428,7 @@ runs:
}

# Call the function with provided parameters
run_tests "${{ inputs.test-path }}" "${{ inputs.result-file }}" "${{ inputs.container-name }}" "${{ inputs.image-tag }}" "${{ inputs.reports-dir }}" "${{ inputs.pytest-options }}" "${{ inputs.filter-pattern }}" "${{ inputs.exclude-pattern }}" "${{ inputs.curobo-only }}" "${{ inputs.include-files }}" "${{ inputs.quarantined-only }}" "${{ inputs.shard-index }}" "${{ inputs.shard-count }}" "${{ inputs.volume-mount-source }}" "${{ inputs.extra-pip-packages }}" "${{ inputs.test-node-ids-file }}" "${{ inputs.test-node-ids-key }}"
run_tests "${{ inputs.test-path }}" "${{ inputs.result-file }}" "${{ inputs.container-name }}" "${{ inputs.image-tag }}" "${{ inputs.reports-dir }}" "${{ inputs.pytest-options }}" "${{ inputs.filter-pattern }}" "${{ inputs.exclude-pattern }}" "${{ inputs.curobo-only }}" "${{ inputs.include-files }}" "${{ inputs.quarantined-only }}" "${{ inputs.shard-index }}" "${{ inputs.shard-count }}" "${{ inputs.volume-mount-source }}" "${{ inputs.extra-pip-packages }}" "${{ inputs.testmon-data-dir }}" "${{ inputs.testmon-mode }}"

- name: Kill container on cancellation
if: cancelled()
Expand Down
34 changes: 0 additions & 34 deletions .github/test-subsets/postmerge-rendering.toml

This file was deleted.

Loading
Loading