Skip to content

Уваров Никита Лаб. 3 Группа 6513#86

Open
Rifinn-crypto wants to merge 28 commits intoitsecd:mainfrom
Rifinn-crypto:main
Open

Уваров Никита Лаб. 3 Группа 6513#86
Rifinn-crypto wants to merge 28 commits intoitsecd:mainfrom
Rifinn-crypto:main

Conversation

@Rifinn-crypto
Copy link
Copy Markdown

ФИО: Уваров Никита
Номер группы: 6513
Номер лабораторной: 3
Номер варианта: 53
Краткое описание предметной области: Кредитная заявка
Краткое описание добавленных фич: Добавлен SQS брокер, localstack, тесты

Rifinn-crypto and others added 25 commits February 24, 2026 22:29
Запутался в коде и пытаюсь исправить проблему с контейнерами
…ременную...

Это была война не на жизнь, а на смерть с 2 часами сна, кровью из носа и криками боли.
8 часов превосходного времяприпровождения в поисках ошибки, которая оказалась в протоколах)
@github-actions github-actions bot added In progress Код в процессе проверки Lab 3 Лабораторная №3. Интеграционное тестирование labels Apr 3, 2026
@github-actions github-actions bot requested a review from alxmcs April 3, 2026 21:43
Comment on lines +13 to +21
private readonly IAmazonSQS _sqs;
private readonly ILogger<SqsProducer> _logger;
private readonly string _queueUrl = "http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/credit-queue";

public SqsProducer(IAmazonSQS sqs, ILogger<SqsProducer> logger)
{
_sqs = sqs;
_logger = logger;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
private readonly IAmazonSQS _sqs;
private readonly ILogger<SqsProducer> _logger;
private readonly string _queueUrl = "http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/credit-queue";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

хардкодить arn очереди - достаточно паршивое решение, особенно с учетом того, что у тебя есть интегрированный в aspire localstack

}
},
"AllowedHosts": "*",
"SQS_URL": "http://localhost:4566"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот параметр тебе не нужен, если есть интеграция с aspire

Comment on lines +16 to +22
<ItemGroup>
<ProjectReference Include="..\Client.Wasm\Client.Wasm.csproj" />
<ProjectReference Include="..\CreditApp.Domain\CreditApp.Domain.csproj" />
<ProjectReference Include="..\CreditApp.Gateway\CreditApp.Gateway.csproj" />
<ProjectReference Include="..\CreditApp.ServiceDefaults\CreditApp.ServiceDefaults.csproj" />
<ProjectReference Include="..\CreditApp.Messaging\CreditApp.Messaging.csproj" />
</ItemGroup>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Большая часть этих референсов тебе не нужна

Comment thread CreditApp.Api/Program.cs
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

var localstackUrl = "http://sqs.us-east-1.localhost.localstack.cloud:4566";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Этот параметр нужно получать из конфигурации аспаер

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Интеграционные тесты должны работать по такому же принципу, что и юнит-тесты, - нажал на запуск в тест эксплорере, тесты отработали, тесты все зеленые
Image

Либо читай на досуге, как нормально делать интеграционное тестирование с аспаер, либо жди лекции. В текущем виде это совершенно неприемлемо

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Настрой нормально порядок запуска сервисов. Какой смысл запускать клиента, когда бекенд у тебя не стартанул?

@@ -0,0 +1,52 @@
var builder = DistributedApplication.CreateBuilder(args);

var localstackToken = builder.Configuration["LocalStack:AuthToken"];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отличное решение

Comment thread .gitignore
*.msm
*.msp

**/appsettings.Development.json No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Чтобы у меня точно твоя лаба не запустилась

.WithEnvironment("AWS_ACCESS_KEY_ID", "test")
.WithEnvironment("AWS_SECRET_ACCESS_KEY", "test")
.WithEndpoint(port: 4566, targetPort: 4566, name: "api")
.WithLifetime(ContainerLifetime.Persistent);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Еще и контейнер постоянный, кайф

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In progress Код в процессе проверки Lab 3 Лабораторная №3. Интеграционное тестирование

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants