summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-05-27patman: Use git to set up the test configSimon Glass
At present the branch information is dropped when writing the configuration. It is easier to get git to set up the config anyway, so update the test to do this. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Clean up creation of the git treeSimon Glass
The test starts with the HEAD pointing to the wrong place, so that the created files appear to be deleted. Fix this by resetting the tree before tests start. Add a check that the tree is clean. Update pygit2 so that the enums are available.
2025-05-27patman: Use variables for series ID and titleSimon Glass
Rather than hard-coding these values in the sample patches, use variables so that we can refer to these in tests. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Use .git as the git directorySimon Glass
In tests, the 'git' directory is a subdirectory of the temporary directory. Rename it to '.git' so that git will automatically find it when git operations are done in the temporary directory. Set up the config before the first git operation, so that this works correctly. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Use itr instead of lines for iteratorSimon Glass
The variables 'lines' is used to hold a list of output lines within a test, but also to hold an iterator through those lines. Use 'itr' for the latter, to avoid confusion. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Correct use of str in codeSimon Glass
Since str() is a reserved function we should not use it as a variable. Fix this in the send module. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Allow setting a git directory when sendingSimon Glass
Support specifying the git-directory when creating and sending patches. This will allow better testing of this functionality, since we can use a test directory. For count_commits_to_branch() support an end commit while we are here. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Allow setting the current directory when sendingSimon Glass
Plumb a current-working-directory (cwd) through from send all the way to the command gitutil libraries. This will allow better testing of this functionality, since we can use a test directory. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Add all files to __init__.pySimon Glass
Some files are missing from the __all__ list, so add then. Reformat the list to use more of the width of each line. Signed-off-by: Simon Glass <[email protected]>
2025-05-27u_boot_pylib: Speed up determining the upstream branchSimon Glass
Use --decorate to quickly detect the upstream branch, since this is much faster than using 'git name-rev' on every possible commit. Signed-off-by: Simon Glass <[email protected]>
2025-05-27u_boot_pylib: Provide directories to gitutil functionsSimon Glass
For testing it is useful to be able to set the current directory used for git operations, as well as the git-repo directory. Update some of the functions to support this. Signed-off-by: Simon Glass <[email protected]>
2025-05-27u_boot_pylib: Tidy up quoting of cc and toSimon Glass
The current approach to calling 'git send-email' puts double quotes around each email address to ensure that it will pass the shell correctly. This is a bit cumbersome and requires using a shell to sort it all out. Drop the quotes and use command.run() instead, to simplify things. This will also make it possible to (later) set the current directory. Signed-off-by: Simon Glass <[email protected]>
2025-05-27u_boot_pylib: Support a fatal level in toutSimon Glass
It is convenient to be able to print a message and exit. Add a new 'fatal' level to support this. Update some assumptions about the level, so that the tools continue to work as now. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Update Series.ShowActions() to pass aliasSimon Glass
Instead of using settings.alias pass this value in. This allows tests to work without using settings.alias Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Pass aliases to Series.MakeCcFile()Simon Glass
Rather than accessing settings directly, pass the aliases in, so that we can do the same from tests. With further work this will allow the tests to work without using settings.alias Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Pass the alias dict into gitutil.email_patches()Simon Glass
Rather than accessing the settings module in this function, require the alias dict to be passed in. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Pass the alias dict into gitutil.build_email_list()Simon Glass
Rather than accessing the settings module in this function, require the alias dict to be passed in. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Untangle settings from gitutilSimon Glass
The gitutil module is supposed to be independent from patman but one piece was missed in the series which separated them. Move the settings setup out of gitutil Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Drop the old status codeSimon Glass
Now that we have the new asyncio implementation, drop the unused ThreadPoolExecutor code. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Use a pager when outputting statusSimon Glass
The pager makes it easier to review large number of comments. Add it around the output. Patman normally sends multiple concurrent requests to the patchwork server, as this is faster. Provide an option to disable this. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Provide an option to run in single-threaded modeSimon Glass
Patman normally sends multiple concurrent requests to the patchwork server, as this is faster. Provide an option to disable this. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Switch over to asyncioSimon Glass
Now that all the pieces are in place, switch over from using an executor to using asyncio. While we are here, import defaultdict to avoid needing to specify its module. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Use defaultdict directlySimon Glass
Import defaultdict to avoid needing to specify its module in multiple places. Fix an extra blank line while here. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Add more information to PatchSimon Glass
The cover letter has some information on each patch, so allow this to be stored in the Patch object. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Show patches in yellowSimon Glass
When comments are shown below patches it can be hard to see the patch subject. Use yellow instead of blue, since it stands out better. Pass the colour object into show_responses() rather than creating a new one, since that is tidier. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Simplify test_find_new_responses()Simon Glass
This test uses the find_new_responses() function which combines accessing patchwork and processing the results. Since the test is aimed at testing processing, adjust it to call process_reviews() instead. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Adjust how the fake request() function is providedSimon Glass
Instead of passing the URL and function to each call, put the fake into the Patchwork object instead. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Split out the processing of find_new_responses()Simon Glass
This function does patchwork calls and then processes the results. Move the processing out so we can (later) test it separately. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Split up check_and_show_status()Simon Glass
This function has three phases: - collecting things from patchwork - doing some processing - showing the results to the user / creating a branch Refactor into two functions so we can eventually have the patchwork part fully separated out. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Rename check_patchwork_status()Simon Glass
This function actually shows the status and does some other things. Rename it to better reflect its purpose. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Add reading of series and patch statusSimon Glass
Expand the patchwork module so that it can match the current requirements of the 'patman status' command, i.e. reading the state of a series and the patches associated with it. Since the format of each patchwork response is a little tricky to understand, add examples in comments at the top of each function. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Move Patch and Review to patchwork moduleSimon Glass
These relate to information obtained from the patchwork server, so move their definition into the new patchwork module. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Create a module for handling patchworkSimon Glass
At present the patchwork implementation is very simple, just consisting of a function which calls the REST API. We want to create a fake patchwork for use in tests. So start a new module to encapsulate communication with the patchwork server. Use asyncio since it is easier to handle lots of concurrent requests from different parts of the code. Signed-off-by: Simon Glass <[email protected]>
2025-05-27CI: Add a dependency file for patmanSimon Glass
Now that patman has an unusual dependency, add a requirements.txt file and use it in CI Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Move code for sending into its own moduleSimon Glass
The control module includes much of the implementation of patman's 'send' feature. As a first step to separating this out, move the sending code into its own file. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Support extra test featuresSimon Glass
Provide support for the -X flag, which preserves the working directory used by tests. Also support -N which shows captured output for tests. Finally, allow selection of a particular test to run. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Tidy up the start-up codeSimon Glass
Much of this was written before the other Python tools and they have evolved. Make a few updates: - Rather than calling sys.exit(), return the exit code from the control module and use it in __main__ - Set up tout as it is used in some places - We now have quite a few tests, so update the comment about that Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Rename test_basic() in test_checkpatchSimon Glass
This currently has the same name as a test in func_test.py so it isn't possible to select one or the other with 'patman test test_basic': both are executed. Rename this one to avoid confusion. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Correct a stray quoteSimon Glass
A quote character was added a few years ago, but was not intended. Drop it. Signed-off-by: Simon Glass <[email protected]>
2025-05-27tools: Plumb in capture controlSimon Glass
Add control of capturing output into u_boot_pylib and the tools which use it. Signed-off-by: Simon Glass <[email protected]>
2025-05-27u_boot_pylib: Allow disabling colour outputSimon Glass
When running tests there is no situation in which we want ANSI output as it makes it much harder to see what is going on in logs, tests, etc. Provide a way to disable this. Signed-off-by: Simon Glass <[email protected]>
2025-05-27u_boot_pylib: Avoid concurrent execution of only one testSimon Glass
There is no point in spinning up multiple processes if there is only one test to execute. Add a check for this. Signed-off-by: Simon Glass <[email protected]>
2025-05-27u_boot_pylib: Add a pagerSimon Glass
It is useful to have a pager when outputting a lot of text. Add support for this in the terminal library, making use of a context manager. Also add a function to indicate whether the output device is a terminal or not, while we are here, to avoid duplicating this code. Signed-off-by: Simon Glass <[email protected]>
2025-05-27u_boot_pylib: Improve ANSI-colour output with backgroundsSimon Glass
The current implementation does not handle background colours very well: - It outputs an incorrect code in some cases, leading to wrong colours - Some functions lack a control for the background Tidy this up so that background colours can be used in more places. Signed-off-by: Simon Glass <[email protected]>
2025-05-27u_boot_pylib: Allow control of capturingSimon Glass
Tests often capture output so they can check it. This means that if the test fails it is not easy to see what the output actually was. Add a -N flag which writes out the output after it has been captured. This is not a perfect solution but it is simple and seems to work well in practice. Signed-off-by: Simon Glass <[email protected]>
2025-05-27binman: Correct a typo in the toolpath commentSimon Glass
Fix the 'ist' typo in the comment for TestFunctional Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Move capture_sys_output() into terminal and renameSimon Glass
This function is sometimes useful outside tests. Also it can affect how terminal output is done, e.g. whether ANSI characters should be emitted or not. Move it out of the test_util package and into terminal. Signed-off-by: Simon Glass <[email protected]>
2025-05-27patman: Move all non-test logic into control moduleSimon Glass
It is easier for tests if the top-level control logic is all in one module. Create a new do_patman() function to handle this. Move the existing code into it. Signed-off-by: Simon Glass <[email protected]>
2025-05-27binman: x86: Write skip-at-start when end-at-4gb is usedSimon Glass
The end-at-4gb property implies a value for skip-at-start so add it into the output FDT so that U-Boot can read it. Now that skip-at-start is implemented, we can drop the workarounds used in the x86 code to obtain the correct image-pos value. Signed-off-by: Simon Glass <[email protected]>
2025-05-27binman: Read the skip-at-start value on startupSimon Glass
This value provides an offset for all image-pos values in the image. Read it on startup so that we can take account of it when calculating positions. Signed-off-by: Simon Glass <[email protected]>