Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Describe the versions that you are currently using:

<!-- Please complete the following description. -->
- Isaac Lab Version: [e.g. 2.3.0]
- Isaac Sim Version: [e.g. 5.1, this can be obtained by `cat ${ISAACSIM_PATH}/VERSION`]
- Isaac Sim Version: [e.g. 6.0, this can be obtained by `cat ${ISAACSIM_PATH}/VERSION`]
155 changes: 154 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,153 @@ jobs:
exit 1
fi

test-general-windows:
runs-on: [self-hosted, gpu-windows]
timeout-minutes: 180

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true

- name: Setup Isaac Sim and Isaac Lab Environment
shell: powershell
run: |
Write-Host "Setting up Isaac Sim and Isaac Lab environment for Windows..."

# Check if virtual environment exists, create if not
if (-not (Test-Path "env_isaaclab")) {
Write-Host "Creating Python 3.11 virtual environment..."

# Use the pre-installed Python 3.11 on the self-hosted runner
$python311Path = "C:\Python311\python.exe"

if (Test-Path $python311Path) {
Write-Host "Using Python 3.11 from: $python311Path"
& $python311Path -m venv env_isaaclab
} elseif (Get-Command py -ErrorAction SilentlyContinue) {
Write-Host "Using Python launcher (py -3.11) to create virtual environment..."
py -3.11 -m venv env_isaaclab
} else {
Write-Host "WARNING: Python 3.11 not found at expected location. Using default python..."
python -m venv env_isaaclab
}
} else {
Write-Host "Virtual environment already exists"
}

# Activate virtual environment
Write-Host "Activating virtual environment..."
& "env_isaaclab\Scripts\Activate.ps1"

# Upgrade pip
Write-Host "Upgrading pip..."
python -m pip install --upgrade pip

# Check if Isaac Sim is installed
Write-Host "Checking if Isaac Sim is already installed..."
$isaacsimCheck = python -c "try:`n import isaacsim`n print('installed')`nexcept:`n print('not_installed')" 2>&1

if ($isaacsimCheck -match "installed") {
Write-Host "Isaac Sim already installed"
} else {
Write-Host "Installing Isaac Sim from NVIDIA PyPI..."
pip install "isaacsim[all,extscache]==5.1.0" --extra-index-url https://pypi.nvidia.com
}

python -m pip install "isaacsim[all,extscache]==5.1.0" --extra-index-url https://pypi.nvidia.com

# Install/update PyTorch with CUDA support
Write-Host "Installing PyTorch with CUDA 12.8..."
python -m pip install -U torch==2.7.0 torchvision==0.22.0 --index-url https://download.pytorch.org/whl/cu128

# Accept Isaac Sim pip EULA
$env:ISAACSIM_ACCEPT_EULA = "YES"

# Install Isaac Lab dependencies
Write-Host "Installing Isaac Lab..."
& ".\isaaclab.bat" -i

# Verify pytest is available
Write-Host "Verifying pytest installation..."
python -m pip show pytest

- name: Run General Tests on Windows
id: run-general-tests-windows
shell: powershell
continue-on-error: true
run: |
Write-Host "Running general tests on Windows..."

# Activate virtual environment
& "env_isaaclab\Scripts\Activate.ps1"

# Create reports directory
New-Item -ItemType Directory -Force -Path "reports" | Out-Null

# Set environment variables for headless mode
$env:OMNI_KIT_ACCEPT_EULA = "yes"
$env:ACCEPT_EULA = "Y"
$env:ISAACSIM_ACCEPT_EULA = "YES"
$env:ISAAC_SIM_HEADLESS = "1"
$env:ISAAC_SIM_LOW_MEMORY = "1"
$env:PYTHONUNBUFFERED = "1"
$env:PYTHONIOENCODING = "utf-8"
$env:WINDOWS_PLATFORM = "true"

python -m pip show isaacsim

