mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-10 10:58:33 +00:00
[ci]: Made various changes for the electron app:
- Support for multiple electron targe per platform. - Removed packager CLI. Changed the logic we calculate the app name. - Fixed various OS-specific tests: stubbed `os`. - Restructured the final ZIP formats for Windows and Linux. - Added packager tests. - Switched from `@grpc/grpc-js` to native `grpc`. - Updated the version from 0.0.5 to 0.0.6. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as path from 'path';
|
||||
import * as yaml from 'js-yaml';
|
||||
import * as grpc from '@grpc/grpc-js';
|
||||
import * as grpc from 'grpc';
|
||||
import * as deepmerge from 'deepmerge';
|
||||
import { injectable, inject, named } from 'inversify';
|
||||
import URI from '@theia/core/lib/common/uri';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as grpc from '@grpc/grpc-js';
|
||||
import * as grpc from 'grpc';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { ToolOutputServiceServer } from '../common/protocol';
|
||||
import { GrpcClientProvider } from './grpc-client-provider';
|
||||
@@ -35,7 +35,7 @@ export class CoreClientProvider extends GrpcClientProvider<CoreClientProvider.Cl
|
||||
}
|
||||
|
||||
protected async createClient(port: string | number): Promise<CoreClientProvider.Client> {
|
||||
const client = new ArduinoCoreClient(`localhost:${port}`, grpc.credentials.createInsecure());
|
||||
const client = new ArduinoCoreClient(`localhost:${port}`, grpc.credentials.createInsecure(), this.channelOptions);
|
||||
const initReq = new InitReq();
|
||||
initReq.setLibraryManagerOnly(false);
|
||||
const initResp = await new Promise<InitResp>(resolve => {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import * as grpc from 'grpc';
|
||||
import { inject, injectable, postConstruct } from 'inversify';
|
||||
import { ILogger } from '@theia/core/lib/common/logger';
|
||||
import { MaybePromise } from '@theia/core/lib/common/types';
|
||||
@@ -68,4 +69,11 @@ export abstract class GrpcClientProvider<C> {
|
||||
|
||||
protected abstract close(client: C): void;
|
||||
|
||||
protected get channelOptions(): grpc.CallOptions {
|
||||
return {
|
||||
'grpc.max_send_message_length': 512 * 1024 * 1024,
|
||||
'grpc.max_receive_message_length': 512 * 1024 * 1024
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as grpc from '@grpc/grpc-js';
|
||||
import * as grpc from 'grpc';
|
||||
import { injectable } from 'inversify';
|
||||
import { MonitorClient } from '../cli-protocol/monitor/monitor_grpc_pb';
|
||||
import { GrpcClientProvider } from '../grpc-client-provider';
|
||||
@@ -7,7 +7,7 @@ import { GrpcClientProvider } from '../grpc-client-provider';
|
||||
export class MonitorClientProvider extends GrpcClientProvider<MonitorClient> {
|
||||
|
||||
createClient(port: string | number): MonitorClient {
|
||||
return new MonitorClient(`localhost:${port}`, grpc.credentials.createInsecure());
|
||||
return new MonitorClient(`localhost:${port}`, grpc.credentials.createInsecure(), this.channelOptions);
|
||||
}
|
||||
|
||||
close(client: MonitorClient): void {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ClientDuplexStream } from '@grpc/grpc-js';
|
||||
import { ClientDuplexStream } from 'grpc';
|
||||
import { TextDecoder, TextEncoder } from 'util';
|
||||
import { injectable, inject, named } from 'inversify';
|
||||
import { Struct } from 'google-protobuf/google/protobuf/struct_pb';
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { expect } from 'chai';
|
||||
import * as sinon from 'sinon';
|
||||
import * as os from '@theia/core/lib/common/os';
|
||||
import { Container, injectable } from 'inversify';
|
||||
import { Event } from '@theia/core/lib/common/event';
|
||||
import { ILogger } from '@theia/core/lib/common/logger';
|
||||
@@ -26,18 +28,23 @@ describe('boards-service-client-impl', () => {
|
||||
const guessed = AvailableBoard.State.guessed;
|
||||
const incomplete = AvailableBoard.State.incomplete;
|
||||
|
||||
let stub: sinon.SinonStub;
|
||||
|
||||
let server: MockBoardsService;
|
||||
let client: BoardsServiceClientImpl;
|
||||
// let storage: MockStorageService;
|
||||
|
||||
beforeEach(() => {
|
||||
stub = sinon.stub(os, 'isOSX').value(true);
|
||||
const container = init();
|
||||
server = container.get(MockBoardsService);
|
||||
client = container.get(BoardsServiceClientImpl);
|
||||
// storage = container.get(MockStorageService);
|
||||
server.setClient(client);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
stub.reset();
|
||||
});
|
||||
|
||||
it('should have no available boards by default', () => {
|
||||
expect(client.availableBoards).to.have.length(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user