Skip to content

Commit

Permalink
Merge branch 'main' into express5-weblog
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-id authored Dec 9, 2024
2 parents 151dcd4 + 5802d25 commit 2270f8c
Show file tree
Hide file tree
Showing 56 changed files with 325 additions and 351 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable changes to this project will be documented in this file.


### 2024-11 (207 PR merged)

* 2024-11-22 [Docker SSI: report data to FPD](https://github.com/DataDog/system-tests/pull/3525) by @robertomonteromiguel
* 2024-11-21 [adding mypy checks](https://github.com/DataDog/system-tests/pull/3488) by @rachelyangdog
* 2024-11-18 [[ruby] Add Rails 7.2 and Rails 8.0 weblogs](https://github.com/DataDog/system-tests/pull/3471) by @vpellan
* 2024-11-13 [Use a unique way to define scenario groups #3400](https://github.com/DataDog/system-tests/pull/3451) by @cbeauchesne
* 2024-11-18 [Test for zombie processes in crashtracking](https://github.com/DataDog/system-tests/pull/3364) by @kevingosse
* 2024-11-04 [Fix parametric instability at container start](https://github.com/DataDog/system-tests/pull/3359) by @cbeauchesne
* 2024-11-06 [parametric: Adds a feature to track the parity for parametric endpoints](https://github.com/DataDog/system-tests/pull/3345) by @mabdinur
* 2024-11-04 [[golang] Migrate Parametric app from grpc to http](https://github.com/DataDog/system-tests/pull/3332) by @mtoffl01


### 2024-10 (176 PR merged)

* Lot of work done on SSI/onboarding by @robertomonteromiguel and @emmettbutler
Expand Down
4 changes: 2 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ def pytest_pycollect_makemodule(module_path, parent):
nodeid = str(module_path.relative_to(module_path.cwd()))

if nodeid in manifests and library in manifests[nodeid]:
declaration = manifests[nodeid][library]
declaration: str = manifests[nodeid][library]

logger.info(f"Manifest declaration found for {nodeid}: {declaration}")

mod: pytest.Module = pytest.Module.from_parent(parent, path=module_path)

if declaration.startswith("irrelevant") or declaration.startswith("flaky"):
if declaration.startswith(("irrelevant", "flaky")):
mod.add_marker(pytest.mark.skip(reason=declaration))
logger.debug(f"Module {nodeid} is skipped by manifest file because {declaration}")
else:
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2021 Datadog, Inc.

from utils import weblog, interfaces, context, irrelevant
from utils import weblog, interfaces

# *ATTENTION*: Copy this file to the tests folder, modify, and rename with a prefix of `test_` to enable your new tests

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
using System.Diagnostics;

if (Environment.GetEnvironmentVariable("FORKED") != null)
{
Thread.Sleep(5_000); // Add a small delay otherwise the telemetry forwarder leaves a zombie process behind
CrashMe(null);

// Should never get there
Thread.Sleep(Timeout.Infinite);
}

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

static string CrashMe(HttpRequest? request)
{
var thread = new Thread(() =>
{
Thread.Sleep(5_000); // Add a small delay otherwise the telemetry forwarder leaves a zombie process behind
throw new BadImageFormatException("Expected");
});

thread.Start();
thread.Join();

// Should never get there
Thread.Sleep(Timeout.Infinite);
return "Failed to crash";
}

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

static string ForkAndCrash(HttpRequest request)
{
// Simulate fork
Expand Down Expand Up @@ -172,6 +179,7 @@ static string GetZombies(HttpRequest request)


app.MapGet("/", () => "Hello World!");
app.MapGet("/crashme", CrashMe);
app.MapGet("/fork_and_crash", ForkAndCrash);
app.MapGet("/child_pids", GetChildPids);
app.MapGet("/zombies", GetZombies);
Expand Down
100 changes: 6 additions & 94 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,12 @@ ignore = [
"E501", # line too long
"E722", # TBD
"E741",
"F401", # easy
"FBT001",
"FBT002", # Boolean default positional argument, TBD
"FURB129",
"INP001", # implicit package
"N801", # easy
"N806",
"PERF401",
"PIE810",
"PERF401", # TBD, the "good" code can be harder to read
"PLR0911", # too many return, may be replaced by a higher default value
"PLR0912", # Too many branches
"PLR0913", # too many arguments, may be replaced by a higher default value
Expand Down Expand Up @@ -145,8 +142,6 @@ ignore = [
"UP015",
"UP024",
"UP038", # we really want this? TBD
"W291", # trailing whitespace, easy one
"W293",


### Ignores that will be kept for the entire project
Expand All @@ -163,6 +158,8 @@ ignore = [
"D211", # no-blank-line-before-class
"D213", # multi-line-summary-second-line
"D400", # First line should end with a period
"D406", # we are not using numpy convention for docstrings
"D407", # we are not using reStructuredText for docstrings
"D415", # First line should end with a period
"EM101", # Exception must not use a string literal => painful
"EM102", # Exception must not use an f-string => painful
Expand All @@ -187,51 +184,9 @@ ignore = [

# TODO : remove those ignores
[tool.ruff.lint.per-file-ignores]
"utils/_context/containers.py" = [
"D406",
"D407",
"D417",
"F841",
"FBT001",
"FIX003",
"PLW2901",
"PTH101",
"PTH109",
"RET505",
"RUF012",
"S104",
"S106",
"S110",
"S113",
"S603",
"S607",
]
"utils/grpc/weblog_pb2_grpc.py" = ["ALL"] # keep this one, it's a generated file
"utils/grpc/weblog_pb2.py" = ["ALL"] # keep this one, it's a generated file
"utils/interfaces/*" = [
"A001",
"E713",
"FBT001",
"FBT003",
"PLR5501",
"PLW2901",
"PTH109",
"PTH112",
"RET502",
"RET504",
"RSE102",
"RUF010",
"RUF012",
"RUF013",
"S201",
"SIM102",
"SIM103",
"SIM118",
"T201",
"TRY203",
"UP011",
"UP034",
]
"utils/grpc/weblog_pb2_grpc.py" = ["ALL"] # keep this one, it's a generated file
"utils/grpc/weblog_pb2.py" = ["ALL"] # keep this one, it's a generated file
"utils/scripts/*" = ["T201"] # allow print statements in scripts folder
"utils/{k8s_lib_injection/*,_context/_scenarios/k8s_lib_injection.py}" = [
"D207",
"SIM115",
Expand Down Expand Up @@ -273,7 +228,6 @@ ignore = [
"N803",
"RET505",
]
"utils/otel_validators/validator_trace.py" = ["FBT001"]
"utils/{_context/_scenarios/docker_ssi.py,docker_ssi/docker_ssi_matrix_builder.py,docker_ssi/docker_ssi_matrix_utils.py}" = [
"PLR2004",
"SIM210",
Expand All @@ -282,48 +236,6 @@ ignore = [
"SIM108",
"T201",
]
"utils/_context/_scenarios/__init__.py" = ["T201"]
"utils/scripts/*" = [
"T201", # allow prints here
"PLW2901", # to be corrected
"SIM115", # to be corrected
"PLR2004", # to be corrected
"S314",
"RUF013",
"B007",
"Q003",
"F541",
"S113",
"A002",
"PLR1711",
"SIM910",
"C405",
"RUF010",
"PLR1704",
]
"utils/proxy/*" = [
"S104", # to be transfered in the line
"DTZ006", # to be corrected
"PLR5501", # to be corrected
"G202", # to be corrected
"PLC0206", # to be corrected
"S307", # to be corrected
"RET505", # to be corrected
"UP034", # to be corrected
"T201", # to be corrected
"C416", # to be corrected
]
"utils/scripts/push-metrics.py" = [
"UP017", # to be corrected
]
"utils/scripts/update_features.py" = ["ALL"] # file must be deleted
"utils/telemetry_utils.py" = ["N806", "RUF012"] # to be corrected
"utils/tools.py" = ["T201", "PLW2901"] # to be transfered in the line
"conftest.py" = [
"SLF001", # to be transfered in the line
"N806", # to be corrected
]
"utils/waf_rules.py" = ["N801"]
"utils/virtual_machine/*" = [
"A002",
"ANN002",
Expand Down
2 changes: 1 addition & 1 deletion tests/docker_ssi/test_docker_ssi_crash.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def setup_crash(self):
self.r = TestDockerSSICrash._r

@features.ssi_crashtracking
@bug(condition=context.library not in ("python", "nodejs"), reason="INPLAT-11")
@bug(condition=context.library not in ("python", "nodejs", "dotnet"), reason="INPLAT-11")
@irrelevant(context.library == "python" and context.installed_language_runtime < "3.7.0")
@irrelevant(context.library == "nodejs" and context.installed_language_runtime < "17.0")
def test_crash(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_seq_id(self):
"""Test that messages are sent sequentially"""

MAX_OUT_OF_ORDER_LAG = 0.3 # s
FMT = "%Y-%m-%dT%H:%M:%S.%f"
FMT = "%Y-%m-%dT%H:%M:%S.%f%z"

telemetry_data = list(interfaces.library.get_telemetry_data(flatten_message_batches=False))
if len(telemetry_data) == 0:
Expand Down Expand Up @@ -296,7 +296,7 @@ def _get_heartbeat_delays_by_runtime() -> dict:
The value is a list of delay observed on this runtime id
"""

fmt = "%Y-%m-%dT%H:%M:%S.%f"
fmt = "%Y-%m-%dT%H:%M:%S.%f%z"

telemetry_data = list(interfaces.library.get_telemetry_data())
heartbeats_by_runtime = defaultdict(list)
Expand Down
15 changes: 15 additions & 0 deletions utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,18 @@
from utils import interfaces, _remote_config as remote_config
from utils.interfaces._core import ValidationError
from utils._features import features

__all__ = [
"ValidationError",
"bug",
"context",
"features",
"flaky",
"interfaces",
"irrelevant",
"missing_feature",
"remote_config",
"rfc",
"scenarios",
"weblog",
]
3 changes: 1 addition & 2 deletions utils/_context/_scenarios/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import json

import pytest
Expand Down Expand Up @@ -791,7 +790,7 @@ def _main():
for scenario in get_all_scenarios()
}

print(json.dumps(data, indent=2))
print(json.dumps(data, indent=2)) # noqa: T201


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion utils/_context/_scenarios/auto_injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def __init__(


class InstallerAutoInjectionScenarioProfiling(_VirtualMachineScenario):
""" As Profiling is not included in GA (2024/11) we reduce the number of VMS to speed up the execution
""" As Profiling is not included in GA (2024/11) we reduce the number of VMS to speed up the execution
Until we fix the performance problems on the AWS architecture and speed up the tests"""

def __init__(
Expand Down
8 changes: 4 additions & 4 deletions utils/_context/_scenarios/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ class AWSIntegrationsScenario(EndToEndScenario):
πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«πŸ”΄πŸš«
⚠️⚠️⚠️⚠️⚠️⚠️⚠️ AWS Authentication Error ⚠️⚠️⚠️⚠️⚠️⚠️⚠️
It seems that your AWS authentication is not set up correctly.
It seems that your AWS authentication is not set up correctly.
Please take the following actions:
πŸ”‘ With `aws-vault` setup:
To enter an authenticated shell session that sets temp AWS credentials in your shell environment:
πŸ‘‰ `aws-vault login sso-sandbox-account-admin --`
πŸ‘‰ `[your system-test command]`
or
or
To run ONLY the system tests command with auth: (temp AWS credentials are not set in shell environment)
πŸ‘‰ `aws-vault login sso-sandbox-account-admin -- [your system-test command]`
πŸ”§ Or to first set up `aws-vault` / `aws-cli`, please visit:
πŸ”— [AWS CLI Config Setup & Update Guide]
Expand Down
Loading

0 comments on commit 2270f8c

Please sign in to comment.