Page MenuHomeFreeBSD

tests/ci: Add CIENV variable
ClosedPublic

Authored by bofh on Jul 6 2025, 3:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 10, 4:32 PM
Unknown Object (File)
Fri, Oct 10, 4:32 PM
Unknown Object (File)
Fri, Oct 10, 4:32 PM
Unknown Object (File)
Fri, Oct 10, 10:52 AM
Unknown Object (File)
Sat, Sep 27, 1:28 AM
Unknown Object (File)
Mon, Sep 15, 7:27 PM
Unknown Object (File)
Mon, Sep 15, 1:16 PM
Unknown Object (File)
Mon, Sep 15, 10:26 AM
Subscribers
None

Details

Summary

The default behavior of of pre-commit script is to suppress all the logs as it is assumed that developers will run this on their terminal for the tests. But there are also other use cases like running these in different CI tools like Cirrus, GH Actions etc where these build logs are important in the web interface itself. This has been raised in https://reviews.freebsd.org/D51177.

To fix this issue introduce a new variable named CIENV which defaults to local if empty or undefined. If the CIENV is local in those cases the logs are suppressed while for anything else it is not. This variable is also important for some other WIP projects of CI I am working on like running the CI tests on remote cloud AWS, Azure, GCP etc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bofh requested review of this revision.Jul 6 2025, 3:40 PM
bofh created this revision.

I think this would be fine, assuming ed's comment elsewhere is good.

This revision is now accepted and ready to land.Jul 6 2025, 4:40 PM

I think this direction is good and solves the current issue. For the longer term, I'd prefer avoiding complex .if expressions for different CI environments. What I'm thinking is have a default value of LOG_TARGET (and we may have more config variables in the future, but CIENV can be removed), and can be overridden by loading different config files. i.e., having a cirrus.conf in $CIENV_CONF and do the necessary customization. I feel this pattern is more flexible and clean.

BTW I would suggest splitting this into two commits, one is adding the LOG_TARGET feature and the other is customizing the cirrus ci config.