Skip to content

Conversation

@yunlishao
Copy link
Contributor

Summary

Implements a complete workflow for handling user-provided proprietary scenarios and streamlines Visual Studio debugging configuration to eliminate manual project settings changes.

Related Issues / Tasks

Closes #80

Type of Change

  • Maintenance / Refactor
  • Documentation

Affected Modules / Components

  • tests/UserScenarios/ - New directory structure for proprietary user scenarios
  • TrafficLayer/TrafficLayer/mainTrafficLayer.cpp - Auto-discovery logic for config files
  • TrafficLayer/TrafficLayer/TrafficLayer.vcxproj.user - Removed hardcoded debug arguments
  • .gitignore - Added patterns for UserScenarios and .active_config
  • tests/UserScenarios/README.md - Workflow documentation

Changes

Task 1: User Scenario Integration Workflow

  • Created tests/UserScenarios/ with .gitkeep (tracked across branches)
  • All scenario contents gitignored (maintains privacy between users)
  • Issue-linked subdirectory approach: tests/UserScenarios/issue_X_description/
  • Complete documentation in tests/UserScenarios/README.md

Task 2: VS Debugging Configuration

Auto-discovery logic:

  1. Check TrafficLayer/.active_config for explicit config path
  2. Auto-discover single YAML in tests/UserScenarios/
  3. Error with guidance if multiple YAMLs or none found
  4. Always allows -f flag override

Implementation highlights:

  • Cross-platform file discovery (WIN32 and POSIX implementations)
  • C++11 compatible (no std::filesystem dependency for discovery)
  • Works when working directory is repo root (VS debugging scenario)
  • Deployed executables require explicit -f flag

Workflow:

  • Single scenario: Just F5 in VS
  • Multiple scenarios: echo path/to/config.yaml > TrafficLayer/.active_config
  • Deployment: TrafficLayer.exe -f path/to/config.yaml

Test Cases

Manual testing required:

  1. VS debugging with single user scenario in tests/UserScenarios/
  2. VS debugging with multiple scenarios using .active_config
  3. Command-line execution with -f flag
  4. Verify gitignore patterns work correctly

Environment

Testing environment:

  • Visual Studio 2022
  • Windows (primary), POSIX compatibility added for future

Checklist

  • Code compiles/runs as expected
  • Tests pass locally (requires manual VS debugging verification)
  • Documentation is updated
  • Relevant issues are linked
  • Version-specific changes are noted (C++11 compatible)

Additional Notes

This PR establishes the foundation for the user scenario debugging workflow referenced in issue #80. Both TrafficLayer/.active_config and tests/UserScenarios/* contents are gitignored to maintain privacy and per-worktree flexibility.

Adds logic to build_sumo_executables.ps1 that:
- Patches tools/build_config/templates.py before building to fix escape issues
- Restores templates.py to upstream state after build completes
- Handles restoration in error cases

Also updates cav_casestudy submodule and adds CLAUDE.md project instructions.
Creates tests/UserScenarios/ with workflow for handling user-provided scenarios:
- Folder structure tracked via .gitkeep (exists in all branches)
- README.md documents workflow from OneDrive portal to debugging
- All scenario contents gitignored (maintains privacy)
- Enables full IDE/debugging access without committing proprietary files

This establishes a standardized process for receiving user scenarios via OneDrive file request, creating issue-specific branches, debugging locally, and cleaning up after resolution.

Addresses Task 1 of #80
Adds intelligent config file discovery to streamline debugging without manual
VS project settings changes:

**Auto-discovery logic:**
1. Check TrafficLayer/.active_config for explicit path
2. Auto-discover single YAML in tests/UserScenarios/
3. Error with guidance if multiple YAMLs or none found
4. Always allows -f override

**Implementation:**
- Cross-platform file discovery (WIN32 and POSIX)
- C++11 compatible (no std::filesystem dependency for discovery)
- Works when working directory is repo root (VS debugging scenario)
- Deployed executables still require explicit -f flag

**Changes:**
- Add findYamlFiles() with platform-specific implementations
- Remove hardcoded LocalDebuggerCommandArguments from .vcxproj.user
- Update UserScenarios/README.md with new workflow
- Gitignore TrafficLayer/.active_config (per-worktree)

**Usage:**
- Single scenario: Just F5 in VS
- Multiple scenarios: echo path/to/config.yaml > TrafficLayer/.active_config
- Deployment: TrafficLayer.exe -f path/to/config.yaml

Part of #80 (Task 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MAINTENANCE] Streamline user scenario testing workflow and VS debugging config

3 participants