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

idrinth-api-bench / framework / 9822524417

06 Jul 2024 10:28PM UTC coverage: 71.942% (-3.7%) from 75.611%
9822524417

push

github

web-flow
remove unused code & adjust verification code (#47)

* remove unused code
adjust verification code

* Update src/main.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update src/main.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update src/cli/cli.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* eslint fixes

* eslint fixes

* remove impossible test

* fix code to be actually functional

fixes #0

* fix code to be actually functional

fixes #0

* fix code to be actually functional

fixes #0

* update dependency

fixes #0

* update dependency

fixes #0

* update gitignore
publish first release

fixes #0

* fix import

fixes #0

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

311 of 485 branches covered (64.12%)

Branch coverage included in aggregate %.

24 of 81 new or added lines in 5 files covered. (29.63%)

155 existing lines in 5 files now uncovered.

2412 of 3300 relevant lines covered (73.09%)

2538.08 hits per line

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

55.81
/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 pkg from '../../package.json' with {
3✔
10
  type: 'json',
3✔
11
};
3✔
12
import configFactory from '../config/config-factory.js';
3✔
13
import storageFactory from '../storage/storage-factory.js';
3✔
14
import loader from '../load/loader.js';
3✔
15

3✔
16
// eslint-disable-next-line complexity
3✔
17
export default async(args: string[], cwd: string,): Promise<number> => {
3✔
18
  const config = configFactory(cwd, args, process.env,);
6✔
19
  resultStore.set(false,);
6✔
20
  const storage = storageFactory(config,);
6✔
21
  switch (config.task) {
6✔
22
    case 'bench':
6✔
23
      await run({
3✔
24
        mode: 'benchmarking',
3✔
25
        taskId: config.taskId,
3✔
26
        language: config.language,
3✔
27
        cwd: config.cwd,
3✔
28
        resultStorage: storage,
3✔
29
      }, config.threads, config.repetitions,);
3✔
30
      break;
3✔
31
    case 'content':
6✔
32
      await run({
3✔
33
        mode: 'content-testing',
3✔
34
        taskId: config.taskId,
3✔
35
        language: config.language,
3✔
36
        cwd: config.cwd,
3✔
37
      }, ONE, ONE,);
3✔
38
      break;
3✔
39
    case 'load':
6!
NEW
40
      await loader(config,);
×
NEW
41
      break;
×
42
    case 'verify':
6!
NEW
43
      await run({
×
NEW
44
        mode: 'verify',
×
NEW
45
        taskId: config.taskId,
×
NEW
46
        language: config.language,
×
NEW
47
        cwd: config.cwd,
×
NEW
48
      },);
×
NEW
49
      break;
×
50
    case 'stress':
6!
51
      console.error('NOT YET IMPLEMENTED',);
×
52
      return STATUSCODE_FAILURE;
×
53
    default:
6!
54
      console.log(
×
55
        `@idrinth/api-bench 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