Skip to content
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

Option to delete intermediate output when running tests (and use less storage for CI builds in general) #4883

Open
1 task done
nomis opened this issue Mar 24, 2024 · 0 comments

Comments

@nomis
Copy link
Contributor

nomis commented Mar 24, 2024

What kind of issue is this?

  • Feature Request.
    Start by telling us what problem you’re trying to solve. Often a solution
    already exists! Don’t send pull requests to implement new features without first getting our
    support. Sometimes we leave features out on purpose to keep the project small.

Configuration

Operating system:

PlatformIO Version (platformio --version): 6.1.14

Description of problem

Unit test builds produce statically linked output files of my application for every test:

13M	.pio/build/native_test/test/output/test_bytearray_rgb/main.o
13M	.pio/build/native_test/test/output/test_floatarray_exp_h/main.o
13M	.pio/build/native_test/test/output/test_floatarray_h/main.o
...
13M	.pio/build/native_test/test/output/test_tuple_tuple_hsv_float/main.o
13M	.pio/build/native_test/test/output/test_tuple_tuple_hsv_int/main.o
13M	.pio/build/native_test/test/output/test_tuple_tuple_rgb/main.o
676K	.pio/build/native_test/test/test_colours/main.o
1.6M	.pio/build/native_test/test/test_config/main.o
812K	.pio/build/native_test/test/test_ledprofile/main.o
1.4M	.pio/build/native_test/test/test_micropython/main.o
631M	total

This makes CI builds difficult because they use a lot of storage unnecessarily.

I'd like an option to delete intermediate output when running tests (and use less storage for CI builds in general).

Steps to Reproduce

  1. Download https://github.com/nomis/aurora-coriolis/tree/1.0.0 and run git submodule update --init --depth 1 (not --recursive)
  2. Comment out test_testing_command from app/pio/config.ini
  3. Run platformio test -e native_test

Actual Results

The total build output of .pio/build/native_test/ is 750MB+ because it has the main.o for every test program build.

Expected Results

The build output of .pio/build/native_test/ is ~120MB because it only has the most recent test program and not intermediate files.

Additional info

I'm running CI builds in RAM because it makes builds faster and avoids disk I/O for build output that will be discarded. There's not enough RAM dedicated to my CI host for this quantity of build output, especially when it's unnecessary.

It is difficult to do this with a wrapper script because obtaining the environment name for a custom test_testing_command with non-environment sections and sections that extend other sections is not trivial: #4480 #4531 #4882. Without the environment name the script wouldn't know where the current build output is to delete it, or where the test program is to run it.

nomis added a commit to nomis/mcu-app that referenced this issue Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants