Skip to content

Test command should not modify output location #752

Closed
@cmatsuoka

Description

@cmatsuoka

Bug Description

When running the test command, pack is executed redirecting its output to the spread subdirectory. Craft-test expects the output artifact to be in the project root instead.

To Reproduce

Run snapcraft init and snapcraft init --profile=test followed by snapcraft test.

part yaml

Relevant log output

$ snapcraft test --verbose
Starting snapcraft, version 8.9.0.post7
Logging execution to '/home/claudio/.local/state/snapcraft/log/snapcraft-20250502-152135.646912.log'
The test command is experimental and subject to change without warning.
Launching managed ubuntu 24.04 instance...
Creating new instance from remote
Creating new base instance from remote 
Creating new instance from base instance
Starting instance 
Starting snapcraft, version 8.9.0.post7
Logging execution to '/tmp/snapcraft.log'
Initialising lifecycle
Installing build-packages
Installing build-snaps
Pulling my-part
Building my-part 
Staging my-part
Priming my-part
Packing...
Reading snap metadata...
Running linters...
Running linter: classic
Running linter: library
Creating snap package...
Packed abcxyz_0.1_amd64.snap
Testing project
Running spread tests
:: 2025-05-02 15:25:51 Found /tmp/x/.craft-spread-1e0g3quv/spread.yaml.
:: 2025-05-02 15:25:51 Project content is packed for delivery (3.56KB).
:: 2025-05-02 15:25:51 If killed, discard servers with: spread -reuse-pid=1319994 -discard
:: 2025-05-02 15:25:51 Allocating craft:ubuntu-24.04...
:: 2025-05-02 15:27:32 Waiting for craft:ubuntu-24.04 to make SSH available at 10.172.144.196...
:: 2025-05-02 15:27:37 Allocated craft:ubuntu-24.04.
:: 2025-05-02 15:27:37 Connecting to craft:ubuntu-24.04...
:: 2025-05-02 15:27:38 Connected to craft:ubuntu-24.04 at 10.172.144.196.
:: 2025-05-02 15:27:38 Sending project content to craft:ubuntu-24.04...
:: 2025-05-02 15:27:40 Preparing craft:ubuntu-24.04 (craft:ubuntu-24.04)...
:: 2025-05-02 15:28:10 Preparing craft:ubuntu-24.04:spread/general/ (craft:ubuntu-24.04)...
:: 2025-05-02 15:28:10 Error preparing craft:ubuntu-24.04:spread/general/ (craft:ubuntu-24.04) :
:: -----
:: + snap install /root/proj/abcxyz_0.1_amd64.snap --dangerous --jailmode
:: error: cannot open "/root/proj/abcxyz_0.1_amd64.snap": open /root/proj/abcxyz_0.1_amd64.snap: no such file or directory
:: -----
:: .
:: 2025-05-02 15:28:10 Restoring craft:ubuntu-24.04:spread/general/ (craft:ubuntu-24.04)...
:: 2025-05-02 15:28:10 Restoring craft:ubuntu-24.04 (craft:ubuntu-24.04)...
:: 2025-05-02 15:28:12 Discarding craft:ubuntu-24.04...
:: 2025-05-02 15:28:13 Successful tasks: 0
:: 2025-05-02 15:28:13 Aborted tasks: 1
:: 2025-05-02 15:28:13 Failed suite prepare: 1
::     - craft:ubuntu-24.04:spread/general/
:: error: unsuccessful run
spread run failed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions