Skip to content

Commit

Permalink
optimization(loki-tests): change container name & log message to be r…
Browse files Browse the repository at this point in the history
…andomly generated
  • Loading branch information
Aazme committed Oct 31, 2024
1 parent f609f76 commit 2d6516a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_loki_integration.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# tests/test_loki_integration.py
import json
import time
import testinfra
import random
import string
from pytest import fail

def generate_random_string(length=8):
return ''.join(random.choices(string.ascii_letters + string.digits, k=length))

def test_alpine_log_delivery_to_loki(host, setup_alpine_container):
"""Test that logs from a test Alpine container are delivered to Loki."""
# Extract container details from the fixture
container_name, log_message = setup_alpine_container
# Generate random container name and log message
container_name = generate_random_string()
log_message = generate_random_string()

loki_host = "localhost" # Adjust if Loki is on a different host
loki_port = "3100"
Expand Down

0 comments on commit 2d6516a

Please sign in to comment.