This folder contains unit and functional (integration with backend) tests for Local Agent.
You'll have to install the extra packages to run the tests:
$ source <venv-name>/bin/activate $ cd /path/to/{repo-base}/local-agent $ pip install .[test]
Run all the unit tests and show the coverage report.
cd /path/to/{repo-base}/local-agent/local_agent/tests/unit_tests/ coverage run --source={LOCAL_AGENT_PACKAGE_PATH}/local_agent/ -m unittest discover && coverage reportwhere {LOCAL_AGENT_PACKAGE_PATH} can be obtained by the following command:
$ pip show local-agent | grep -e "^Location" | awk -F " " '{print $2}'
Important
: If you‘re NOT an internal Googler or tester, you won’t be able to run this test.
Run the local agent with a real Test Suite Backend (AMS).
Backend setup: If you‘re an internal Googler or tester, please contact the local agent author for the backend deployment; Otherwise, you won’t be able to deploy the backend.
Edit the local agent config file: filling the AMS_HOST
and AMS_PORT
fields with the AMS configurations. Contact the local agent author if you're not sure about the backend configurations. See example_config.ini
for references.
Activate the virtual environment.
Connect your Matter devices with the above mentioned testabilities to the host machine. (You can still run the AMS test without connecting any devices).
Start the fake front end process
Use -host [tsb_host]
and -port [tsb_port]
to indicate the host and port of deployed backend, the fake front end will use host=localhost
and port=8000
if the arguments are not provided.
For example:
Run with real devices
python fake_front_end.py
Start the local agent process:
local-agent -u [config file location]
or just put the config under ~/.config/google/local_agent_config.ini
, then start the process parameterlessly:
local-agent
The Local Agent should prompt the user for entering the linking code, which is displayed in the console of fake_front_end
process.