consolidate the tests locations

This commit is contained in:
StellaOps Bot
2025-12-26 01:48:24 +02:00
parent 17613acf57
commit 39359da171
2031 changed files with 2607 additions and 476 deletions

View File

@@ -3,7 +3,7 @@
# BENCH-AUTO-401-019: Compute FP/MTTD/repro metrics from bench findings
"""
Computes benchmark metrics from bench/findings/** and outputs to results/summary.csv.
Computes benchmark metrics from src/__Tests/__Benchmarks/findings/** and outputs to results/summary.csv.
Metrics:
- True Positives (TP): Reachable vulns correctly identified
@@ -283,13 +283,13 @@ def main():
parser.add_argument(
"--findings",
type=Path,
default=Path("bench/findings"),
default=Path("src/__Tests/__Benchmarks/findings"),
help="Path to findings directory"
)
parser.add_argument(
"--output",
type=Path,
default=Path("bench/results"),
default=Path("src/__Tests/__Benchmarks/results"),
help="Output directory for metrics"
)
parser.add_argument(

View File

@@ -1,9 +1,9 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: AGPL-3.0-or-later
# BENCH-AUTO-401-019: Automate population of bench/findings/** from reachbench fixtures
# BENCH-AUTO-401-019: Automate population of src/__Tests/__Benchmarks/findings/** from reachbench fixtures
"""
Populates bench/findings/** with per-CVE VEX decision bundles derived from
Populates src/__Tests/__Benchmarks/findings/** with per-CVE VEX decision bundles derived from
reachbench fixtures, including reachability evidence, SBOM excerpts, and
DSSE envelope stubs.
@@ -327,18 +327,18 @@ def populate_finding(
def main():
parser = argparse.ArgumentParser(
description="Populate bench/findings/** from reachbench fixtures"
description="Populate src/__Tests/__Benchmarks/findings/** from reachbench fixtures"
)
parser.add_argument(
"--fixtures",
type=Path,
default=Path("tests/reachability/fixtures/reachbench-2025-expanded"),
default=Path("src/__Tests/reachability/fixtures/reachbench-2025-expanded"),
help="Path to reachbench fixtures directory"
)
parser.add_argument(
"--output",
type=Path,
default=Path("bench/findings"),
default=Path("src/__Tests/__Benchmarks/findings"),
help="Output directory for findings"
)
parser.add_argument(

View File

@@ -22,7 +22,7 @@ usage() {
echo "Run benchmark automation pipeline."
echo ""
echo "Options:"
echo " --populate Populate bench/findings from reachbench fixtures"
echo " --populate Populate src/__Tests/__Benchmarks/findings from reachbench fixtures"
echo " --compute Compute metrics from findings"
echo " --compare BASELINE Compare with baseline scanner results"
echo " --all Run all steps (populate + compute)"
@@ -99,9 +99,9 @@ fi
# Step 3: Compare with baseline
if [[ -n "$BASELINE_PATH" ]]; then
log_info "Step 3: Comparing with baseline..."
python3 bench/tools/compare.py --baseline "$BASELINE_PATH" --json
python3 src/__Tests/__Benchmarks/tools/compare.py --baseline "$BASELINE_PATH" --json
echo ""
fi
log_info "Benchmark automation complete!"
log_info "Results available in bench/results/"
log_info "Results available in src/__Tests/__Benchmarks/results/"

View File

@@ -4,7 +4,7 @@
# Computes reachability metrics against ground-truth corpus
#
# Usage: ./compute-reachability-metrics.sh [options]
# --corpus-path PATH Path to ground-truth corpus (default: tests/reachability/corpus)
# --corpus-path PATH Path to ground-truth corpus (default: src/__Tests/reachability/corpus)
# --output FILE Output JSON file (default: stdout)
# --dry-run Show what would be computed without running scanner
# --strict Exit non-zero if any threshold is violated
@@ -19,7 +19,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
# Default paths
CORPUS_PATH="${REPO_ROOT}/tests/reachability/corpus"
CORPUS_PATH="${REPO_ROOT}/src/__Tests/reachability/corpus"
OUTPUT_FILE=""
DRY_RUN=false
STRICT=false

View File

@@ -20,9 +20,9 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
# Default paths
RESULTS_PATH="${REPO_ROOT}/bench/results"
RESULTS_PATH="${REPO_ROOT}/src/__Tests/__Benchmarks/results"
OUTPUT_FILE=""
BASELINE_FILE="${REPO_ROOT}/bench/baselines/ttfs-baseline.json"
BASELINE_FILE="${REPO_ROOT}/src/__Tests/__Benchmarks/baselines/ttfs-baseline.json"
DRY_RUN=false
STRICT=false
VERBOSE=false

View File

@@ -20,7 +20,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
# Default paths
RESULTS_PATH="${REPO_ROOT}/bench/results"
RESULTS_PATH="${REPO_ROOT}/src/__Tests/__Benchmarks/results"
SLOS_FILE="${SCRIPT_DIR}/performance-slos.yaml"
OUTPUT_FILE=""
DRY_RUN=false

View File

@@ -7,7 +7,7 @@ CLI=${CLI:-"dotnet run --project src/Cli/StellaOps.Cli/StellaOps.Cli.csproj --no
RESULTS="out/cli-chaos"
mkdir -p "$RESULTS"
PACK="${PACK:-tests/fixtures/task-packs/sample-pack.yaml}"
PACK="${PACK:-src/__Tests/fixtures/task-packs/sample-pack.yaml}"
RANDOM_FAIL=${RANDOM_FAIL:-true}
SEALED=${SEALED:-false}

View File

@@ -3,7 +3,7 @@ set -euo pipefail
# DEVOPS-CLI-43-003: parity diff for CLI golden outputs
EXPECTED_DIR=${EXPECTED_DIR:-"tests/goldens"}
EXPECTED_DIR=${EXPECTED_DIR:-"src/__Tests/goldens"}
ACTUAL_DIR=${ACTUAL_DIR:-"out/cli-goldens"}
CLI=${CLI:-"dotnet run --project src/Cli/StellaOps.Cli/StellaOps.Cli.csproj --no-build --"}

View File

@@ -24,7 +24,7 @@ paths=(
"ops/devops/ci-110-runner/artifacts"
"ops/devops/sealed-mode-ci/artifacts"
"TestResults"
"tests/TestResults"
"src/__Tests/TestResults"
".nuget/packages"
".nuget/packages"
)

View File

@@ -5,7 +5,7 @@ set -euo pipefail
# Safe for repeated invocation; respects STELLAOPS_OPENSSL11_SHIM override.
ROOT=${STELLAOPS_REPO_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}
SHIM_DIR=${STELLAOPS_OPENSSL11_SHIM:-"${ROOT}/tests/native/openssl-1.1/linux-x64"}
SHIM_DIR=${STELLAOPS_OPENSSL11_SHIM:-"${ROOT}/src/__Tests/native/openssl-1.1/linux-x64"}
if [[ ! -d "${SHIM_DIR}" ]]; then
echo "::warning ::OpenSSL 1.1 shim directory not found at ${SHIM_DIR}; Mongo2Go tests may fail" >&2

View File

@@ -5,7 +5,7 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
TEST_PROJECT="${REPO_ROOT}/tests/reachability/StellaOps.Reachability.FixtureTests/StellaOps.Reachability.FixtureTests.csproj"
TEST_PROJECT="${REPO_ROOT}/src/__Tests/reachability/StellaOps.Reachability.FixtureTests/StellaOps.Reachability.FixtureTests.csproj"
# Colors for output
RED='\033[0;31m'
@@ -77,13 +77,13 @@ if ! command -v dotnet &> /dev/null; then
fi
# Verify corpus exists
if [[ ! -f "${REPO_ROOT}/tests/reachability/corpus/manifest.json" ]]; then
log_error "Corpus manifest not found at tests/reachability/corpus/manifest.json"
if [[ ! -f "${REPO_ROOT}/src/__Tests/reachability/corpus/manifest.json" ]]; then
log_error "Corpus manifest not found at src/__Tests/reachability/corpus/manifest.json"
exit 1
fi
if [[ ! -f "${REPO_ROOT}/tests/reachability/fixtures/reachbench-2025-expanded/INDEX.json" ]]; then
log_error "Reachbench INDEX not found at tests/reachability/fixtures/reachbench-2025-expanded/INDEX.json"
if [[ ! -f "${REPO_ROOT}/src/__Tests/reachability/fixtures/reachbench-2025-expanded/INDEX.json" ]]; then
log_error "Reachbench INDEX not found at src/__Tests/reachability/fixtures/reachbench-2025-expanded/INDEX.json"
exit 1
fi

View File

@@ -5,7 +5,7 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
CORPUS_DIR="${REPO_ROOT}/tests/reachability/corpus"
CORPUS_DIR="${REPO_ROOT}/src/__Tests/reachability/corpus"
RED='\033[0;31m'
GREEN='\033[0;32m'

View File

@@ -8,7 +8,7 @@
#
# Usage:
# ./scripts/validate-sbom.sh <sbom-file> [--schema <schema-path>]
# ./scripts/validate-sbom.sh bench/golden-corpus/sample.cyclonedx.json
# ./scripts/validate-sbom.sh src/__Tests/__Benchmarks/golden-corpus/sample.cyclonedx.json
# ./scripts/validate-sbom.sh --all # Validate all CycloneDX fixtures
#
# Exit codes:
@@ -120,7 +120,7 @@ validate_cyclonedx() {
}
validate_all() {
local fixture_dir="${REPO_ROOT}/bench/golden-corpus"
local fixture_dir="${REPO_ROOT}/src/__Tests/__Benchmarks/golden-corpus"
local failed=0
local passed=0
local skipped=0
@@ -167,7 +167,7 @@ Usage: $(basename "$0") [OPTIONS] <sbom-file>
Validates CycloneDX SBOM files against official JSON schemas.
Options:
--all Validate all CycloneDX fixtures in bench/golden-corpus/
--all Validate all CycloneDX fixtures in src/__Tests/__Benchmarks/golden-corpus/
--schema <path> Use custom schema file (default: docs/schemas/cyclonedx-bom-1.6.schema.json)
--help, -h Show this help message