• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mongodb-js / mongodb-mcp-server / 16135806470

08 Jul 2025 06:34AM UTC coverage: 75.613% (+1.4%) from 74.187%
16135806470

Pull #340

github

web-flow
Merge 76e006853 into 5b7ba55e0
Pull Request #340: chore: avoid logging files on disk and move them to console for containers

237 of 397 branches covered (59.7%)

Branch coverage included in aggregate %.

15 of 22 new or added lines in 3 files covered. (68.18%)

3 existing lines in 2 files now uncovered.

842 of 1030 relevant lines covered (81.75%)

58.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.22
/src/common/container.ts
1
import fs from "fs/promises";
2

3
let containerEnv: boolean | undefined;
4

5
export async function detectContainerEnv(): Promise<boolean> {
6
    if (containerEnv !== undefined) {
46✔
7
        return containerEnv;
16✔
8
    }
9

10
    const detect = async function (): Promise<boolean> {
30✔
11
        if (process.platform !== "linux") {
30!
NEW
12
            return false; // we only support linux containers for now
×
13
        }
14

15
        if (process.env.container) {
30!
NEW
16
            return true;
×
17
        }
18

19
        const exists = await Promise.all(
30✔
20
            ["/.dockerenv", "/run/.containerenv", "/var/run/.containerenv"].map(async (file) => {
21
                try {
90✔
22
                    await fs.access(file);
90✔
NEW
23
                    return true;
×
24
                } catch {
25
                    return false;
90✔
26
                }
27
            })
28
        );
29

30
        return exists.includes(true);
30✔
31
    };
32

33
    containerEnv = await detect();
30✔
34
    return containerEnv;
30✔
35
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc