Реализовать загрузку 3D-моделей в Scene manager и выгрузку файлов для запуска симуляции

This commit is contained in:
IDONTSUDO 2024-02-04 13:12:53 +00:00 committed by Igor Brylyov
parent 11ca9cdb5e
commit 3fefd60b72
109 changed files with 2726 additions and 1190 deletions

View file

@ -3,19 +3,23 @@ import { StackService } from "../../src/core/services/stack_service";
import { delay } from "../../src/core/helpers/delay";
import { assert, dirname__ } from "../test";
import { mockSimplePipeline } from "../model/mock_pipelines";
import { readDirRecursive } from "../../src/core/repository/fs";
import { FileSystemRepository } from "../../src/core/repository/file_system_repository";
import { CreateFolderUseCase } from "../../src/core/usecases/create_folder_usecase";
abstract class IStackServiceTest {
abstract test(): Promise<boolean>;
}
class SimpleTestStackServiceTest extends StackService implements IStackServiceTest {
fileSystemRepository: FileSystemRepository;
constructor() {
super(mockSimplePipeline, dirname__ + "/context/");
this.fileSystemRepository = new FileSystemRepository();
}
async test(): Promise<boolean> {
await this.call();
const testResult = readDirRecursive(this.path).equals(["1.txt", "test.txt"], true);
console.log(this.path);
const testResult = this.fileSystemRepository.readDirRecursive(this.path).equals(["1.txt", "test.txt"], true);
await delay(100);
rmSync(this.path + "example/", { recursive: true });
return testResult;
@ -24,12 +28,15 @@ class SimpleTestStackServiceTest extends StackService implements IStackServiceTe
export class StackServiceTest {
dirName: string;
fileSystemRepository: FileSystemRepository;
constructor(dirName: string) {
this.dirName = dirName;
this.fileSystemRepository = new FileSystemRepository();
}
public async test() {
const tests = [new SimpleTestStackServiceTest()];
await new CreateFolderUseCase().call(this.dirName + "/context/");
for await (const el of tests) {
assert((await el.test()) === true, el.constructor.name);
await delay(3000);

View file

@ -39,14 +39,14 @@ const unitTest = async () => {
await init();
await new ExecutorProgramServiceTest(dirname__).test();
await new FilesChangerTest(dirname__).test();
await new StackServiceTest(dirname__ + "/context/").test();
await new StackServiceTest(dirname__).test();
await new TriggerServiceTest().test();
await new CreateDataBaseModelUseCaseTest().test();
await new CreateDataBaseModelUseCaseTest().test();
await new DeleteDataBaseModelUseCaseTest().test();
await new ReadDataBaseModelUseCaseTest().test();
await new UpdateDataBaseModelUseCaseTest().test();
// await new PipelineRealTimeServiceTest().test()
for await (const usecase of tests) {
testCore.assert(await new usecase().test(), usecase.name);
}
@ -54,7 +54,6 @@ const unitTest = async () => {
const presentationCrudControllers = [new TriggerPresentation()];
const e2eTest = async () => {
const app = new App(httpRoutes, [], Environment.E2E_TEST);
app.listen();
await new Promise((resolve, reject) => {
app.on(async (e) => {
if (e === ServerStatus.finished) {