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

scoringengine / scoringengine / 23385248069

21 Mar 2026 05:50PM UTC coverage: 73.202% (-2.5%) from 75.69%
23385248069

push

github

RustyBower
Fix test to match DB fallback behavior for missing output files

The endpoint now returns check.output from DB (200) instead of 404
when the on-disk file doesn't exist.

3726 of 5090 relevant lines covered (73.2%)

0.73 hits per line

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

86.96
/scoring_engine/engine/execute_command.py
1
import subprocess
1✔
2

3
from celery.exceptions import SoftTimeLimitExceeded
1✔
4

5
from scoring_engine.celery_app import celery_app
1✔
6
from scoring_engine.logger import logger
1✔
7

8

9
@celery_app.task(name="execute_command", acks_late=True, reject_on_worker_lost=True, soft_time_limit=30, time_limit=60)
1✔
10
def execute_command(job):
1✔
11
    output = ""
1✔
12
    # Disable duplicate celery log messages
13
    if logger.propagate:
1✔
14
        logger.propagate = False
1✔
15
    logger.info("Running cmd for " + str(job))
1✔
16
    try:
1✔
17
        cmd_result = subprocess.run(
1✔
18
            job["command"],
19
            shell=True,
20
            stdout=subprocess.PIPE,
21
            stderr=subprocess.STDOUT,
22
            timeout=30,
23
            start_new_session=True,
24
        )
25
        output = cmd_result.stdout.decode("utf-8", errors="replace")
1✔
26
        job["errored_out"] = False
1✔
27
    except subprocess.TimeoutExpired as e:
1✔
28
        job["errored_out"] = True
×
29
        if e.output:
×
30
            output = e.output.decode("utf-8", errors="replace")
×
31
    except SoftTimeLimitExceeded:
1✔
32
        job["errored_out"] = True
1✔
33
    # Cap output stored in Redis to avoid bloating Celery result backend.
34
    # Large outputs (e.g. full HTML pages from HTTP checks) cause massive
35
    # serialization overhead on every AsyncResult.state/.result call.
36
    MAX_OUTPUT = 5000
1✔
37
    job["output"] = output[:MAX_OUTPUT]
1✔
38
    return job
1✔
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

© 2026 Coveralls, Inc