Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
/* Initial Simple Detox Test Setup. Can potentially add more unit tests. */
 
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
 
describe('OnnxruntimeModuleExample', () => {
  let platform;
 
  beforeAll(async () => {
    platform = device.getPlatform();
    await device.launchApp();
  });
 
  beforeEach(async () => {
    await device.reloadReactNative();
  });
 
  it('MNIST test inference result should be correct', async () => {
    // Tap MNIST test button
    if (platform === 'android') {
      await element(by.label('mnist-test-button')).tap();
    } else {
      await element(by.text('MNIST Test')).tap();
    }
 
    await delay(500);
 
    // Check the inference result
    if (platform === 'ios') {
      await expect(element(by.label('output')).atIndex(1)).toHaveText('Result: 3');
    }
    if (platform === 'android') {
      await expect(element(by.label('output'))).toHaveText('Result: 3');
    }
  });
 
  it('Basic Types test should run successfully', async () => {
    // Tap Basic Types test button
    if (platform === 'android') {
      await element(by.label('basic-types-test-button')).tap();
    } else {
      await element(by.text('Basic Types Test')).tap();
    }
 
    await delay(500);
 
    // Run the tests
    if (platform === 'android') {
      await element(by.label('run-tests-button')).tap();
    } else {
      await element(by.text('Run All Tests')).tap();
    }
    await delay(500);
 
    // Check have no error
    await expect(element(by.label('statusError'))).not.toBeVisible();
  });
 
  it('EPContext data read test should run successfully', async () => {
    // Tap EPContext data read test button
    if (platform === 'android') {
      await element(by.label('ep-context-data-read-test-button')).tap();
    } else {
      await element(by.text('EPContext Data Read Test')).tap();
    }
 
    await delay(500);
 
    // Run the tests
    if (platform === 'android') {
      await element(by.label('run-tests-button')).tap();
    } else {
      await element(by.text('Run All Tests')).tap();
    }
    // The aggregate stays visible above the results list, so lower off-screen rows cannot make this
    // assertion pass accidentally. It reaches this exact text only after every check succeeds.
    await waitFor(element(by.label('ep-context-data-read-summary')))
      .toHaveText('14/14 checks passed')
      .withTimeout(120000);
  });
});