Integration tests use standard .NET configuration (Microsoft.Extensions.Configuration).
Settings are read, in increasing order of precedence, from:
appsettings.json(committed template, empty values)appsettings.local.json(gitignored — put your real values here)- user secrets (
dotnet user-secrets, idosdu-csharp-client-integration-tests) - environment variables (
Osdu__*)
Provide the required values for your OSDU environment in appsettings.local.json:
{
"Osdu": {
"Server": "https://your-osdu-instance.com",
"DataPartitionId": "your-partition-id",
"Authority": "https://login.microsoftonline.com/<tenant-id>",
"ClientId": "<public-client-id>",
"Scopes": "api://<app-id-uri>/.default"
}
}…or via environment variables (double-underscore = section nesting):
export Osdu__Server=https://your-osdu-instance.com
export Osdu__DataPartitionId=your-partition-id
export Osdu__Authority=https://login.microsoftonline.com/<tenant-id>
export Osdu__ClientId=<public-client-id>
export Osdu__Scopes=api://<app-id-uri>/.default…or via user secrets:
cd tests/OsduCsharpClient.IntegrationTests
dotnet user-secrets set "Osdu:Server" "https://your-osdu-instance.com"
# …etcOptional environment variables used by tests:
OSDU_MSAL_CACHE_PATH— path to a persistent MSAL token cache file (default:~/.osdu/msal_cache.bin)SEARCH_KIND- kind filter for search tests (default:osdu:wks:work-product-component--WellLog:*)SEARCH_QUERY- query string for search tests (default:*)SEARCH_LIMIT- result limit for search tests (default:5)GROUP_TYPE- group type filter for entitlements tests (default:NONE)WELLBORE_DDMS_WELLBORE_ID- runsGetWellbore_ById_ReturnsRecord(also the parent wellbore forPostWellLog_WithJsonData_CreatesAndRoundTripsRecord)WELLBORE_DDMS_WELL_ID- runsGetWell_ById_ReturnsRecordWELLBORE_DDMS_WELLLOG_ID- runsGetWellLog_ById_ExposesDataAsJsonWELLBORE_DDMS_LEGAL_TAG,WELLBORE_DDMS_ACL_OWNER,WELLBORE_DDMS_ACL_VIEWER- together withWELLBORE_DDMS_WELLBORE_ID, runPostWellLog_WithJsonData_CreatesAndRoundTripsRecord(ingests a WellLog, verifies it, then deletes it)
Integration tests hit a real OSDU server. On first run a browser window will open for interactive MSAL login; the resulting token is cached in .msal_token_cache.bin. Tests are skipped automatically when their required settings are absent.
# Run all integration tests
dotnet test OsduCsharpClient.slnx
# Run a single test by name
dotnet test OsduCsharpClient.slnx --filter "FullyQualifiedName~QueryRecords_ReturnsResults"
# Run tests and see printed output
dotnet test OsduCsharpClient.slnx --logger "console;verbosity=detailed"
# Run only the WellLog tests with full SDK request/response logging
dotnet test tests/OsduCsharpClient.IntegrationTests/OsduCsharpClient.IntegrationTests.csproj \
--filter "FullyQualifiedName~WellLog" \
--logger "console;verbosity=detailed"OsduFixture builds the OsduClient with a logger factory that routes SDK
logs to the running test's xUnit output. With --logger "console;verbosity=detailed",
HTTP request/response lines (and truncated bodies, sensitive headers redacted)
appear under the test that produced them. See the log categories in
docs/usage.md.
Body logging is enabled by default in the test fixture so that a failing test
shows the full request/response. Set OSDU_TEST_LOG_BODIES=false to silence
the Equinor.OsduCsharpClient.Body category for a quieter run; the summary
→ METHOD URL / ← STATUS URL lines still print.