mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-26 08:00:01 +00:00
fix: set unittests dir to /tmp can explode grcov's disk (#253)
* fix: set unittests dir to /tmp can explode grcov's disk Co-authored-by: luofucong <luofucong@greptime.com>
This commit is contained in:
5
.github/workflows/coverage.yml
vendored
5
.github/workflows/coverage.yml
vendored
@@ -24,6 +24,10 @@ jobs:
|
||||
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||
override: true
|
||||
profile: minimal
|
||||
- name: Cleanup disk
|
||||
uses: curoky/cleanup-disk-action@v2.0
|
||||
with:
|
||||
retain: 'rust'
|
||||
- name: Execute tests
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
@@ -36,6 +40,7 @@ jobs:
|
||||
GT_S3_BUCKET: ${{ secrets.S3_BUCKET }}
|
||||
GT_S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
|
||||
GT_S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
|
||||
UNITTEST_LOG_DIR: "__unittest_logs"
|
||||
- name: Gather coverage data
|
||||
id: coverage
|
||||
uses: actions-rs/grcov@v0.1
|
||||
|
||||
1
.github/workflows/develop.yml
vendored
1
.github/workflows/develop.yml
vendored
@@ -46,6 +46,7 @@ jobs:
|
||||
GT_S3_BUCKET: ${{ secrets.S3_BUCKET }}
|
||||
GT_S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
|
||||
GT_S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
|
||||
UNITTEST_LOG_DIR: "__unittest_logs"
|
||||
|
||||
fmt:
|
||||
name: Rustfmt
|
||||
|
||||
@@ -29,12 +29,17 @@ pub fn init_default_ut_logging() {
|
||||
|
||||
START.call_once(|| {
|
||||
let mut g = GLOBAL_UT_LOG_GUARD.as_ref().lock().unwrap();
|
||||
*g = Some(init_global_logging(
|
||||
"unittest",
|
||||
"/tmp/__unittest_logs",
|
||||
"DEBUG",
|
||||
false,
|
||||
));
|
||||
|
||||
// When running in Github's actions, env "UNITTEST_LOG_DIR" is set to a directory other
|
||||
// than "/tmp".
|
||||
// This is to fix the problem that the "/tmp" disk space of action runner's is small,
|
||||
// if we write testing logs in it, actions would fail due to disk out of space error.
|
||||
let dir =
|
||||
env::var("UNITTEST_LOG_DIR").unwrap_or_else(|_| "/tmp/__unittest_logs".to_string());
|
||||
|
||||
*g = Some(init_global_logging("unittest", &dir, "DEBUG", false));
|
||||
|
||||
info!("logs dir = {}", dir);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user