1. Help Center
  2. Collaborative Dashboards

How can I know which project a test session belongs to?

Tag your test sessions by project

* This feature is available starting at version 1.4.1 of the agent.

Knowing quickly which project a test session belongs to in the dashboards can make collaboration across teams and projects much easier. You can now tag your Testcontainers sessions by project and provide a useful link, such as the repo or wiki.

To get started, simply set the TCC_PROJECT_KEY and TCC_PROJECT_URL environment variables. Alternatively, you could set the tcc.project.key and tcc.project.url properties (e.g. in your ~/.testcontainers.properties file). 

For the long-running agent

It's possible to pass the project key and url to the dashboard while using the long-running agent process, where multiple projects get access to Testcontainers Cloud.

To do so, you need to add labels directly to containers spawned by tests:

cloud.testcontainers.tcc.project.key=your-project-key
cloud.testcontainers.tcc.project.url=https://your.project.url.com/
At this stage, the first label of that kind will be considered for the entire test session, until the IDLE timeout resets the worker.
 
Restrictions
Please be aware, that the project key allows only alphanumeric characters (both cases) and symbols -_. (dash, underscore, dot). The length is limited to 100. Characters that exceed the length will be trimmed and those not matching rules are replaced with underscore.
An invalid URL will be replaced with an empty string.