Skip to content

Степанов Дмитрий Лаб. 3 Группа 6511#156

Closed
negniy wants to merge 18 commits into
itsecd:mainfrom
negniy:main
Closed

Степанов Дмитрий Лаб. 3 Группа 6511#156
negniy wants to merge 18 commits into
itsecd:mainfrom
negniy:main

Conversation

@negniy
Copy link
Copy Markdown

@negniy negniy commented May 16, 2026

ФИО: Степанов Дмитрий
Номер группы: 6511
Номер лабораторной: 3
Номер варианта: 14
Краткое описание предметной области: Пациент
Краткое описание добавленных фич: Добавлена очередь сообщений и объектное хранилище.
Тесты написаны, но не проходятся насколько я понял, оно хочет, почему-то от меня какую-то лицензию, хотя руками все нормально запускается. Помогите пожалуйста😭

@github-actions github-actions Bot added In progress Код в процессе проверки Lab 3 Лабораторная №3. Интеграционное тестирование labels May 16, 2026
@github-actions github-actions Bot requested a review from danlla May 16, 2026 18:51
Copy link
Copy Markdown

@danlla danlla left a comment

Choose a reason for hiding this comment

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

  • нужно обновить ридми

Comment thread EventSink/Program.cs
@@ -0,0 +1,119 @@
using Amazon;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

cleanup

Comment thread EventSink/Program.cs
Comment on lines +11 to +14
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddControllers();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Здесь не хватает builder.AddServiceDefaults();

Comment thread EventSink/Program.cs
Comment on lines +32 to +77
builder.Services.AddMassTransit(x =>
{
x.AddConsumer<PatientCreatedConsumer>();

x.UsingAmazonSqs((context, cfg) =>
{
cfg.Host(
"us-east-1",
h =>
{
h.AccessKey("test");

h.SecretKey("test");

h.Config(new AmazonSQSConfig
{
ServiceURL = "http://localhost:4566",
AuthenticationRegion = "us-east-1",
UseHttp = true
});

h.Config(
new AmazonSimpleNotificationServiceConfig
{
ServiceURL =
"http://localhost:4566",

AuthenticationRegion =
"us-east-1",

UseHttp = true
});
});

cfg.ReceiveEndpoint(
"patients-queue",
e =>
{
e.ConfigureConsumeTopology = true;

e.ConfigureConsumer<
PatientCreatedConsumer>(
context);
});
});
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Если не ошибаюсь, на лекциях должно было говорится, что пользоваться MassTransit не стоит, все настроить можно без него, вот пример с лекций

Comment on lines +18 to +21
public PatientIntegrationTests(AppHostFixture fixture)
{
_fixture = fixture;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

В таком случае можно использовать primary constructor

Comment on lines +9 to +23
var localstack = builder.AddContainer(
"localstack",
"localstack/localstack:3.7")
.WithEndpoint(
port: 4566,
targetPort: 4566,
name: "localstack",
scheme: "http")
.WithEnvironment("SERVICES", "s3,sns,sqs")
.WithEnvironment("DEFAULT_REGION", "us-east-1")
.WithEnvironment("AWS_DEFAULT_REGION", "us-east-1")
.WithEnvironment("HOSTNAME_EXTERNAL", "host.docker.internal")
.WithEnvironment(
"SNS_ENDPOINT_STRATEGY",
"off");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Чтобы узнать почему тесты не проходят нужно долго и усердно отлаживать, в дебаге они вроде запускаются но падают на проверках логики

Я бы попробовал здесь явно использовать вместо контейнера пакет LocalStack.Aspire.Hosting как в примере, возможно вместе с избавление от MassTransit это починит тесты

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