@@ -165,23 +165,29 @@ jobs:
165165 echo "Installation successful on attempt $i"
166166 ln -s /opt/rocm/bin/amd-smi /usr/local/bin
167167
168- # Install the wheel
169- echo 'Installing wheel package...'
170- PYTHON_CMD=python3
171- $PYTHON_CMD -m pip install --force-reinstall ${{ env.PROJECT_DIR }}/build/py-interface/python_package/*.whl
172-
173168 # Verify Installation
174169 echo 'Verifying installation:'
175170 if ! amd-smi version; then echo "amd-smi version failed with $?" ; exit 1; fi
176- if ! python3 -m pip list | grep amd; then echo "pip list | grep amd failed with $?" ; exit 1; fi
171+
172+ # Verify .pth file created by postinst (pip list will NOT show
173+ # amdsmi — the .pth approach adds to sys.path without registering
174+ # pip metadata, which is by design).
175+ python3 -c "
176+ import site, pathlib
177+ pth = pathlib.Path(site.getsitepackages()[0]) / 'amdsmi.pth'
178+ assert pth.exists(), f'amdsmi.pth not found at {pth}'
179+ print(f'✓ .pth file found: {pth}')
180+ print(f' contents: {pth.read_text().strip()}')
181+ "
182+
177183 if ! python3 -m pip list | grep pip; then echo "pip list | grep pip failed with $?" ; exit 1; fi
178184 if ! python3 -m pip list | grep setuptools; then echo "pip list | grep setuptools failed with $?" ; exit 1; fi
179185 echo 'Completed installation on ${{ matrix.os }}'
180186
181- # Verify wheel installation
182- echo 'Verifying wheel installation ...'
183- cd /tmp && $PYTHON_CMD -c "import amdsmi; print('✓ Import successful'); amdsmi.amdsmi_init(); print('✓ Library loaded'); amdsmi.amdsmi_shut_down(); print('✓ Wheel working!')"
184- echo 'Python wheel build and install completed on ${{ matrix.os }}'
187+ # Verify Python package import
188+ echo 'Verifying Python package ...'
189+ cd /tmp && python3 -c "import amdsmi; print('✓ Import successful'); amdsmi.amdsmi_init(); print('✓ Library loaded'); amdsmi.amdsmi_shut_down(); print('✓ Package working!')"
190+ echo 'Python package verification completed on ${{ matrix.os }}'
185191 break
186192 else
187193 echo "Installation failed on attempt $i"
@@ -419,6 +425,29 @@ jobs:
419425 echo "Unit tests passed"
420426 fi
421427
428+
429+ echo "Running CLI unit tests..."
430+ if ! ./cli_unit_test.py -v > /tmp/test-results-${{ matrix.os }}/cli_unit_test_output.txt 2>&1; then
431+ echo "CLI Unit tests failed!"
432+ echo "=============== CLI UNIT TEST OUTPUT ==============="
433+ tail -100 /tmp/test-results-${{ matrix.os }}/cli_unit_test_output.txt
434+ echo "===================================================="
435+ exit 1
436+ else
437+ echo "CLI Unit tests passed"
438+ fi
439+
440+ echo "Running perf tests..."
441+ if ! ./perf_tests.py -v > /tmp/test-results-${{ matrix.os }}/perf_test_output.txt 2>&1; then
442+ echo "Perf tests failed!"
443+ echo "=============== PERF TEST OUTPUT ==============="
444+ tail -100 /tmp/test-results-${{ matrix.os }}/perf_test_output.txt
445+ echo "================================================="
446+ exit 1
447+ else
448+ echo "Perf tests passed"
449+ fi
450+
422451 echo "Python tests done"
423452
424453 # Example Tests
@@ -450,6 +479,18 @@ jobs:
450479 echo "Displaying Unit Test Results for ${{ matrix.os }}"
451480 cat /tmp/test-results-${{ matrix.os }}/unit_test_output.txt || echo "No unit test results found for ${{ matrix.os }}"
452481
482+ - name : CLI Unit Test Results
483+ if : always()
484+ run : |
485+ echo "Displaying CLI Unit Test Results for ${{ matrix.os }}"
486+ cat /tmp/test-results-${{ matrix.os }}/cli_unit_test_output.txt || echo "No CLI unit test results found for ${{ matrix.os }}"
487+
488+ - name : Perf Test Results
489+ if : always()
490+ run : |
491+ echo "Displaying Perf Test Results for ${{ matrix.os }}"
492+ cat /tmp/test-results-${{ matrix.os }}/perf_test_output.txt || echo "No perf test results found for ${{ matrix.os }}"
493+
453494 - name : Example DRM Test Results
454495 if : always()
455496 run : |
@@ -661,23 +702,26 @@ jobs:
661702 echo "Installation successful on attempt $i"
662703 ln -s /opt/rocm/bin/amd-smi /usr/local/bin
663704
664-
665- # Install the wheel
666- echo 'Installing wheel package...'
667- PYTHON_CMD=python3
668- $PYTHON_CMD -m pip install --force-reinstall ${{ env.PROJECT_DIR }}/build/py-interface/python_package/*.whl
669-
670705 echo 'Verifying installation:'
671706 if ! amd-smi version; then echo "amd-smi version failed with $?" ; exit 1; fi
672- if ! python3 -m pip list | grep amd; then echo "pip list | grep amd failed with $?" ; exit 1; fi
707+
708+ # Verify .pth file created by postinst
709+ python3 -c "
710+ import site, pathlib
711+ pth = pathlib.Path(site.getsitepackages()[0]) / 'amdsmi.pth'
712+ assert pth.exists(), f'amdsmi.pth not found at {pth}'
713+ print(f'✓ .pth file found: {pth}')
714+ print(f' contents: {pth.read_text().strip()}')
715+ "
716+
673717 if ! python3 -m pip list | grep pip; then echo "pip list | grep pip failed with $?" ; exit 1; fi
674718 if ! python3 -m pip list | grep setuptools; then echo "pip list | grep setuptools failed with $?" ; exit 1; fi
675719 echo 'Completed installation on RHEL10'
676720
677- # Verify wheel installation
678- echo 'Verifying wheel installation ...'
679- cd /tmp && $PYTHON_CMD -c "import amdsmi; print('✓ Import successful'); amdsmi.amdsmi_init(); print('✓ Library loaded'); amdsmi.amdsmi_shut_down(); print('✓ Wheel working!')"
680- echo 'Python wheel build and install completed on ${{ matrix.os }}'
721+ # Verify Python package import
722+ echo 'Verifying Python package ...'
723+ cd /tmp && python3 -c "import amdsmi; print('✓ Import successful'); amdsmi.amdsmi_init(); print('✓ Library loaded'); amdsmi.amdsmi_shut_down(); print('✓ Package working!')"
724+ echo 'Python package verification completed on ${{ matrix.os }}'
681725 break
682726 else
683727 echo "Installation failed on attempt $i"
@@ -724,23 +768,27 @@ jobs:
724768 esac
725769 ln -s /opt/rocm/bin/amd-smi /usr/local/bin
726770
727- # Install the wheel
728- echo 'Installing wheel package...'
729- PYTHON_CMD=python3
730- $PYTHON_CMD -m pip install --force-reinstall ${{ env.PROJECT_DIR }}/build/py-interface/python_package/*.whl
731-
732771 # Verify Installation
733772 echo 'Verifying installation:'
734773 if ! amd-smi version; then echo "amd-smi version failed with $?" ; exit 1; fi
735- if ! python3 -m pip list | grep amd; then echo "pip list | grep amd failed with $?" ; exit 1; fi
774+
775+ # Verify .pth file created by postinst
776+ python3 -c "
777+ import site, pathlib
778+ pth = pathlib.Path(site.getsitepackages()[0]) / 'amdsmi.pth'
779+ assert pth.exists(), f'amdsmi.pth not found at {pth}'
780+ print(f'✓ .pth file found: {pth}')
781+ print(f' contents: {pth.read_text().strip()}')
782+ "
783+
736784 if ! python3 -m pip list | grep pip; then echo "pip list | grep pip failed with $?" ; exit 1; fi
737785 if ! python3 -m pip list | grep setuptools; then echo "pip list | grep setuptools failed with $?" ; exit 1; fi
738786 echo 'Completed installation on ${{ matrix.os }}'
739787
740- # Verify wheel installation
741- echo 'Verifying wheel installation ...'
742- cd /tmp && $PYTHON_CMD -c "import amdsmi; print('✓ Import successful'); amdsmi.amdsmi_init(); print('✓ Library loaded'); amdsmi.amdsmi_shut_down(); print('✓ Wheel working!')"
743- echo 'Python wheel build and install completed on ${{ matrix.os }}'
788+ # Verify Python package import
789+ echo 'Verifying Python package ...'
790+ cd /tmp && python3 -c "import amdsmi; print('✓ Import successful'); amdsmi.amdsmi_init(); print('✓ Library loaded'); amdsmi.amdsmi_shut_down(); print('✓ Package working!')"
791+ echo 'Python package verification completed on ${{ matrix.os }}'
744792
745793 - name : Uninstall
746794 if : always()
@@ -880,14 +928,9 @@ jobs:
880928 ln -s /opt/rocm/bin/amd-smi /usr/local/bin
881929 echo 'Install done for test on RHEL10/AlmaLinux8'
882930
883- # Install the wheel
884- echo 'Installing wheel package for tests...'
885- PYTHON_CMD=python3
886- $PYTHON_CMD -m pip install --force-reinstall ${{ env.PROJECT_DIR }}/build/py-interface/python_package/*.whl
887-
888931 # Verify wheel installation
889932 echo 'Verifying wheel installation (tests)...'
890- cd /tmp && $PYTHON_CMD -c "import amdsmi; print('✓ Import successful'); amdsmi.amdsmi_init(); print('✓ Library loaded'); amdsmi.amdsmi_shut_down(); print('✓ Wheel working!')"
933+ cd /tmp && python3 -c "import amdsmi; print('✓ Import successful'); amdsmi.amdsmi_init(); print('✓ Library loaded'); amdsmi.amdsmi_shut_down(); print('✓ Wheel working!')"
891934 echo 'Python wheel build and install completed for tests on ${{ matrix.os }}'
892935 break
893936 else
@@ -945,14 +988,9 @@ jobs:
945988 ln -s /opt/rocm/bin/amd-smi /usr/local/bin
946989 echo 'Install done for test on ${{ matrix.os }}'
947990
948- # Install the wheel
949- echo 'Installing wheel package for tests...'
950- PYTHON_CMD=python3
951- $PYTHON_CMD -m pip install --force-reinstall ${{ env.PROJECT_DIR }}/build/py-interface/python_package/*.whl
952-
953991 # Verify wheel installation
954992 echo 'Verifying wheel installation (tests)...'
955- cd /tmp && $PYTHON_CMD -c "import amdsmi; print('✓ Import successful'); amdsmi.amdsmi_init(); print('✓ Library loaded'); amdsmi.amdsmi_shut_down(); print('✓ Wheel working!')"
993+ cd /tmp && python3 -c "import amdsmi; print('✓ Import successful'); amdsmi.amdsmi_init(); print('✓ Library loaded'); amdsmi.amdsmi_shut_down(); print('✓ Wheel working!')"
956994 echo 'Python wheel build and install completed for tests on ${{ matrix.os }}'
957995
958996 - name : AMDSMI Command Tests
@@ -1059,6 +1097,29 @@ jobs:
10591097 echo "Unit tests passed"
10601098 fi
10611099
1100+
1101+ echo "Running CLI unit tests..."
1102+ if ! ./cli_unit_test.py -v > /tmp/test-results-${{ matrix.os }}/cli_unit_test_output.txt 2>&1; then
1103+ echo "CLI Unit tests failed!"
1104+ echo "=============== CLI UNIT TEST OUTPUT ==============="
1105+ tail -100 /tmp/test-results-${{ matrix.os }}/cli_unit_test_output.txt
1106+ echo "===================================================="
1107+ exit 1
1108+ else
1109+ echo "CLI Unit tests passed"
1110+ fi
1111+
1112+ echo "Running perf tests..."
1113+ if ! ./perf_tests.py -v > /tmp/test-results-${{ matrix.os }}/perf_test_output.txt 2>&1; then
1114+ echo "Perf tests failed!"
1115+ echo "=============== PERF TEST OUTPUT ==============="
1116+ tail -100 /tmp/test-results-${{ matrix.os }}/perf_test_output.txt
1117+ echo "================================================="
1118+ exit 1
1119+ else
1120+ echo "Perf tests passed"
1121+ fi
1122+
10621123 echo "Python tests done"
10631124
10641125 # Example Tests
@@ -1090,6 +1151,18 @@ jobs:
10901151 echo "Displaying Unit Test Results for ${{ matrix.os }}"
10911152 cat /tmp/test-results-${{ matrix.os }}/unit_test_output.txt || echo "No unit test results found for ${{ matrix.os }}"
10921153
1154+ - name : CLI Unit Test Results
1155+ if : always()
1156+ run : |
1157+ echo "Displaying CLI Unit Test Results for ${{ matrix.os }}"
1158+ cat /tmp/test-results-${{ matrix.os }}/cli_unit_test_output.txt || echo "No CLI unit test results found for ${{ matrix.os }}"
1159+
1160+ - name : Perf Test Results
1161+ if : always()
1162+ run : |
1163+ echo "Displaying Perf Test Results for ${{ matrix.os }}"
1164+ cat /tmp/test-results-${{ matrix.os }}/perf_test_output.txt || echo "No perf test results found for ${{ matrix.os }}"
1165+
10931166 - name : Example DRM Test Results
10941167 if : always()
10951168 run : |
0 commit comments