# Run tests using isaaclab.bat with pytest
# Run pytest directly with filter to exclude isaaclab_tasks
& python -m pytest tools `
--ignore=tools/conftest.py `
-m "windows" `
-k "not isaaclab_tasks" `
-v `
--junitxml=reports/general-tests-windows-report.xml

$testExitCode = $LASTEXITCODE
Write-Host "Tests completed with exit code: $testExitCode"

# Check if report was generated
if (Test-Path "reports/general-tests-windows-report.xml") {
Write-Host "Test report generated successfully"
} else {
Write-Host "Warning: Test report not found"
# Create a fallback report
$fallbackReport = '<?xml version="1.0" encoding="utf-8"?><testsuite name="windows-general-tests" tests="0" failures="0" errors="1" time="0"><testcase classname="setup" name="no_results_found"><error message="No test results found">Tests may have failed to generate results</error></testcase></testsuite>'
Set-Content -Path "reports/general-tests-windows-report.xml" -Value $fallbackReport
}

- name: Upload Windows General Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: general-test-results-windows
path: reports/general-tests-windows-report.xml
retention-days: 1
compression-level: 9

- name: Check Test Results for Fork PRs
if: github.event.pull_request.head.repo.full_name != github.repository
shell: powershell
run: |
if (Test-Path "reports/general-tests-windows-report.xml") {
# Read the XML and check for failures
$xmlContent = Get-Content "reports/general-tests-windows-report.xml" -Raw
if ($xmlContent -match 'failures="[1-9]' -or $xmlContent -match 'errors="[1-9]') {
Write-Host "Tests failed for PR from fork. The test report is in the logs. Failing the job."
exit 1
}
} else {
Write-Host "No test results file found. This might indicate test execution failed."
exit 1
}

combine-results:
needs: [test-isaaclab-tasks, test-general]
needs: [test-isaaclab-tasks, test-general, test-general-windows]
runs-on: [self-hosted, gpu]
if: always()

Expand All @@ -178,6 +323,14 @@ jobs:
with:
name: general-test-results
path: reports/
continue-on-error: true

- name: Download Windows General Test Results
uses: actions/download-artifact@v4
with:
name: general-test-results-windows
path: reports/
continue-on-error: true

- name: Combine All Test Results
uses: ./.github/actions/combine-results
Expand Down
4 changes: 2 additions & 2 deletions isaaclab.bat
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ if "%arg%"=="-i" (
call :ensure_cuda_torch

for /d %%d in ("%ISAACLAB_PATH%\source\*") do (
set ext_folder="%%d"
set "ext_folder=%%d"
call :install_isaaclab_extension
)
rem install the python packages for supported reinforcement learning frameworks
Expand Down Expand Up @@ -400,7 +400,7 @@ if "%arg%"=="-i" (
call :ensure_cuda_torch

for /d %%d in ("%ISAACLAB_PATH%\source\*") do (
set ext_folder="%%d"
set "ext_folder=%%d"
call :install_isaaclab_extension
)
rem install the python packages for supported reinforcement learning frameworks
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[pytest]
markers =
isaacsim_ci: mark test to run in isaacsim ci
windows: mark test to run on windows platforms
arm: mark test to run on ARM platforms
40 changes: 32 additions & 8 deletions scripts/tools/test/test_cosmos_prompt_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
def temp_templates_file():
"""Create temporary templates file."""
temp_file = tempfile.NamedTemporaryFile(suffix=".json", delete=False)
temp_file.close() # Close file handle before opening with json

# Create test templates
test_templates = {
Expand All @@ -34,16 +35,31 @@ def temp_templates_file():

yield temp_file.name
# Cleanup
os.remove(temp_file.name)
try:
os.remove(temp_file.name)
except PermissionError:
# On Windows, wait a bit and retry
import time

time.sleep(0.1)
os.remove(temp_file.name)


@pytest.fixture
def temp_output_file():
"""Create temporary output file."""
temp_file = tempfile.NamedTemporaryFile(suffix=".txt", delete=False)
temp_file.close() # Close file handle immediately
yield temp_file.name
# Cleanup
os.remove(temp_file.name)
try:
os.remove(temp_file.name)
except PermissionError:
# On Windows, wait a bit and retry
import time

time.sleep(0.1)
os.remove(temp_file.name)


class TestCosmosPromptGen:
Expand Down Expand Up @@ -72,14 +88,22 @@ def test_generate_prompt_invalid_file(self):
def test_generate_prompt_invalid_json(self):
"""Test generating a prompt with invalid JSON file."""
# Create a temporary file with invalid JSON
with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as temp_file:
temp_file.write(b"invalid json content")
temp_file.flush()
temp_file = tempfile.NamedTemporaryFile(suffix=".json", delete=False)
temp_file.write(b"invalid json content")
temp_file.flush()
temp_file.close() # Close file handle before cleanup

try:
with pytest.raises(ValueError):
generate_prompt(temp_file.name)
finally:
try:
with pytest.raises(ValueError):
generate_prompt(temp_file.name)
finally:
os.remove(temp_file.name)
except PermissionError:
# On Windows, wait a bit and retry
import time

time.sleep(0.1)
os.remove(temp_file.name)

def test_main_function_single_prompt(self, temp_templates_file, temp_output_file):
Expand Down
11 changes: 10 additions & 1 deletion scripts/tools/test/test_hdf5_to_mp4.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
def temp_hdf5_file():
"""Create temporary HDF5 file with test data."""
temp_file = tempfile.NamedTemporaryFile(suffix=".h5", delete=False)
temp_file.close() # Close file handle before opening with h5py

with h5py.File(temp_file.name, "w") as h5f:
# Create test data structure
for demo_id in range(2): # Create 2 demos
Expand All @@ -42,7 +44,14 @@ def temp_hdf5_file():

yield temp_file.name
# Cleanup
os.remove(temp_file.name)
try:
os.remove(temp_file.name)
except PermissionError:
# On Windows, wait a bit and retry
import time

time.sleep(0.1)
os.remove(temp_file.name)


@pytest.fixture
Expand Down
27 changes: 24 additions & 3 deletions scripts/tools/test/test_mp4_to_hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
def temp_hdf5_file():
"""Create temporary HDF5 file with test data."""
temp_file = tempfile.NamedTemporaryFile(suffix=".h5", delete=False)
temp_file.close() # Close file handle before opening with h5py

with h5py.File(temp_file.name, "w") as h5f:
# Create test data structure for 2 demos
for demo_id in range(2):
Expand Down Expand Up @@ -49,7 +51,14 @@ def temp_hdf5_file():

yield temp_file.name
# Cleanup
os.remove(temp_file.name)
try:
os.remove(temp_file.name)
except PermissionError:
# On Windows, wait a bit and retry
import time

time.sleep(0.1)
os.remove(temp_file.name)


@pytest.fixture(scope="class")
Expand Down Expand Up @@ -84,9 +93,17 @@ def temp_videos_dir():
def temp_output_file():
"""Create temporary output file."""
temp_file = tempfile.NamedTemporaryFile(suffix=".h5", delete=False)
temp_file.close() # Close file handle immediately
yield temp_file.name
# Cleanup
os.remove(temp_file.name)
try:
os.remove(temp_file.name)
except PermissionError:
# On Windows, wait a bit and retry
import time

time.sleep(0.1)
os.remove(temp_file.name)


class TestMP4ToHDF5:
Expand Down Expand Up @@ -159,7 +176,9 @@ def test_main_function(self, temp_hdf5_file, temp_videos_dir, temp_output_file):
main()

# Check if output file was created with correct data
with h5py.File(temp_output_file, "r") as f:
# Use explicit close() to ensure file is closed on Windows before cleanup
f = h5py.File(temp_output_file, "r")
try:
# Check if original demos were copied
assert "data/demo_0" in f
assert "data/demo_1" in f
Expand All @@ -176,6 +195,8 @@ def test_main_function(self, temp_hdf5_file, temp_videos_dir, temp_output_file):
assert f"data/demo_{demo_id}/obs/gripper_pos" in f
assert f"data/demo_{demo_id}/obs/table_cam" in f
assert f"data/demo_{demo_id}/obs/wrist_cam" in f
finally:
f.close()
finally:
# Restore original argv
sys.argv = original_argv
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os
import pathlib
import random
import tempfile
from datetime import datetime

from isaaclab.sim.converters.asset_converter_base_cfg import AssetConverterBaseCfg
Expand Down Expand Up @@ -64,9 +65,9 @@ def __init__(self, cfg: AssetConverterBaseCfg):

# resolve USD directory name
if cfg.usd_dir is None:
# a folder in "/tmp/IsaacLab" by the name: usd_{date}_{time}_{random}
# a folder in the system temp directory by the name: IsaacLab/usd_{date}_{time}_{random}
time_tag = datetime.now().strftime("%Y%m%d_%H%M%S")
self._usd_dir = f"/tmp/IsaacLab/usd_{time_tag}_{random.randrange(10000)}"
self._usd_dir = os.path.join(tempfile.gettempdir(), "IsaacLab", f"usd_{time_tag}_{random.randrange(10000)}")
else:
self._usd_dir = cfg.usd_dir

Expand Down
3 changes: 3 additions & 0 deletions source/isaaclab/test/app/test_non_headless_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
from isaaclab.utils import configclass

# Add markers for Windows and ARM platform support
pytestmark = [pytest.mark.windows, pytest.mark.arm]


@configclass
class SensorsSceneCfg(InteractiveSceneCfg):
Expand Down
Loading
Loading