Skip to content

Container build does not work when integration tests are removed #1344

@josecelano

Description

@josecelano

I have opened an PR to show the problem.

If you remove integration tests (tests folder), the container build fails:

#39 [test_debug 6/8] RUN mkdir -p /app/bin/; cp -l /test/src/target/debug/torrust-tracker /app/bin/torrust-tracker
#39 0.057 cp: cannot stat '/test/src/target/debug/torrust-tracker': No such file or directory
#39 ERROR: process "/bin/sh -c mkdir -p /app/bin/; cp -l /test/src/target/debug/torrust-tracker /app/bin/torrust-tracker" did not complete successfully: exit code: 1
------
 > [test_debug 6/8] RUN mkdir -p /app/bin/; cp -l /test/src/target/debug/torrust-tracker /app/bin/torrust-tracker:
0.057 cp: cannot stat '/test/src/target/debug/torrust-tracker': No such file or directory
------
./Containerfile:74
--------------------
  72 |     RUN cargo nextest run --workspace-remap /test/src/ --target-dir-remap /test/src/target/ --cargo-metadata /test/src/target/nextest/cargo-metadata.json --binaries-metadata /test/src/target/nextest/binaries-metadata.json
  73 |     
  74 | >>> RUN mkdir -p /app/bin/; cp -l /test/src/target/debug/torrust-tracker /app/bin/torrust-tracker
  75 |     RUN mkdir /app/lib/; cp -l $(realpath $(ldd /app/bin/torrust-tracker | grep "libz\.so\.1" | awk '{print $3}')) /app/lib/libz.so.1
  76 |     RUN chown -R root:root /app; chmod -R u=rw,go=r,a+X /app; chmod -R a+x /app/bin
--------------------
ERROR: failed to solve: process "/bin/sh -c mkdir -p /app/bin/; cp -l /test/src/target/debug/torrust-tracker /app/bin/torrust-tracker" did not complete successfully: exit code: 1
Reference
Check build summary support

I have had this problem in this or other repo before but I don't remember the reason. I've just opened the issue to track and document the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions