Skip to content

Conversation

@chase-qi
Copy link
Collaborator

No description provided.

@chase-qi
Copy link
Collaborator Author

It needs the changes below in lava to fully work.

for key in list(drivers.keys()):
if key in drivers_to_remove:
drivers.pop(key)
conf["drivers"] = {**external_drivers, **conf["drivers"]}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conf["drivers"] = {**external_drivers, **drivers}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.


lg_env_file = Path(sys.argv[1])
if not lg_env_file.exists():
print(f"ERROR: {lg_env_file} not exists")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not exist*

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

steps:
- cd ./automated/linux/labgrid
# Install
- apt-get update -y && apt install -y telnet "${DEB_PKGS}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just use apt, not apt-get (and not both).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, also do we always have to install? is there a usecase where we already have everything installed into the rootfs? then maybe we should use the SKIP_INSTALL variable too?
In a way you indicate we always want os python3:3.13...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I CANNOT beleive I used both 😅 .

Switched to apt and added SKIP_INSTALL. It does makse sense to skip the runtime installation and let user use custom docker image.

# Update env configure
- if [ "${UPDATE_ENV}" = "true" ] || [ "${UPDATE_ENV}" = "True" ]; then ./update_env.py "${LG_ENV}"; fi
# Run and create junit style result file
- pytest -vv --color=no --lg-env "${LG_ENV}" "${LG_TEST}" --junit-xml result.xml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to install pytest?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need to specify it here since labgrid requires pytest>=7.0.0.

@chase-qi chase-qi requested a review from roxell November 11, 2025 10:55

# ms -> s
if txdelay := os.getenv("LAVA_CONNECTION_DELAY"):
os.environ["LAVA_CONNECTION_DELAY"] = str(int(txdelay) / 1000)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add a try/except or validate the input? it will raise a ValueError if non-numeric.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added.

steps:
- cd ./automated/linux/labgrid
# Install
- apt-get update -y && apt install -y telnet "${DEB_PKGS}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, also do we always have to install? is there a usecase where we already have everything installed into the rootfs? then maybe we should use the SKIP_INSTALL variable too?
In a way you indicate we always want os python3:3.13...

- cd ./automated/linux/labgrid
# Install
- apt-get update -y && apt install -y telnet "${DEB_PKGS}"
- pip3 install labgrid PyYAML junitparser==4.0.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if pip3 exists? It's not guaranteed that the test runs in a container with pip installed. os in metadata is not enforced.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a check. python3-pip will be installed if pip3 not found. We need to failover to pip3 install --break-system-packages on recent debian.

Per the desc and README, it suppose to run in a container. I also added SKIP_INSTALL so user can build the depends into their docker image and skip the install at runtime.

from junitparser import JUnitXml


def parse_junit(file: str) -> list[str]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this should go to automated/lib/py_utill_lib.py ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a script in the run.steps instead of a function. Maybe, move the script to automated/lib? just like the one for parsing rt tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea was that there may be more cases when parsing junit is required. Maybe moving the whole script is a good idea. Let's try this and refactor in the future if required.

@chase-qi
Copy link
Collaborator Author

@bhcopeland @roxell @mwasilew Thank you for the comments. Hopefully, I have addressed all of them. Let me know if there are more :)

if [ "${SKIP_INSTALL}" = "false" ] || [ "${SKIP_INSTALL}" = "False" ]; then
which pip3 || DEB_PKGS="${DEB_PKGS} python3-pip"
apt update -y && apt install -y telnet ${DEB_PKGS}
PYPI_PKGS="labgrid PyYAML junitparser==4.0.2"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this up to the 'params' section.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have to pin junitparser?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switched to >=4.0.2.

@@ -0,0 +1,49 @@
#!/usr/bin/env python3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add copyright

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added.

Signed-off-by: Chase Qi <chase.qi@linaro.org>
@bhcopeland bhcopeland merged commit 7741e37 into Linaro:master Nov 17, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants