Testing Your Changes FAQ
How do I test changes to the Autotest codebase itself?
Often times when making changes to the Autotest codebase itself, it is difficult to test your change unless you can actually run an instance of the Autotest server locally.
To quickly get functional Autotest server setup please refer to: Setup Autotest Server
Reasons to run a local Autotest server might include:
- Autotest Scheduler work
- Adding or changing RPCs
- Tests that involve common library changes
- GUI/
GWT Frontend work.
How do I test changes to the dynamic_suite infastructure?
You'll definitely want a locally-running Autotest server. For most changes, you
will want to start by running the unit tests in server/
- site_utils/
run_suite.py - cli/
atest create_suite_job - server/
autoserv test_suites/ dev_harness.py
In the first two cases, there are a variety of command line options and arguments that allow you to set the build and platform to test, etc. These pathways will always stage a build (if necessary), pull control files from that build, reimage devices and run the desired test suite.
dev_harness.py does not pull control files from a particular build, but rather uses your local source tree. If you're trying to test changes to suite control files, for example, this is probably the best way to go. It can also be configured to skip reimaging, so you can iterate faster. dev_harness.py is pulled in and executed directly by autoserv, so it can't take command line args. Instead, it's configured using a file called dev_harness_conf that lives adjacent to dev_harness.py.
What's the fast way to make a change to a test and iterate to see if it now works?
The fastest way to develop a test is to not use compiled components in your
test. If you can write a test without cross-compiling code you can modify the
test in python/
Assuming you have done this, on the target device's console, su to root. Then
enter the /home/
**```none
on_device# cd /home/
If you have modified cross-compiled test code, you can use the above
instructions but you'll be rebuilding a lot of stuff you don't need. Instead of
running build_platform --withautotest, you can instead just run
build_autotest.sh directly (which it calls). This emerges the autotest
cross-compiled binaries. You can also specify precisely which test you want to
rebuild to avoid having to build everything (and wait for it all to finish):
**```none
inside# ./build_autotest.sh --board=${BOARD} --build=storage_Fio,system_SAT
```**
**The resulting binaries will be placed in your chroot under
`${CHROOT}/build/${BOARD}/usr/local/autotest`. They are not installed into an
image at this time. Instead, autotest will copy them over when you run
run_remote_tests.sh.**
## **What's the fast way to see if a test now works with tip of tree?**
The best way is to prepare a CL and test it using
[trybots](/chromium-os/developer-library/guides/development/local-trybot-documentation).