Skip to content

test: Support pre-release version #5229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 9, 2025
Merged
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
10 changes: 5 additions & 5 deletions tests/framework/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ def jailer(self):

@property
def version(self):
"""Return Firecracker's version: `X.Y.Z`."""
# Get the filename, split on '-' and trim the leading 'v'.
# sample: firecracker-v1.2.0
return self.path.name.split("-")[1][1:]
"""Return Firecracker's version: `X.Y.Z-prerelase`."""
# Get the filename, split on the first '-' and trim the leading 'v'.
# sample: firecracker-v1.2.0-alpha
return self.path.name.split("-", 1)[1][1:]

@property
def version_tuple(self):
Expand Down Expand Up @@ -132,7 +132,7 @@ def working_version_as_artifact():
Return working copy of Firecracker as a release artifact
"""
cargo_version = get_firecracker_version_from_toml()
return FirecrackerArtifact(current_release(cargo_version.base_version)[0])
return FirecrackerArtifact(current_release(str(cargo_version))[0])


def firecracker_artifacts():
Expand Down
4 changes: 2 additions & 2 deletions tests/framework/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from contextlib import contextmanager
from typing import Dict

import packaging.version
import psutil
import semver
from tenacity import (
Retrying,
retry,
Expand Down Expand Up @@ -381,7 +381,7 @@ def get_firecracker_version_from_toml():
"""
cmd = "cd ../src/firecracker && cargo pkgid | cut -d# -f2 | cut -d: -f2"
_, stdout, _ = check_output(cmd)
return packaging.version.parse(stdout)
return semver.Version.parse(stdout)


def get_kernel_version(level=2):
Expand Down
8 changes: 3 additions & 5 deletions tests/integration_tests/functional/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import resource
from pathlib import Path

import packaging.version
import pytest
import semver

import host_tools.drive as drive_tools
import host_tools.network as net_tools
Expand Down Expand Up @@ -923,14 +923,12 @@ def test_api_version(uvm_plain):
assert preboot_response.json() == postboot_response.json()

cargo_version = get_firecracker_version_from_toml()
api_version = packaging.version.parse(
preboot_response.json()["firecracker_version"]
)
api_version = semver.Version.parse(preboot_response.json()["firecracker_version"])

# Cargo version should match FC API version
assert cargo_version == api_version

binary_version = packaging.version.parse(test_microvm.firecracker_version)
binary_version = semver.Version.parse(test_microvm.firecracker_version)
assert api_version == binary_version


Expand Down
2 changes: 1 addition & 1 deletion tools/devctr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ RUN cd /usr/include/$ARCH-linux-musl \
&& ln -s ../asm-generic asm-generic

# Install static version of libseccomp
# We need to compile from source because
# We need to compile from source because
# libseccomp provided by the distribution is not
# compiled with musl-gcc and we need this
# for our musl builds.
Expand Down
16 changes: 14 additions & 2 deletions tools/devctr/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tools/devctr/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ requests-unixsocket2 = "^0.4.0"
scipy = "^1.11.2"
setproctitle = "^1.3.2"
tenacity = "^8.2.2"
semver = "^3.0.4"


[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion tools/devtool
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
DEVCTR_IMAGE_NO_TAG="public.ecr.aws/firecracker/fcuvm"

# Development container tag
DEVCTR_IMAGE_TAG=${DEVCTR_IMAGE_TAG:-v81}
DEVCTR_IMAGE_TAG=${DEVCTR_IMAGE_TAG:-v82}

# Development container image (name:tag)
# This should be updated whenever we upgrade the development container.
Expand Down