Skip to content

Commit

Permalink
Fixing e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
stevejgordon committed Nov 22, 2024
1 parent cd77bb4 commit 4f72085
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ concurrency:

env:
# (keep_serverless-staging-oblt, keep_serverless-qa-oblt or serverless-production-oblt)
SERVERLESS_PROJECT: serverless-production-oblt
SERVERLESS_PROJECT: keep_serverless-qa-oblt

# NOTE: if you add a new job and it's a mandatory check then
# update e2e-docs.yml
Expand Down Expand Up @@ -64,8 +64,8 @@ jobs:
with:
export_to_environment: true
secrets: |-
E2E__BROWSEREMAIL:elastic-observability/elastic-cloud-observability-team-pro-username
E2E__BROWSERPASSWORD:elastic-observability/elastic-cloud-observability-team-pro-password
E2E__BROWSEREMAIL:elastic-observability/elastic-cloud-observability-team-qa-username
E2E__BROWSERPASSWORD:elastic-observability/elastic-cloud-observability-team-qa-password
- name: End-to-end tests
run: ./build.sh test --test-suite=e2e
Expand Down
35 changes: 14 additions & 21 deletions examples/Example.AspNetCore.Mvc/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:45954",
"sslPort": 44302
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5247",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:5247"
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7295;http://localhost:5247",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"OTEL_RESOURCE_ATTRIBUTES": "service.name=AspNetCoreApp,service.version=1.0.0,deployment.environment=development"
}
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7295;http://localhost:5247"
},
"IIS Express": {
"commandName": "IISExpress",
Expand All @@ -35,5 +19,14 @@
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:45954",
"sslPort": 44302
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public ApmUIBrowserContext(IConfigurationRoot configuration, string serviceName)
// https://{instance}.kb.us-east-1.aws.elastic.cloud/app/apm/services?comparisonEnabled=true&environment=ENVIRONMENT_ALL&rangeFrom=now-15m&rangeTo=now&offset=1d
var endpoint = configuration["E2E:Endpoint"]?.Trim() ?? string.Empty;
var newBase = endpoint.Replace(".apm.", ".kb.");
KibanaAppUri = new Uri(new Uri(newBase), "app/apm");
KibanaAppUri = new Uri($"{newBase}/app/apm");
}

public Uri KibanaAppUri { get; }
Expand All @@ -47,7 +47,6 @@ public async Task InitializeAsync()
await page.GetByRole(AriaRole.Textbox, new() { Name = "password" }).FillAsync(password);
await page.GetByRole(AriaRole.Button, new() { Name = "Log in" }).ClickAsync();


await WaitForServiceOnOverview(page);

StorageState = await page.Context.StorageStateAsync();
Expand Down Expand Up @@ -92,11 +91,12 @@ public async Task WaitForServiceOnOverview(IPage page)
var servicesHeader = page.GetByRole(AriaRole.Heading, new() { Name = "Services" });
await servicesHeader.WaitForAsync(new() { State = WaitForSelectorState.Visible, Timeout = timeout });

Console.WriteLine($"Search for service name: {_serviceName}");

//service.name : dotnet-e2e-*
var queryBar = page.GetByRole(AriaRole.Textbox, new() { Name = "Start typing to search and filter the APM page" });
var queryBar = page.GetByRole(AriaRole.Searchbox, new() { Name = "Search services by name" });
await queryBar.WaitForAsync(new() { State = WaitForSelectorState.Visible, Timeout = timeout });

await queryBar.FillAsync($"service.name: {_serviceName}");
await queryBar.FillAsync(_serviceName);
await queryBar.PressAsync("Enter");

Exception? observed = null;
Expand All @@ -113,6 +113,8 @@ public async Task WaitForServiceOnOverview(IPage page)
}
catch (Exception e)
{
await page.ScreenshotAsync(new() { Path = $"squibble{i}.jpeg", FullPage = true });

observed ??= e;
await page.ReloadAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ private LongRunningArguments CreateStartArgs()
{ "OTEL_BSP_SCHEDULE_DELAY", "1000" },
{ "OTEL_BSP_MAX_EXPORT_BATCH_SIZE", "5" },
{ "OTEL_RESOURCE_ATTRIBUTES", $"service.name={_serviceName},service.version=1.0,1,deployment.environment=e2e" },

{ "ELASTIC_OTEL_LOG_DIRECTORY", LogDirectory.FullName },
{ "ELASTIC_OTEL_LOG_LEVEL", "INFO" },
},
Expand Down

0 comments on commit 4f72085

Please sign in to comment.