Skip to content

Commit

Permalink
Add test for checking rendering when installed from pip+git (#584)
Browse files Browse the repository at this point in the history
* more test

* add flag
  • Loading branch information
QuanyiLi committed Dec 19, 2023
1 parent de63064 commit e1f4b94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ jobs:
pip install nbmake pytest-xdist
mkdir ./tests/test_ipynb
cp ./examples/Basic_MetaDrive_Usages.ipynb ./tests/test_ipynb/
pytest --nbmake -n=auto ./tests/test_ipynb/
TEST_IPYNB=1 pytest --nbmake -n=auto ./tests/test_ipynb/
test_doc_code:
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion metadrive/examples/Basic_MetaDrive_Usages.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -470,15 +470,17 @@
"outputs": [],
"source": [
"from metadrive.envs.metadrive_env import MetaDriveEnv\n",
"import os\n",
"\n",
"cfg=dict(image_observation=True, \n",
" show_terrain=not os.getenv('TEST_IPYNB'),\n",
" vehicle_config=dict(image_source=\"main_camera\"),\n",
" window_size=(84, 60))\n",
"\n",
"env=MetaDriveEnv(cfg)\n",
"try:\n",
" env.reset()\n",
" for _ in range(5):\n",
" for _ in range(1 if os.getenv('TEST_DOC') else 5):\n",
" env.step([0,0])\n",
" env.capture(\"3d_renderer.png\")\n",
"\n",
Expand Down

0 comments on commit e1f4b94

Please sign in to comment.