node-facts: verbatim operator-verified files (fixture env without dotfile)

This commit is contained in:
2026-10-06 07:43:23 +00:00
parent b947d7ddf3
commit 6ff21f54e4
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -0,0 +1,2 @@
COMPOSE_FILE=base.yml:rpc.yml:avalanche/go/avalanche-mainnet-go-pruned-leveldb.yml:op/reth/op-mainnet-op-reth-pruned-trace--kona.yml:ethereum/geth/ethereum-mainnet-geth-pruned-pebble-path--nimbus.yml
DOMAIN=fixture.local
+3 -2
View File
@@ -11,6 +11,7 @@ Exit 0 always once .env is readable; exit 2 if .env/COMPOSE_FILE is missing (one
import concurrent.futures as cf, datetime, json, os, re, socket, subprocess, sys, time, urllib.request, ssl
BASE = os.path.dirname(os.path.abspath(__file__))
FIXTURES = os.environ.get("NODE_FACTS_FIXTURES") # test mode: answer HTTP from <dir>/<method-or-path>.json, env from <dir>/env, no network
INFRA = {"base", "rpc", "monitoring", "backup-http", "drpc", "drpc-free", "squidfura", "squidfura-backend", "oracle", "extra"}
NOW = lambda: datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
SEMVER = re.compile(r"(\d+)\.(\d+)\.(\d+)")
@@ -20,7 +21,8 @@ CTX = ssl.create_default_context()
def env():
e = {}
try:
for line in open(os.path.join(BASE, ".env")):
envfile = os.path.join(FIXTURES, "env") if FIXTURES else os.path.join(BASE, ".env") # fixture mode: no dotfile needed
for line in open(envfile):
line = line.strip()
if line and not line.startswith("#") and "=" in line:
k, v = line.split("=", 1); e[k] = v.strip().strip('"').strip("'")
@@ -29,7 +31,6 @@ def env():
return e
FIXTURES = os.environ.get("NODE_FACTS_FIXTURES") # test mode: answer HTTP from <dir>/<method-or-path>.json, no network
def _fixture(url, body):