Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ on:
- main
schedule:
- cron: "45 0 * * *"
workflow_dispatch:
inputs:
testrail-run-name-for-cli-test:
description: 'Name for the TestRail test run'
required: false
default: ''

jobs:
govulncheck:
Expand Down Expand Up @@ -62,7 +68,8 @@ jobs:
platform-ref: "main"
- uses: opentdf/otdfctl/e2e@main
with:
otdfctl-ref: ${{ github.event.pull_request.head.sha }}
otdfctl-ref: ${{ github.event.pull_request.head.sha || github.sha }}
testrail-run-name-for-cli-test: ${{ inputs.testrail-run-name-for-cli-test }}
env:
TESTRAIL_USER: ${{ secrets.TESTRAIL_USER }}
TESTRAIL_PASS: ${{ secrets.TESTRAIL_PASS }}
Expand Down
2 changes: 2 additions & 0 deletions e2e/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ runs:
name: bats-test-results
path: otdfctl/e2e/bats-results.tap
- name: Integrate Bats test results into TestRail
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
shell: bash
working-directory: otdfctl
run: |
Expand All @@ -93,6 +94,7 @@ runs:
TESTRAIL_PASS: ${{ env.TESTRAIL_PASS }}
TESTRAIL_CLI_RUN_NAME: ${{ inputs.testrail-run-name-for-cli-test }}
- name: Upload TestRail mapping report
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: test-cases-mapping-report
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@
"Unsafe reactivate namespace": "C793449",
"List namespaces - when reactivated": "C793450",
"Unsafe delete namespace": "C793451",
"List namespaces - when deleted": "C793452"
"List namespaces - when deleted": "C793452",
"Direct path: policy namespaces commands are accessible": "C10294193"
},
"Obligations": {
"Create a obligation - Good": "C875288",
Expand All @@ -218,6 +219,7 @@
"Create an obligation trigger - Required Only - IDs - Success": "C875308",
"Create an obligation trigger - Required Only - FQNs - Success": "C875309",
"Create an obligation trigger - Optional Fields - Success": "C875310",
"Create an obligation trigger - Same tuple different client IDs - Success": "C10294194",
"Create an obligation trigger - Bad": "C875311",
"Delete an obligation trigger - Good": "C875312",
"List obligation triggers - No filters": "C875378",
Expand Down Expand Up @@ -295,6 +297,9 @@
"Update a SCS - from flag value JSON": "C794014",
"Update a SCS - from file": "C797138",
"List SCS": "C794015",
"Create a SCS with namespace id": "C10322092",
"Create a SCS with namespace FQN": "C10322093",
"List SCS with namespace filter": "C10322094",
"Prune SCS - deletes unmapped SCS alone": "C794016"
},
"Subject Mapping": {
Expand All @@ -303,6 +308,9 @@
"Get subject mapping": "C793465",
"Update a subject mapping": "C793466",
"List subject mappings": "C793467",
"Create subject mapping with namespace ID": "C10322095",
"Create subject mapping with namespace FQN": "C10322096",
"List subject mappings with namespace": "C10322097",
"Delete subject mapping": "C793468"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ set -euo pipefail
# Dependencies: jq, curl
# ================================================================

# -----------------------------
# Colors
# -----------------------------
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'

# -----------------------------
# Load TestRail config
# -----------------------------
Expand Down Expand Up @@ -73,7 +80,7 @@ lookup_case_id() {
while IFS= read -r section; do
id=$(jq -r --arg n "$lowercasename" --arg s "$section" '
reduce ( .[$s] | to_entries[] ) as $item (null;
if ($item.key | ascii_downcase) == $n then $item.value else . end
if ($item.key | ascii_downcase | ltrimstr("[auto] ") | ltrimstr("(auto) ")) == $n then $item.value else . end
)
' "$MAPPING_FILE")

Expand All @@ -86,7 +93,7 @@ lookup_case_id() {
# Flat JSON
id=$(jq -r --arg n "$lowercasename" '
reduce to_entries[] as $item (null;
if ($item.key | ascii_downcase) == $n then $item.value else . end
if ($item.key | ascii_downcase | ltrimstr("[auto] ") | ltrimstr("(auto) ")) == $n then $item.value else . end
)
' "$MAPPING_FILE")

Expand Down Expand Up @@ -129,12 +136,12 @@ parse_tap() {
if [[ -n "$mapping" ]]; then
case_id="${mapping%%|*}"
section="${mapping##*|}"
echo "\"$name\" YES $case_id (Section: $section)"
echo "\"$name\" YES $case_id" >> "$REPORT_FILE"
echo -e "\"$name\" ${GREEN}YES_MAPPING_FOUND${NC} $case_id (Section: $section)"
echo "\"$name\" YES_MAPPING_FOUND $case_id" >> "$REPORT_FILE"
results+=("{\"case_id\": ${case_id#C}, \"status_id\": $status_id, \"comment\": \"$name\"}")
else
echo "\"$name\" NO"
echo "\"$name\" NO" >> "$REPORT_FILE"
echo -e "\"$name\" ${RED}MAPPING_NOT_FOUND${NC}"
echo "\"$name\" MAPPING_NOT_FOUND" >> "$REPORT_FILE"
fi
fi
done < "$TAP_FILE"
Expand Down
Loading