Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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
9 changes: 7 additions & 2 deletions packages/js-sdk/tests/template/methods/aptInstall.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { Template } from '../../../src'
import { buildTemplateTest } from '../../setup'

buildTemplateTest('apt install', async ({ buildTemplate }) => {
// Mark tests as expected to fail (similar to pytest's @pytest.mark.xfail(strict=True))
// Unlike try-catch which silently swallows errors, .fails() properly reports test results:
// - If test fails as expected → test passes (XFAIL behavior)
// - If test unexpectedly passes → test fails, signaling the issue may be fixed

buildTemplateTest.fails('apt install', async ({ buildTemplate }) => {
const template = Template()
.fromImage('ubuntu:24.04')
.skipCache()
Expand All @@ -10,7 +15,7 @@ buildTemplateTest('apt install', async ({ buildTemplate }) => {
await buildTemplate(template)
})

buildTemplateTest(
buildTemplateTest.fails(
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
'apt install with no install recommends',
async ({ buildTemplate }) => {
const template = Template()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


@pytest.mark.skip_debug()
@pytest.mark.xfail(reason="aptInstall tests are optional and allowed to fail")
async def test_apt_install(async_build):
template = (
AsyncTemplate().from_image("ubuntu:24.04").skip_cache().apt_install("rolldice")
Expand All @@ -13,6 +14,7 @@ async def test_apt_install(async_build):


@pytest.mark.skip_debug()
@pytest.mark.xfail(reason="aptInstall tests are optional and allowed to fail")
async def test_apt_install_no_install_recommends(async_build):
template = (
AsyncTemplate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


@pytest.mark.skip_debug()
@pytest.mark.xfail(reason="aptInstall tests are optional and allowed to fail")
def test_apt_install(build):
template = (
Template().from_image("ubuntu:24.04").skip_cache().apt_install("rolldice")
Expand All @@ -13,6 +14,7 @@ def test_apt_install(build):


@pytest.mark.skip_debug()
@pytest.mark.xfail(reason="aptInstall tests are optional and allowed to fail")
def test_apt_install_no_install_recommends(build):
template = (
Template()
Expand Down
Loading