Skip to content

Commit

Permalink
test: added compiler + build output path test
Browse files Browse the repository at this point in the history
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
  • Loading branch information
Akos Kitta authored and kittaakos committed Jan 24, 2023
1 parent 6140ae5 commit 658f117
Show file tree
Hide file tree
Showing 8 changed files with 341 additions and 18 deletions.
1 change: 1 addition & 0 deletions arduino-ide-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"build": "tsc && ncp ./src/node/cli-protocol/ ./lib/node/cli-protocol/ && yarn lint",
"watch": "tsc -w",
"test": "mocha \"./lib/test/**/*.test.js\"",
"test:slow": "mocha \"./lib/test/**/*.slow-test.js\"",
"test:watch": "mocha --watch --watch-files lib \"./lib/test/**/*.test.js\""
},
"dependencies": {
Expand Down
10 changes: 10 additions & 0 deletions arduino-ide-extension/src/common/protocol/boards-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@ export const BoardsService = Symbol('BoardsService');
export interface BoardsService
extends Installable<BoardsPackage>,
Searchable<BoardsPackage, BoardSearch> {
install(options: {
item: BoardsPackage;
progressId?: string;
version?: Installable.Version;
noOverwrite?: boolean;
/**
* Only for testing to avoid confirmation dialogs from Windows User Access Control when installing a platform.
*/
skipPostInstall?: boolean;
}): Promise<void>;
getState(): Promise<AvailablePorts>;
getBoardDetails(options: { fqbn: string }): Promise<BoardDetails | undefined>;
getBoardPackage(options: { id: string }): Promise<BoardsPackage | undefined>;
Expand Down
4 changes: 4 additions & 0 deletions arduino-ide-extension/src/node/boards-service-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ export class BoardsServiceImpl
progressId?: string;
version?: Installable.Version;
noOverwrite?: boolean;
skipPostInstall?: boolean;
}): Promise<void> {
const item = options.item;
const version = !!options.version
Expand All @@ -450,6 +451,9 @@ export class BoardsServiceImpl
req.setPlatformPackage(platform);
req.setVersion(version);
req.setNoOverwrite(Boolean(options.noOverwrite));
if (options.skipPostInstall) {
req.setSkipPostInstall(true);
}

console.info('>>> Starting boards package installation...', item);

Expand Down
9 changes: 0 additions & 9 deletions arduino-ide-extension/src/node/core-client-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export class CoreClientProvider {
new Emitter<CoreClientProvider.Client>();
private readonly onClientReady = this.onClientReadyEmitter.event;

private ready = new Deferred<void>();
private pending: Deferred<CoreClientProvider.Client> | undefined;
private _client: CoreClientProvider.Client | undefined;

Expand Down Expand Up @@ -135,14 +134,6 @@ export class CoreClientProvider {
const client = await this.createClient(address);
this.toDisposeOnCloseClient.pushAll([
Disposable.create(() => client.client.close()),
Disposable.create(() => {
this.ready.reject(
new Error(
`Disposed. Creating a new gRPC core client on address ${address}.`
)
);
this.ready = new Deferred();
}),
]);
await this.initInstanceWithFallback(client);
return this.useClient(client);
Expand Down
6 changes: 3 additions & 3 deletions arduino-ide-extension/src/node/sketches-service-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
SketchContainer,
SketchesError,
} from '../common/protocol/sketches-service';
import { NotificationServiceServerImpl } from './notification-service-server';
import { NotificationServiceServer } from '../common/protocol';
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
import { CoreClientAware } from './core-client-provider';
import {
Expand Down Expand Up @@ -77,8 +77,8 @@ export class SketchesServiceImpl
@inject(ConfigServiceImpl)
private readonly configService: ConfigServiceImpl;

@inject(NotificationServiceServerImpl)
private readonly notificationService: NotificationServiceServerImpl;
@inject(NotificationServiceServer)
private readonly notificationService: NotificationServiceServer;

@inject(EnvVariablesServer)
private readonly envVariableServer: EnvVariablesServer;
Expand Down
Loading

0 comments on commit 658f117

Please sign in to comment.