Skip to content
Merged
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ hed_cache/
spec_tests/hed-specification/tests
spec_tests/hed-examples
spec_tests/*.json
spec_tests/hed-tests/json_test_data

# GitHub Copilot instructions (project-specific)
.github/copilot-instructions.md
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "spec_tests/hed-tests"]
path = spec_tests/hed-tests
url = https://github.com/hed-standard/hed-tests/
url = https://github.com/hed-standard/hed-tests.git
branch = main

[submodule "spec_tests/hed-examples"]
Expand Down
31 changes: 24 additions & 7 deletions spec_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ To run spec_tests locally, you need to have the following directory structure:

```
spec_tests/
├── hed-specification/
│ └── tests/
│ └── json_tests/ # JSON test files for error validation
├── hed-tests/
│ └── json_test_data/ # JSON test files from hed-tests repository
├── hed-examples/
│ └── datasets/ # BIDS datasets for validation testing
├── test_sidecar.json # Already present
Expand All @@ -23,9 +22,24 @@ spec_tests/

## Setup Instructions

1. **Copy Submodule Content**:
- Copy the content of the `hed-specification` repository to `spec_tests/hed-specification/`
- Copy the content of the `hed-examples` repository to `spec_tests/hed-examples/`
### Option 1: Using Git Submodules (Recommended)

1. **Initialize Submodules**:
```powershell
git submodule update --init --recursive
```
This will automatically clone the `hed-tests` and `hed-examples` repositories into the correct locations.

2. **Update Submodules** (when needed):
```powershell
git submodule update --remote
```

### Option 2: Manual Setup (Alternative)

1. **Clone Required Repositories**:
- Clone the `hed-tests` repository to `spec_tests/hed-tests/`
- Clone the `hed-examples` repository to `spec_tests/hed-examples/`

2. **Verify Setup**:
- Run `python spec_tests/check_setup.py` to verify all required directories exist
Expand Down Expand Up @@ -60,7 +74,10 @@ python -m unittest spec_tests.test_hed_cache -v

- The `test_hed_cache.py` tests should work immediately as they don't require the submodule content
- The `test_errors.py` and `validate_bids.py` tests require the submodule content to be present
- On GitHub Actions, the submodules are automatically checked out, but locally you need to copy the content manually
- On GitHub Actions, the submodules are automatically checked out via the workflow configuration
- Locally, initialize submodules using `git submodule update --init --recursive`
- The `spec_tests/hed-tests/` directory is gitignored to prevent committing submodule content directly
- Use `git submodule update --remote` to pull the latest changes from the submodule repositories

## Troubleshooting

Expand Down
13 changes: 7 additions & 6 deletions spec_tests/check_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ def main():

# Required directories and their purposes
required_dirs = [
("hed-specification", "HED specification repository"),
("hed-specification/tests", "HED specification test directory"),
("hed-specification/tests/json_tests", "JSON test files for error testing"),
("hed-tests", "HED tests repository"),
("hed-tests/json_test_data", "JSON test data directory"),
("hed-examples", "HED examples repository"),
("hed-examples/datasets", "BIDS datasets for validation testing"),
]
Expand Down Expand Up @@ -87,9 +86,11 @@ def main():
print("Tests that require missing content will be skipped gracefully.")
print("\nCurrently available: test_hed_cache.py (works without submodules)")
print("Currently skipped: test_errors.py, validate_bids.py (need submodule content)")
print("\nTo set up full spec_tests:")
print("1. Copy the hed-specification repository content to spec_tests/hed-specification/")
print("2. Copy the hed-examples repository content to spec_tests/hed-examples/")
print("\nTo set up full spec_tests using submodules:")
print(" git submodule update --init --recursive")
print("\nAlternatively, manually clone:")
print("1. Clone hed-tests repository to spec_tests/hed-tests/")
print("2. Clone hed-examples repository to spec_tests/hed-examples/")

print("\nTo run available tests now:")
print(f" cd {os.path.dirname(spec_tests_dir)}")
Expand Down
1 change: 1 addition & 0 deletions spec_tests/hed-tests
Submodule hed-tests added at 64b97f

This file was deleted.

This file was deleted.

Loading