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
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Tests

permissions:
contents: read

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Set up Python
run: uv python install 3.11

- name: Install dependencies
run: uv sync --all-extras --dev

- name: Run tests (mocked only)
run: uv run pytest -m "not uses_real_data" -n auto

- name: Check code quality
run: |
uv run ruff check .
uv run ruff format --check .
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,46 @@ The models are based on the Pydantic BaseModel, so it is possible to build an en
- **Translation**: Multi-language translation support
- **OFSAPIError**: Standardized API error responses

## Testing

pyOFSC includes a comprehensive test suite with 500+ tests. Tests run in parallel by default for faster execution.

### Running Tests

```bash
# Run all tests in parallel (auto-detect CPU cores)
uv run pytest -n auto

# Run tests with specific number of workers
uv run pytest -n 4

# Run only mocked tests (no API credentials needed)
uv run pytest -m "not uses_real_data" -n auto

# Run tests sequentially (if needed)
uv run pytest -n 0

# Run specific test file
uv run pytest tests/async/test_async_workzones.py -n auto
```

### Test Requirements

- **Mocked tests**: No special requirements, use saved API responses
- **Live tests** (marked with `@pytest.mark.uses_real_data`): Require API credentials in `.env` file:
```
OFSC_CLIENT_ID=your_client_id
OFSC_COMPANY=your_company
OFSC_CLIENT_SECRET=your_secret
```

### Test Markers

- `@pytest.mark.uses_real_data` - Tests that require API credentials
- `@pytest.mark.serial` - Tests that must run sequentially (modify shared API state)
- `@pytest.mark.slow` - Slow-running tests
- `@pytest.mark.integration` - Integration tests

## Functions implemented


Expand Down
40 changes: 20 additions & 20 deletions docs/ENDPOINTS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# OFSC API Endpoints Reference

**Version:** 2.21.0
**Last Updated:** 2025-12-29
**Last Updated:** 2025-12-31

This document provides a comprehensive reference of all Oracle Field Service Cloud (OFSC) API endpoints and their implementation status in pyOFSC.

Expand Down Expand Up @@ -121,31 +121,31 @@ This document provides a comprehensive reference of all Oracle Field Service Clo
|CB005G|`/rest/ofscCollaboration/v1/chats/{chatId}/participants` |collaboration|GET |- |
|CB006P|`/rest/ofscCollaboration/v1/chats/{chatId}/participants/invite` |collaboration|POST |- |
|CO001P|`/rest/ofscCore/v1/activities` |core |POST |- |
|CO001G|`/rest/ofscCore/v1/activities` |core |GET |sync |
|CO001G|`/rest/ofscCore/v1/activities` |core |GET |both |
|CO002A|`/rest/ofscCore/v1/activities/{activityId}` |core |PATCH |sync |
|CO002D|`/rest/ofscCore/v1/activities/{activityId}` |core |DELETE|sync |
|CO002G|`/rest/ofscCore/v1/activities/{activityId}` |core |GET |sync |
|CO002G|`/rest/ofscCore/v1/activities/{activityId}` |core |GET |both |
|CO003G|`/rest/ofscCore/v1/activities/{activityId}/multidaySegments` |core |GET |- |
|CO004U|`/rest/ofscCore/v1/activities/{activityId}/{propertyLabel}` |core |PUT |- |
|CO004G|`/rest/ofscCore/v1/activities/{activityId}/{propertyLabel}` |core |GET |sync |
|CO004G|`/rest/ofscCore/v1/activities/{activityId}/{propertyLabel}` |core |GET |both |
|CO004D|`/rest/ofscCore/v1/activities/{activityId}/{propertyLabel}` |core |DELETE|- |
|CO005G|`/rest/ofscCore/v1/activities/{activityId}/submittedForms` |core |GET |- |
|CO005G|`/rest/ofscCore/v1/activities/{activityId}/submittedForms` |core |GET |async |
|CO006U|`/rest/ofscCore/v1/activities/{activityId}/resourcePreferences` |core |PUT |- |
|CO006G|`/rest/ofscCore/v1/activities/{activityId}/resourcePreferences` |core |GET |- |
|CO006G|`/rest/ofscCore/v1/activities/{activityId}/resourcePreferences` |core |GET |async |
|CO006D|`/rest/ofscCore/v1/activities/{activityId}/resourcePreferences` |core |DELETE|- |
|CO007U|`/rest/ofscCore/v1/activities/{activityId}/requiredInventories` |core |PUT |- |
|CO007G|`/rest/ofscCore/v1/activities/{activityId}/requiredInventories` |core |GET |- |
|CO007G|`/rest/ofscCore/v1/activities/{activityId}/requiredInventories` |core |GET |async |
|CO007D|`/rest/ofscCore/v1/activities/{activityId}/requiredInventories` |core |DELETE|- |
|CO008P|`/rest/ofscCore/v1/activities/{activityId}/customerInventories` |core |POST |- |
|CO008G|`/rest/ofscCore/v1/activities/{activityId}/customerInventories` |core |GET |- |
|CO009G|`/rest/ofscCore/v1/activities/{activityId}/installedInventories` |core |GET |- |
|CO010G|`/rest/ofscCore/v1/activities/{activityId}/deinstalledInventories` |core |GET |- |
|CO011G|`/rest/ofscCore/v1/activities/{activityId}/linkedActivities` |core |GET |- |
|CO008G|`/rest/ofscCore/v1/activities/{activityId}/customerInventories` |core |GET |async |
|CO009G|`/rest/ofscCore/v1/activities/{activityId}/installedInventories` |core |GET |async |
|CO010G|`/rest/ofscCore/v1/activities/{activityId}/deinstalledInventories` |core |GET |async |
|CO011G|`/rest/ofscCore/v1/activities/{activityId}/linkedActivities` |core |GET |async |
|CO011D|`/rest/ofscCore/v1/activities/{activityId}/linkedActivities` |core |DELETE|- |
|CO011P|`/rest/ofscCore/v1/activities/{activityId}/linkedActivities` |core |POST |- |
|CO012G|`/rest/ofscCore/v1/activities/{activityId}/capacityCategories` |core |GET |- |
|CO012G|`/rest/ofscCore/v1/activities/{activityId}/capacityCategories` |core |GET |async |
|CO013D|`/rest/ofscCore/v1/activities/{activityId}/linkedActivities/{linkedActivityId}/linkTypes/{linkType}` |core |DELETE|- |
|CO013G|`/rest/ofscCore/v1/activities/{activityId}/linkedActivities/{linkedActivityId}/linkTypes/{linkType}` |core |GET |- |
|CO013G|`/rest/ofscCore/v1/activities/{activityId}/linkedActivities/{linkedActivityId}/linkTypes/{linkType}` |core |GET |async |
|CO013U|`/rest/ofscCore/v1/activities/{activityId}/linkedActivities/{linkedActivityId}/linkTypes/{linkType}` |core |PUT |- |
|CO014G|`/rest/ofscCore/v1/activities/custom-actions/search` |core |GET |sync |
|CO015P|`/rest/ofscCore/v1/activities/custom-actions/bulkUpdate` |core |POST |sync |
Expand Down Expand Up @@ -266,12 +266,12 @@ This document provides a comprehensive reference of all Oracle Field Service Clo

