22
33import pytest
44
5- from stackbrew_generator .models import RedisVersion , Distribution , DistroType , Release , StackbrewEntry
5+ from stackbrew_generator .models import (
6+ ALPINE_ARCHITECTURES ,
7+ DEBIAN_BOOKWORM_ARCHITECTURES ,
8+ DEBIAN_TRIXIE_ARCHITECTURES ,
9+ DebianRelease ,
10+ Distribution ,
11+ DistroType ,
12+ RedisVersion ,
13+ Release ,
14+ StackbrewEntry ,
15+ )
616
717
818class TestRedisVersion :
@@ -248,10 +258,27 @@ def test_release_string_representation(self):
248258class TestStackbrewEntry :
249259 """Tests for StackbrewEntry model."""
250260
251- def test_debian_architectures (self ):
252- """Test that Debian distributions get the correct architectures."""
261+ def test_debian_trixie_architectures (self ):
262+ """Test that Debian trixie gets riscv64 architecture (no mips64le)."""
263+ version = RedisVersion .parse ("8.4.0" )
264+ distribution = Distribution (type = DistroType .DEBIAN , name = DebianRelease .TRIXIE )
265+
266+ entry = StackbrewEntry (
267+ tags = ["8.4.0" , "latest" ],
268+ commit = "abc123def456" ,
269+ version = version ,
270+ distribution = distribution ,
271+ git_fetch_ref = "refs/tags/v8.4.0" ,
272+ )
273+
274+ assert entry .architectures == list (DEBIAN_TRIXIE_ARCHITECTURES )
275+ assert "riscv64" in entry .architectures
276+ assert "mips64le" not in entry .architectures
277+
278+ def test_debian_bookworm_architectures (self ):
279+ """Test that Debian bookworm gets mips64le architecture (no riscv64)."""
253280 version = RedisVersion .parse ("8.2.1" )
254- distribution = Distribution (type = DistroType .DEBIAN , name = "bookworm" )
281+ distribution = Distribution (type = DistroType .DEBIAN , name = DebianRelease . BOOKWORM )
255282
256283 entry = StackbrewEntry (
257284 tags = ["8.2.1" , "latest" ],
@@ -261,8 +288,9 @@ def test_debian_architectures(self):
261288 git_fetch_ref = "refs/tags/v8.2.1"
262289 )
263290
264- expected_architectures = ["amd64" , "arm32v5" , "arm32v7" , "arm64v8" , "i386" , "riscv64" , "ppc64le" , "s390x" ]
265- assert entry .architectures == expected_architectures
291+ assert entry .architectures == list (DEBIAN_BOOKWORM_ARCHITECTURES )
292+ assert "mips64le" in entry .architectures
293+ assert "riscv64" not in entry .architectures
266294
267295 def test_alpine_architectures (self ):
268296 """Test that Alpine distributions get the correct architectures."""
@@ -277,8 +305,7 @@ def test_alpine_architectures(self):
277305 git_fetch_ref = "refs/tags/v8.2.1"
278306 )
279307
280- expected_architectures = ["amd64" , "arm32v6" , "arm32v7" , "arm64v8" , "i386" , "ppc64le" , "riscv64" , "s390x" ]
281- assert entry .architectures == expected_architectures
308+ assert entry .architectures == list (ALPINE_ARCHITECTURES )
282309
283310 def test_stackbrew_entry_string_format (self ):
284311 """Test that StackbrewEntry formats correctly with architectures."""
@@ -296,7 +323,7 @@ def test_stackbrew_entry_string_format(self):
296323 output = str (entry )
297324
298325 # Check that it contains the expected Alpine architectures
299- assert "amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x" in output
326+ assert ", " . join ( ALPINE_ARCHITECTURES ) in output
300327 assert "Tags: 8.2.1-alpine, alpine" in output
301328 assert "GitCommit: abc123def456" in output
302329 assert "GitFetch: refs/tags/v8.2.1" in output
0 commit comments