You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: services/libs/tinybird/README.md
+115Lines changed: 115 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,3 +154,118 @@ Until we move fully to **Tinybird Forward** (which will support migration script
154
154
2.**Pipe-by-pipe updates** for zero downtime where #1 is not enough
155
155
156
156
Pick the method that best fits your workflow and datasource complexity.
157
+
158
+
# Testing Tinybird Pipes Locally
159
+
160
+
This guide explains how to test a Tinybird data pipeline ("pipe") on your local Tinybird environment. We will fetch sample data (fixtures) from a staging Tinybird workspace and use it to run and verify a pipe locally. The steps below are written for a developer who may not be familiar with Tinybird, and they are organized in a clear, numbered format for easy follow-up.
161
+
162
+
## Prerequisites
163
+
164
+
-**Tinybird CLI and Local Environment:** Make sure you have the Tinybird CLI (`tb`) installed.
165
+
To start a local Tinybird instance, run the following Docker command:
166
+
```bash
167
+
docker run --platform linux/amd64 -p 7181:7181 --name tinybird-classic-local \
This will start Tinybird Local at `http://localhost:7181`.
171
+
172
+
-**Staging Workspace Access:** You need access to a Tinybird staging (or production) workspace with an API token that has permission to read data (we'll use it to export data).
173
+
-**Project Files:** Ensure you have your Tinybird project files available locally – this includes the data source definitions and pipe (.pipe) files you plan to test. For example, if you plan to test a pipe that uses a data source named `insightsProjects`, you should have the corresponding `insightsProjects.datasource` file (or have created that data source) in your local workspace. Similarly, have the pipe file (e.g. `activities_filtered.pipe` and any related pipes) ready in your project directory.
174
+
175
+
## Steps to Test the Tinybird Integration Locally
176
+
177
+
1.**Set Up Environment Variables and Authenticate**
178
+
Instead of exporting variables directly in the shell (which can leak tokens into your shell history), we recommend using a `.env` file.
179
+
180
+
First, copy the example file and fill in the values:
181
+
```bash
182
+
cp .env.example .env
183
+
```
184
+
185
+
Edit `.env` and set your staging token. For the local token, you need to fetch it from the local Tinybird API with the following command:
Next, fetch some sample data from the staging environment to use in your local test. We will use the Tinybird SQL API via a `curl` command to retrieve data. In this example, we select up to 200 rows from the `insightsProjects` data source in the staging workspace and save it to a local file:
0 commit comments