## Implementation Summary

- **Sync only**: 48 endpoints
- **Async only**: 12 endpoints
- **Both**: 41 endpoints
- **Not implemented**: 142 endpoints
- **Sync only**: 45 endpoints
- **Async only**: 21 endpoints
- **Both**: 44 endpoints
- **Not implemented**: 133 endpoints
- **Total sync**: 89 endpoints
- **Total async**: 53 endpoints
- **Total async**: 65 endpoints

## Implementation Statistics by Module and Method

Expand All @@ -293,13 +293,13 @@ This document provides a comprehensive reference of all Oracle Field Service Clo
| Module | GET |Write (POST/PUT/PATCH)| DELETE | Total |
|-------------|------------------|----------------------|---------------|------------------|
|metadata |41/51 (80.4%) |10/30 (33.3%) |2/5 (40.0%) |53/86 (61.6%) |
|core |0/51 (0.0%) |0/56 (0.0%) |0/20 (0.0%) |0/127 (0.0%) |
|core |12/51 (23.5%) |0/56 (0.0%) |0/20 (0.0%) |12/127 (9.4%) |
|capacity |0/7 (0.0%) |0/5 (0.0%) |0/0 (0%) |0/12 (0.0%) |
|statistics |0/3 (0.0%) |0/3 (0.0%) |0/0 (0%) |0/6 (0.0%) |
|partscatalog |0/0 (0%) |0/2 (0.0%) |0/1 (0.0%) |0/3 (0.0%) |
|collaboration|0/3 (0.0%) |0/4 (0.0%) |0/0 (0%) |0/7 (0.0%) |
|auth |0/0 (0%) |0/2 (0.0%) |0/0 (0%) |0/2 (0.0%) |
|**Total** |**41/115 (35.7%)**|**10/102 (9.8%)** |**2/26 (7.7%)**|**53/243 (21.8%)**|
|**Total** |**53/115 (46.1%)**|**10/102 (9.8%)** |**2/26 (7.7%)**|**65/243 (26.7%)**|

## Endpoint ID Reference

Expand Down
Loading
Loading