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

idrinth-api-bench / framework / 10080169310

24 Jul 2024 04:08PM UTC coverage: 72.072% (+0.1%) from 71.95%
10080169310

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 %.

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

2436 of 3327 relevant lines covered (73.22%)

2517.61 hits per line

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

54.65
/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
  FRAMEWORK_ROOT,
3✔
7
} from '../constants.js';
3✔
8
import resultStore from '../store/result-store.js';
3✔
9
import run from '../main.js';
3✔
10
import configFactory from '../config/config-factory.js';
3✔
11
import storageFactory from '../storage/storage-factory.js';
3✔
12
import loader from '../load/loader.js';
3✔
13
import {readFileSync} from "fs";
3✔
14

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