version:rudder/v1kind:transformationmetadata:name:my-python-transformationspec:id:my-python-transformationname:My Python Transformationdescription:Tag each incoming event with a processing timestamplanguage:pythonfile:python/my-python-transformation.pytests:- name:Basic payload testinput:./tests/inputoutput:./tests/output
For library resources, import_name must be the camelCase form of name. For example, name: my library maps to import_name: myLibrary and name: my python library maps to import_name: myPythonLibrary.
5. Validate YAML and code references
Run validation from the project root:
rudder-cli validate -l ~/tutorial-transformations
This command validates required fields, code/file rules, supported languages, code syntax, and test definitions.
6. Test transformations locally
Rudder CLI supports 3 test modes:
You cannot include multiple test modes in a single command.
Test a specific transformation by ID:
rudder-cli transformations test my-transformation -l ~/tutorial-transformations
Test all transformations:
rudder-cli transformations test --all -l ~/tutorial-transformations
Test only new or modified transformations:
rudder-cli transformations test --modified -l ~/tutorial-transformations
Optional
Show detailed failures and diffs:
rudder-cli transformations test --all --verbose -l ~/tutorial-transformations
Show the built-in default events:
rudder-cli transformations test default-events --show
How it works
When running tests, Rudder CLI loads input files from each test suite’s input path. If a matching output file (same filename) exists in the output path, it compares the actual output against the expected output. If no matching output file exists, the test still runs but skips the output comparison.
Rudder CLI tests the transformation using default RudderStack events if:
spec.tests isn’t configured, or
No input JSON files are found in the configured input paths
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.