# Run the Google Workspace Live Tests

Run the opt-in Google Docs, Sheets, Slides, Drive, shared-drive and change-feed tests for OfficeIMO against a disposable Drive folder.

**Packages**

- [OfficeIMO.GoogleWorkspace](https://www.nuget.org/packages/OfficeIMO.GoogleWorkspace) `dotnet add package OfficeIMO.GoogleWorkspace`

**Works with**

- .NET

**Target frameworks**

netstandard2.0, net8.0, net10.0, net472

**Data**

- [OfficeIMO.GoogleWorkspace API index](/api/google-workspace/index.json)

Live tests are for contributors working on the OfficeIMO Google Workspace packages. They are opt-in and create disposable resources in one dedicated folder.

## Configure the test account

Set these environment variables:

```powershell
$env:OFFICEIMO_RUN_GOOGLE_WORKSPACE_LIVE = "1"
$env:GOOGLE_WORKSPACE_ACCESS_TOKEN = "<short-lived-token>"
$env:GOOGLE_WORKSPACE_FOLDER_ID = "<disposable-test-folder-id>"
$env:GOOGLE_WORKSPACE_DRIVE_ID = "<optional-shared-drive-id>"
```

## Run the tests

Run the format partitions:

```powershell
dotnet test OfficeIMO.Word.Tests -c Release -f net10.0 --filter Category=GoogleWorkspaceLive
dotnet test OfficeIMO.Excel.Tests -c Release -f net10.0 --filter Category=GoogleWorkspaceLive
dotnet test OfficeIMO.PowerPoint.Tests -c Release -f net10.0 --filter Category=GoogleWorkspaceLive
dotnet test OfficeIMO.GoogleWorkspace.Tests -c Release -f net10.0 --filter Category=GoogleWorkspaceLive
```

Each test creates, reads/imports, exports where applicable, and deletes its file in a `finally` path. The change-feed test also verifies that the disposable item becomes visible. Use a non-production folder and principal with only the scopes needed by the lane. If a cleanup failure is reported, remove that named disposable item before rerunning.

<!-- PowerForge markdown source sha256:ACC64C3AF1F353B630E9D0F9EC7FC402D92648A811C83F70E958DE266D89D644; title=True -->

<!-- PowerForge markdown artifact sha256:F4E7F1C2E669DCFB7E8EC59A74ABEACED2885110D6DDAD4E429FF6680245B968 -->
