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

idrinth-api-bench / framework / 10078996610

24 Jul 2024 02:53PM UTC coverage: 72.065%. First build
10078996610

push

github

Idrinth
fix: no import from json

fixes idrinth-api-bench/issues#1127

315 of 490 branches covered (64.29%)

Branch coverage included in aggregate %.

1 of 3 new or added lines in 1 file covered. (33.33%)

2435 of 3326 relevant lines covered (73.21%)

2518.32 hits per line

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

54.12
/src/cli/cli.ts
1
/* eslint no-console: 0 */
3!
2
import {
3✔
3
  STATUSCODE_SUCCESS,
3✔
4
  STATUSCODE_FAILURE,
3✔
5
  ONE,
3✔
6
} from '../constants.js';
3✔
7
import resultStore from '../store/result-store.js';
3✔
8
import run from '../main.js';
3✔
9
import configFactory from '../config/config-factory.js';
3✔
10
import storageFactory from '../storage/storage-factory.js';
3✔
11
import loader from '../load/loader.js';
3✔
12
import {readFileSync} from "fs";
3✔
13

3✔
14
// eslint-disable-next-line complexity
3✔
15
export default async(args: string[], cwd: string,): Promise<number> => {
3✔
16
  const config = configFactory(cwd, args, process.env,);
6✔
17
  resultStore.set(false,);
6✔
18
  const storage = storageFactory(config,);
6✔
19
  switch (config.task) {
6✔
20
    case 'bench':
6✔
21
      await run({
3✔
22
        mode: 'benchmarking',
3✔
23
        taskId: config.taskId,
3✔
24
        language: config.language,
3✔
25
        cwd: config.cwd,
3✔
26
        resultStorage: storage,
3✔
27
      }, config.threads, config.repetitions,);
3✔
28
      break;
3✔
29
    case 'content':
6✔
30
      await run({
3✔
31
        mode: 'content-testing',
3✔
32
        taskId: config.taskId,
3✔
33
        language: config.language,
3✔
34
        cwd: config.cwd,
3✔
35
      }, ONE, ONE,);
3✔
36
      break;
3✔
37
    case 'load':
6!
38
      await loader(config,);
×
39
      break;
×
40
    case 'verify':
6!
41
      await run({
×
42
        mode: 'verify',
×
43
        taskId: config.taskId,
×
44
        language: config.language,
×
45
        cwd: config.cwd,
×
46
      },);
×
47
      break;
×
48
    case 'stress':
6!
49
      console.error('NOT YET IMPLEMENTED',);
×
50
      return STATUSCODE_FAILURE;
×
51
    default:
6!
NEW
52
      const pkg = JSON.parse(readFileSync('../../package.json', 'utf8'));
×
53
      console.log(
×
NEW
54
        `@idrinth-api-bench/framework v${ pkg.version }`,
×
55
      );
×
56
      console.log(
×
57
        'iab bench --language=en --taskId=test --threads=11 --repetitions=100',
×
58
      );
×
59
      console.log(
×
60
        'iab content --language=en --taskId=test',
×
61
      );
×
62
      console.log(
×
63
        'iab verify --language=en',
×
64
      );
×
65
      console.log(
×
66
        'iab load --language=en --taskId=test --threads=11 --repetitions=100' +
×
67
        ' --maximum=100 --increment=1',
×
68
      );
×
69
      console.log(
×
70
        'iab stress --language=en --taskId=test --threads=11' +
×
71
        ' --repetitions=100 --duration=60',
×
72
      );
×
73
      return STATUSCODE_SUCCESS;
×
74
  }
6✔
75
  return resultStore.get(false,) ? STATUSCODE_SUCCESS : STATUSCODE_FAILURE;
6!
76
};
6✔
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