{"thread":{"id":"62401","subject":"[Outreachy][proposal]: Convert unit tests to use the Clar testing framwork","startedAt":"2024-10-23T21:46:04Z","lastAt":"2024-10-28T08:28:06Z","messageCount":7,"participants":["Samuel Abraham","Patrick Steinhardt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"505986","messageId":"CADYq+fZBGZiTQduQ+4KcQ7H2Hysb04pg8YR++8PWAkQOM76OPg@mail.gmail.com","threadId":"62401","inReplyTo":null,"subject":"[Outreachy][proposal]: Convert unit tests to use the Clar testing framwork","fromName":"Samuel Abraham","fromEmail":"abrahamadekunle50@gmail.com","sentAt":"2024-10-23T21:45:52Z","receivedAt":"2024-10-23T21:46:04Z","isPatch":false,"sender":{"key":"abrahamadekunle50@gmail.com","avatar":"https://avatars.githubusercontent.com/u/110066922?v=4"},"body":"Hello Git Community,\n\n\nI hope this mail finds you well.\n\nI am Abraham Samuel, participating in the Outreachy internship program\nand I write to express my delight, enthusiasm and interest in working\non the project “Convert unit test to use the Clar testing framework”.\n\nMy first exposure to Git started with the book “Learn Enough Git to Be\nDangerous” which taught me the basics of using Git for version control\nand collaborations and I felt truly dangerous :-).\n\n\nI am passionate about FOSS and now that I am presented with the\nopportunity to contribute to Git, It is indeed a great opportunity to\nunderstand what happens under the hood and I have never been happier.\n\n\n## Introduction:\n\nI completed my ALX Software Engineering program in 2023 and I have\nbeen engaged in various software development projects, open source\ndevelopment and various personal projects, providing me with valuable\ntechnical and collaborative skills.\n\n\n## Project Overview - Convert unit test to use the Clar testing framework:\n\nI understand that the Git project is in the process of converting its\nunit tests to the Clar testing framework to improve test readability,\nconsistency and maintainability, a move away from homegrown unit test\nframeworks such as t/helper/test-tool.h and t/unit-test/test-lib.h.\n\nClar provides a structured and efficient way to write and execute\ntests and is well-suited for a project like Git where robust testing\nis essential to maintain quality and stability.\n\n\n## Contribution to the Git Community:\n\nI have participated in contributions to Git’s codebase after getting\naccepted into the Outreachy contribution phase in October 2024,\nworking on what I found doable and within my reach. Below is the list\nof my contributions:\n\n- [PATCH v4] t7300-clean.sh: use test_path* helper functions for error logging.\n\nList thread: https://lore.kernel.org/git/pull.1811.v4.git.1728498122419.gitgitgadget@gmail.com/\n\nStatus: merged into master\n\nMerge Commit: 77af53f56f100b49fdcf294f687b36064d16feca\n\nDescription: The patch converted instances of  “test - [def]” in test\ncases to test_path_* functions to get error logs when the test case\nfails when testing for the existence of a file or directory after “git\nclean” or “git clean -d” is called as the case may be.\n\n\n\n- [PATCH v4] notes: teach the -e option to edit messages in the editor\n\nStatus: integrated into Seen\n\nList thread: https://lore.kernel.org/git/pull.1817.git.1729296853800.gitgitgadget@gmail.com/\n\nDescription: The patch worked on a #leftover bit which added the “-e”\noption to “git notes add” and “git notes append” subcommands when the\nmessage is supplied with the -F and/or -m options. The patch enables\nfine-tuning the message by invoking the user’s default editor\nprefilling the message in the editor to allow editing the message to\nthe required taste before adding the note to the commit\n\n\n## Project Plan:\n\nThe first steps to migrating existing tests to Clar would be studying\nexisting tests in the t/helper and t/unit-tests directory which will\nenable me to determine those appropriate for conversion.\n\nLiaise with mentors and community members to determine the viability\nof converting the selected test for conversion.\n\nConvert the selected test to Clar while in constant effective\ncommunication with the mentors and Git community, implementing\nfeedback and review suggestions.\n\nProperly test converted scripts to ensure validity and correctness.\n\nSteps to converting the existing unit tests to the Clar Testing Framework\n\n From the project description in the Outreachy Project Description page,\n\n\nhttps://www.outreachy.org/outreachy-dec-2024-internship-cohort/communities/git/#convert-unit-tests-to-use-the-clar-testing-framewo,\nthe goal is to convert all Git’s existing unit tests to use the Clar\ntesting framework exclusively.\n\n\nThe existing unit tests which would need to be converted to Clar are;\n\n.c test files present in t/unit-tests: Tests in this directory use the\nt/unit-tests/test-lib testing framework and are “.c” scripts,\nconverted from the shell-based testing which used the tests in\nt/helper/ and corresponding t<number>-<name>.sh test files. Examples\nof this conversion can be seen in the link below which references Achu\nLuma’s work\n\nhttps://lore.kernel.org/git/20240226143350.3596-1-ach.lumap@gmail.com/.\n\n\nThe link shows the work done in converting the test from\nt/helper/test-sha1.c and test/helper/test-sha256.c to use\nt/unit-tests/t-hash.c which uses the t/unit-tests/test-lib.h framework\n\n\nThe steps to convert files located in this directory include;\n\n- Identify the test files to be converted.\n\nExamples of such files are the t/unit-tests/t-hash.c, t/unit-tests/t-strbuf.c\n\n- Rename the test file from t-<name>.c to <name>.c. This pattern\nfollows the style used by Patrick Steinhardt in his conversion of the\nt-strvec.c and t-ctype.c files to use the clar framework.\n\nhttps://lore.kernel.org/git/604303e31aad3a9e74f7bdddc84f11d4d137c864.1725459142.git.ps@pks.im/\nand\n\nhttps://lore.kernel.org/git/ba05b9f1eef8136e087846ee54a076558097a240.1725459142.git.ps@pks.im/\n\nAs a sample demonstration, we will convert the t/unit-tests/t-hash.c\nto use Clar.\n\n- Add the module name CLAR_TEST_SUITE variable in the MAKE file.\n\n  CLAR_TEST_SUITE += hash\n\nThe next steps will typically involve writing optional setup and\ncleanup functions with the signature “void\ntest_<suitename>__initialize(void)” and void\ntest_<suite_name>__cleanup(void) and the actual tests also with the\nsignature\n\nvoid test_<suitname>__<testname>(void) and the Clar methods such as\ncl_assert(), cl_assert_equal_s(), cl_assert_equal_i() etc can be used\nto verify the results against the expected.\n\n\n The sample hash.c will have contents as follows\n--\n#include “unit-test.h”\n\n#include “hex.h”\n\n#include “strbuf.h”\n\nstatic struct strbuf aaaaaaaaaa_100000 = STRBUT_INIT;\n\n static struct strbuf alphabet_100000 = STRBUF_INIT;\n\n// Setup function for the suite\n\nvoid test_hash__initialize(void)\n\n{\n\nstrbuf_addstrings(&aaaaaaaaaa_100000, “aaaaaaaaaa”, 100000);\n\nstrbuf_addstrings(&aaaaaaaaaa_100000, “abcdefghijklmnopqrstuvwxyz”,100000);\n\n}\n\n\n// Teardown function for the suite\n\nvoid test_hash__cleanup(void)\n\n{\n\nstrbuf_release(&aaaaaaaaaa_100000);\n\nstrbuf_release(&alphabet_100000);\n\n}\n\n\nstatic void check_hash_data_clar(const void *data, size_t data_lenght,\nconst char *expected_hashes[])\n\n{\n\ncl_assert(data != NULL);\n\nfor (size_t i = 1, i < ARRAY_SIZE(hash_algos); i++) {\n\ngit_hash_ctx ctx;\n\nunsigned char hash[GIT_MAX_HEXSZ];\n\nconst struct git_hash_algo *algop = &hash_algos[i]\n\nalgop->init_fin(&ctx);\n\nalgop->update_fn(&ctx, data, data_length);\n\nalgop->final_fn(hash, &ctx);\n\n\ncl_assert_equal_s(hash_to_hex_algop(hash, algop), expected_hashes[i - 1])\n\n}\n\n}\n\n\n// Sample Test\n\nvoid test_hash__empty_string(void)\n\n{\n\nconst char *expected_hashes[] = {\n\n“da39a3ee5e6b4b0d3255bfe95601890afd80709”,\n\n“e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855”\n\n};\n\ncheck_hash_data_clar(“”, strlen(“”), expected_hashes);\n\n}\n\n\n// test that uses variables set by the set-up method\n\nvoid test_hash__large_aaaaa(void)\n\n{\n\nconst char *expected hashes[] = {\n\n“34aa973cd4c4daa4f61eeb2bdbad27316534016f”,\n\n“cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39cc7112cd0”\n\n  };\n\ncheck_hash_data_clar(aaaaaaaaaa_100000.buf, aaaaaaaaaa_100000.len,\nexpected_hashes);\n\n}\n--\nThe test methods are then added to the t/unit-tests/clar-decls.h\nincluded in the unit-test.h file\n\nThe test can then be run with “make unit-tests” or\n./t/unit-tests/bin/unit-tests.\n\n While the sample above does not fully contain all the cases I\nconverted, below is the sample output I got.\n\n...\n# start of suite 3: hashes\n\nok 37 - hashes::empty_string\n\nok 38 - hashes::single_a\n\nok 39 - hashes::abc_string\n\nok 40 - hashes::message_digest\n\nok 41 - hashes::large_aaaaa\n\nok 42 - hashes::alphabet_large\n\nok 43 - hashes::literal_blob_0\n\nok 44 - hashes::literal_blob_3abc\n\n1..44\n\n\nThe test scripts in the t/helper directory:\n\nThe tests in this directory are invoked by the corresponding shell\nscripts which spawn processes to test the different unit tests in the\nt/helper directory.\n\nThe process involved in converting these shell scripts to Clar\nframework will typically follow the same steps as illustrated above\nbar the following differences.\n\nIdentifying the tests to be converted to Clar\n\nCreate a new .c  file name which should be named appropriately to\nillustrate what the file is testing.\n\nHowever, the shell-based script which tests the functions in t/helper\nwill be studied for in-depth understanding and then refactored into a\n.c file which follows the steps above in converting to use Clar.\n\n\nProject Timeline:\n\nCommunity Bonding (Present - November 26):\n\nContinue making contributions to the Git codebase working on different\nthings within my capacity and getting more familiar with the codebase,\nparticipating in patches review.\n\nConversion of tests begins (December 9 - December 23): Familiarize me\nwith the conversion process to further enhance my understanding,\nidentify files for conversion and start the conversion process, and\nset up a blog for weekly updates on my conversion process.\n\nImplementation of community and mentor reviews (December 27 - January 31):\n\nContinue with conversions while testing converted tests, communicating\nwith reviewers and implementing reviews.\n\nTesting (February 1 - March 1): Continuously determine the correctness\nof the converted tests by continuously testing and also liaising with\nmentors constantly.\n\n\n\nAvailability:\n\n I am not currently enrolled in any academic program or have any jobs,\nand will be available to work on the project for a minimum of 45 hours\nper week.\n\n\nAfter the Internship:\n\nThe Git community fosters proper and effective communication,\nregardless of one’s level of experience. The patience, guidance and\nexplanation of technical concepts shown by community members are\nwonderful and this has made me grow not just technically but also\nbehaviorally. Due to this, I plan to continue actively participating\nthe in Git community and be part next generation of those saddled with\nsustaining this great project and preserving its legacy.\n\n\nI look forward to reviews as regards my proposal.\n\n\nA special appreciation to everyone on the mailing list for reviewing my patches.\nMy mentors Patrick and Phillip, Junio, Eric, Christian, Brian,\nKristoff, Taylor, and Josh.\n\nI am grateful to you all.\n\nThanks\n\nAbraham Samuel.\n"},{"id":"506098","messageId":"ZxttGFtt5nnc7g9Z@pks.im","threadId":"62401","inReplyTo":"CADYq+fZBGZiTQduQ+4KcQ7H2Hysb04pg8YR++8PWAkQOM76OPg@mail.gmail.com","subject":"Re: [Outreachy][proposal]: Convert unit tests to use the Clar testing framwork","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-25T10:04:13Z","receivedAt":"2024-10-25T10:04:23Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Oct 23, 2024 at 10:45:52PM +0100, Samuel Abraham wrote:\n\nThanks for your application!\n\n> ## Project Overview - Convert unit test to use the Clar testing framework:\n> \n> I understand that the Git project is in the process of converting its\n> unit tests to the Clar testing framework to improve test readability,\n> consistency and maintainability, a move away from homegrown unit test\n> frameworks such as t/helper/test-tool.h and t/unit-test/test-lib.h.\n\nNit: we've basically moved away from test-tool for unit tests already,\nto the best of my knowledge. So this is more about the second part,\nmoving away from our own test framework.\n\n> Clar provides a structured and efficient way to write and execute\n> tests and is well-suited for a project like Git where robust testing\n> is essential to maintain quality and stability.\n\nIt would be nice to provide some pointers _why_ we think that clar is\nbetter suited ;) Hint: you may have a look at the patch series that\nintroduced the clar for some ideas there.\n\n[snip]\n> ## Project Plan:\n\nFormatting of this section is a bit funky, which makes it harder than\nnecessary to figure out which parts belong together. I'd propose to\nfirst provide a high-level list of the steps you want to do with a\nbulleted list and then maybe put more detailed explanations into\nseparate \"### subsections\". You may also want to convert links to use\n[Markdown syntax](https://www.markdownguide.org/basic-syntax/#links),\nwhich provides some structure aronud them.\n\n> The first steps to migrating existing tests to Clar would be studying\n> existing tests in the t/helper and t/unit-tests directory which will\n> enable me to determine those appropriate for conversion.\n> \n> Liaise with mentors and community members to determine the viability\n> of converting the selected test for conversion.\n> \n> Convert the selected test to Clar while in constant effective\n> communication with the mentors and Git community, implementing\n> feedback and review suggestions.\n> \n> Properly test converted scripts to ensure validity and correctness.\n> \n> Steps to converting the existing unit tests to the Clar Testing Framework\n> \n>  From the project description in the Outreachy Project Description page,\n> \n> \n> https://www.outreachy.org/outreachy-dec-2024-internship-cohort/communities/git/#convert-unit-tests-to-use-the-clar-testing-framewo,\n> the goal is to convert all Git’s existing unit tests to use the Clar\n> testing framework exclusively.\n\nIt might also make sense to plan some time to add missing features to\nthe clar if we hit anything during the conversion.\n\n> The existing unit tests which would need to be converted to Clar are;\n> \n> .c test files present in t/unit-tests: Tests in this directory use the\n> t/unit-tests/test-lib testing framework and are “.c” scripts,\n> converted from the shell-based testing which used the tests in\n> t/helper/ and corresponding t<number>-<name>.sh test files. Examples\n> of this conversion can be seen in the link below which references Achu\n> Luma’s work\n> \n> https://lore.kernel.org/git/20240226143350.3596-1-ach.lumap@gmail.com/.\n> \n> \n> The link shows the work done in converting the test from\n> t/helper/test-sha1.c and test/helper/test-sha256.c to use\n> t/unit-tests/t-hash.c which uses the t/unit-tests/test-lib.h framework\n> \n> \n> The steps to convert files located in this directory include;\n> \n> - Identify the test files to be converted.\n> \n> Examples of such files are the t/unit-tests/t-hash.c, t/unit-tests/t-strbuf.c\n> \n> - Rename the test file from t-<name>.c to <name>.c. This pattern\n> follows the style used by Patrick Steinhardt in his conversion of the\n> t-strvec.c and t-ctype.c files to use the clar framework.\n> \n> https://lore.kernel.org/git/604303e31aad3a9e74f7bdddc84f11d4d137c864.1725459142.git.ps@pks.im/\n> and\n> \n> https://lore.kernel.org/git/ba05b9f1eef8136e087846ee54a076558097a240.1725459142.git.ps@pks.im/\n> \n> As a sample demonstration, we will convert the t/unit-tests/t-hash.c\n> to use Clar.\n\nI think the previous explanations are sufficient -- going into the\ntechnical details like you do below is appreciated, but ultimately not\nnecessary in my opinion. What I'm after here is that you have a rough\nunderstanding of what needs to be done for each of the tests, and that\nis sufficiently demonstrated by a high-level explanation.\n\n> The test scripts in the t/helper directory:\n> \n> The tests in this directory are invoked by the corresponding shell\n> scripts which spawn processes to test the different unit tests in the\n> t/helper directory.\n> \n> The process involved in converting these shell scripts to Clar\n> framework will typically follow the same steps as illustrated above\n> bar the following differences.\n> \n> Identifying the tests to be converted to Clar\n> \n> Create a new .c  file name which should be named appropriately to\n> illustrate what the file is testing.\n> \n> However, the shell-based script which tests the functions in t/helper\n> will be studied for in-depth understanding and then refactored into a\n> .c file which follows the steps above in converting to use Clar.\n\nAs mentioned above, I thought we didn't have any such tests anymore. If\nwe do, it might make sense to provide an example of such a thing that\nneeds to be converted.\n\n> Project Timeline:\n> \n> Community Bonding (Present - November 26):\n> \n> Continue making contributions to the Git codebase working on different\n> things within my capacity and getting more familiar with the codebase,\n> participating in patches review.\n> \n> Conversion of tests begins (December 9 - December 23): Familiarize me\n> with the conversion process to further enhance my understanding,\n> identify files for conversion and start the conversion process, and\n> set up a blog for weekly updates on my conversion process.\n\nMakes sense.\n\n> Implementation of community and mentor reviews (December 27 - January 31):\n> \n> Continue with conversions while testing converted tests, communicating\n> with reviewers and implementing reviews.\n> \n> Testing (February 1 - March 1): Continuously determine the correctness\n> of the converted tests by continuously testing and also liaising with\n> mentors constantly.\n\nFor this one here'd I'd recommend to start more iteratively. What you\nhave here sounds a bit like a waterfall model, where you first convert\nall tests and then eventually test and send things over to the mailing\nlist.\n\nIn the Git community you will likely have more success if you work in\nsmaller patches. E.g. pick a small set of tests to convert, convert\nthem, polish the series and then send it to the mailing list. That cycle\nwould then repeat several times until you have converted all of the\ntests.\n\n> Availability:\n> \n>  I am not currently enrolled in any academic program or have any jobs,\n> and will be available to work on the project for a minimum of 45 hours\n> per week.\n\nYou really shouldn't be working more than 40 hours per week ;) The\n[Outreachy Internship Guide](https://www.outreachy.org/docs/internship/)\nrecommends 30 hours per week, and I don't expect any more of you,\neither.\n\nOther than that this document looks good to me, thanks!\n\nPatrick\n"},{"id":"506102","messageId":"CADYq+fZeTDnpsvBenLV6GHz5vBRW0nwcmWqQ4kvpNd5LocPRow@mail.gmail.com","threadId":"62401","inReplyTo":"ZxttGFtt5nnc7g9Z@pks.im","subject":"Re: [Outreachy][proposal]: Convert unit tests to use the Clar testing framwork","fromName":"Samuel Abraham","fromEmail":"abrahamadekunle50@gmail.com","sentAt":"2024-10-25T13:22:31Z","receivedAt":"2024-10-25T13:22:42Z","isPatch":false,"sender":{"key":"abrahamadekunle50@gmail.com","avatar":"https://avatars.githubusercontent.com/u/110066922?v=4"},"body":"On Fri, Oct 25, 2024 at 11:04 AM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Wed, Oct 23, 2024 at 10:45:52PM +0100, Samuel Abraham wrote:\n>\n> Thanks for your application!\n>\n> > ## Project Overview - Convert unit test to use the Clar testing framework:\n> >\n> > I understand that the Git project is in the process of converting its\n> > unit tests to the Clar testing framework to improve test readability,\n> > consistency and maintainability, a move away from homegrown unit test\n> > frameworks such as t/helper/test-tool.h and t/unit-test/test-lib.h.\n>\n> Nit: we've basically moved away from test-tool for unit tests already,\n> to the best of my knowledge. So this is more about the second part,\n> moving away from our own test framework.\n\nThank you very much for the clarity.\n>\n> > Clar provides a structured and efficient way to write and execute\n> > tests and is well-suited for a project like Git where robust testing\n> > is essential to maintain quality and stability.\n>\n> It would be nice to provide some pointers _why_ we think that clar is\n> better suited ;) Hint: you may have a look at the patch series that\n> introduced the clar for some ideas there.\n\nOkay I will do that.\n\n>\n> [snip]\n> > ## Project Plan:\n>\n> Formatting of this section is a bit funky, which makes it harder than\n> necessary to figure out which parts belong together. I'd propose to\n> first provide a high-level list of the steps you want to do with a\n> bulleted list and then maybe put more detailed explanations into\n> separate \"### subsections\". You may also want to convert links to use\n> [Markdown syntax](https://www.markdownguide.org/basic-syntax/#links),\n> which provides some structure aronud them.\n\nOkay thank you for this.\n>\n> > The first steps to migrating existing tests to Clar would be studying\n> > existing tests in the t/helper and t/unit-tests directory which will\n> > enable me to determine those appropriate for conversion.\n> >\n> > Liaise with mentors and community members to determine the viability\n> > of converting the selected test for conversion.\n> >\n> > Convert the selected test to Clar while in constant effective\n> > communication with the mentors and Git community, implementing\n> > feedback and review suggestions.\n> >\n> > Properly test converted scripts to ensure validity and correctness.\n> >\n> > Steps to converting the existing unit tests to the Clar Testing Framework\n> >\n> >  From the project description in the Outreachy Project Description page,\n> >\n> >\n> > https://www.outreachy.org/outreachy-dec-2024-internship-cohort/communities/git/#convert-unit-tests-to-use-the-clar-testing-framewo,\n> > the goal is to convert all Git’s existing unit tests to use the Clar\n> > testing framework exclusively.\n>\n> It might also make sense to plan some time to add missing features to\n> the clar if we hit anything during the conversion.\n\nOkay noted.\n>\n> > The existing unit tests which would need to be converted to Clar are;\n> >\n> > .c test files present in t/unit-tests: Tests in this directory use the\n> > t/unit-tests/test-lib testing framework and are “.c” scripts,\n> > converted from the shell-based testing which used the tests in\n> > t/helper/ and corresponding t<number>-<name>.sh test files. Examples\n> > of this conversion can be seen in the link below which references Achu\n> > Luma’s work\n> >\n> > https://lore.kernel.org/git/20240226143350.3596-1-ach.lumap@gmail.com/.\n> >\n> >\n> > The link shows the work done in converting the test from\n> > t/helper/test-sha1.c and test/helper/test-sha256.c to use\n> > t/unit-tests/t-hash.c which uses the t/unit-tests/test-lib.h framework\n> >\n> >\n> > The steps to convert files located in this directory include;\n> >\n> > - Identify the test files to be converted.\n> >\n> > Examples of such files are the t/unit-tests/t-hash.c, t/unit-tests/t-strbuf.c\n> >\n> > - Rename the test file from t-<name>.c to <name>.c. This pattern\n> > follows the style used by Patrick Steinhardt in his conversion of the\n> > t-strvec.c and t-ctype.c files to use the clar framework.\n> >\n> > https://lore.kernel.org/git/604303e31aad3a9e74f7bdddc84f11d4d137c864.1725459142.git.ps@pks.im/\n> > and\n> >\n> > https://lore.kernel.org/git/ba05b9f1eef8136e087846ee54a076558097a240.1725459142.git.ps@pks.im/\n> >\n> > As a sample demonstration, we will convert the t/unit-tests/t-hash.c\n> > to use Clar.\n>\n> I think the previous explanations are sufficient -- going into the\n> technical details like you do below is appreciated, but ultimately not\n> necessary in my opinion. What I'm after here is that you have a rough\n> understanding of what needs to be done for each of the tests, and that\n> is sufficiently demonstrated by a high-level explanation.\n\nOkay noted.\n>\n> > The test scripts in the t/helper directory:\n> >\n> > The tests in this directory are invoked by the corresponding shell\n> > scripts which spawn processes to test the different unit tests in the\n> > t/helper directory.\n> >\n> > The process involved in converting these shell scripts to Clar\n> > framework will typically follow the same steps as illustrated above\n> > bar the following differences.\n> >\n> > Identifying the tests to be converted to Clar\n> >\n> > Create a new .c  file name which should be named appropriately to\n> > illustrate what the file is testing.\n> >\n> > However, the shell-based script which tests the functions in t/helper\n> > will be studied for in-depth understanding and then refactored into a\n> > .c file which follows the steps above in converting to use Clar.\n>\n> As mentioned above, I thought we didn't have any such tests anymore. If\n> we do, it might make sense to provide an example of such a thing that\n> needs to be converted.\n\nThank you Patrick\nOkay from my understanding, such tests have a .c file in t/helper and\na corresponding t/t-<number>-<name>.sh file.\nFrom my master branch which I study, I can see for example\n   - test-env-helper.c in t/helper and t0017-env-helper.sh\n   - test-find-pack.c in t/helper and t0081-find-pack.sh.\nI concluded since the shell script used to compare the output against\nthe expected still exists\nand no such file names exist in t/unit-tests, I assumed they have not\nbeen ported which is why I listed files\nin t/helper will be converted to clear.\nPlease I will be happy if I can get more clarity, thanks.\n\n>\n> > Project Timeline:\n> >\n> > Community Bonding (Present - November 26):\n> >\n> > Continue making contributions to the Git codebase working on different\n> > things within my capacity and getting more familiar with the codebase,\n> > participating in patches review.\n> >\n> > Conversion of tests begins (December 9 - December 23): Familiarize me\n> > with the conversion process to further enhance my understanding,\n> > identify files for conversion and start the conversion process, and\n> > set up a blog for weekly updates on my conversion process.\n>\n> Makes sense.\n>\n> > Implementation of community and mentor reviews (December 27 - January 31):\n> >\n> > Continue with conversions while testing converted tests, communicating\n> > with reviewers and implementing reviews.\n> >\n> > Testing (February 1 - March 1): Continuously determine the correctness\n> > of the converted tests by continuously testing and also liaising with\n> > mentors constantly.\n>\n> For this one here'd I'd recommend to start more iteratively. What you\n> have here sounds a bit like a waterfall model, where you first convert\n> all tests and then eventually test and send things over to the mailing\n> list.\n>\n> In the Git community you will likely have more success if you work in\n> smaller patches. E.g. pick a small set of tests to convert, convert\n> them, polish the series and then send it to the mailing list. That cycle\n> would then repeat several times until you have converted all of the\n> tests.\n\nYes, my contributions have made me understand this process.\nI will make appropriate adjustments. Thank you\n>\n> > Availability:\n> >\n> >  I am not currently enrolled in any academic program or have any jobs,\n> > and will be available to work on the project for a minimum of 45 hours\n> > per week.\n>\n> You really shouldn't be working more than 40 hours per week ;) The\n> [Outreachy Internship Guide](https://www.outreachy.org/docs/internship/)\n> recommends 30 hours per week, and I don't expect any more of you,\n> either.\n\n>\n> Other than that this document looks good to me, thanks!\n>\n> Patrick\n\nThank you very much Patrick, I appreciate your time. Please I will\nalso like to know if i should send the corrected proposal\nas a mail to the list as I did with this first version.\n\nThanks again for your time.\nAbraham Samuel\n"},{"id":"506109","messageId":"CADYq+faOBCRMS3GiQMuACJ2pLdirnODJBxuJTsR=2QPPpzwo2A@mail.gmail.com","threadId":"62401","inReplyTo":"CADYq+fZeTDnpsvBenLV6GHz5vBRW0nwcmWqQ4kvpNd5LocPRow@mail.gmail.com","subject":"Re: [Outreachy][proposal]: Convert unit tests to use the Clar testing framwork","fromName":"Samuel Abraham","fromEmail":"abrahamadekunle50@gmail.com","sentAt":"2024-10-25T18:56:05Z","receivedAt":"2024-10-25T18:56:17Z","isPatch":false,"sender":{"key":"abrahamadekunle50@gmail.com","avatar":"https://avatars.githubusercontent.com/u/110066922?v=4"},"body":"On Fri, Oct 25, 2024 at 2:22 PM Samuel Abraham\n<abrahamadekunle50@gmail.com> wrote:\n>\n> On Fri, Oct 25, 2024 at 11:04 AM Patrick Steinhardt <ps@pks.im> wrote:\n> >\n> > On Wed, Oct 23, 2024 at 10:45:52PM +0100, Samuel Abraham wrote:\n> >\n> > Thanks for your application!\n> >\n> > > ## Project Overview - Convert unit test to use the Clar testing framework:\n> > >\n> > > I understand that the Git project is in the process of converting its\n> > > unit tests to the Clar testing framework to improve test readability,\n> > > consistency and maintainability, a move away from homegrown unit test\n> > > frameworks such as t/helper/test-tool.h and t/unit-test/test-lib.h.\n> >\n> > Nit: we've basically moved away from test-tool for unit tests already,\n> > to the best of my knowledge. So this is more about the second part,\n> > moving away from our own test framework.\n>\n> Thank you very much for the clarity.\n> >\n> > > Clar provides a structured and efficient way to write and execute\n> > > tests and is well-suited for a project like Git where robust testing\n> > > is essential to maintain quality and stability.\n> >\n> > It would be nice to provide some pointers _why_ we think that clar is\n> > better suited ;) Hint: you may have a look at the patch series that\n> > introduced the clar for some ideas there.\n>\n> Okay I will do that.\n>\n> >\n> > [snip]\n> > > ## Project Plan:\n> >\n> > Formatting of this section is a bit funky, which makes it harder than\n> > necessary to figure out which parts belong together. I'd propose to\n> > first provide a high-level list of the steps you want to do with a\n> > bulleted list and then maybe put more detailed explanations into\n> > separate \"### subsections\". You may also want to convert links to use\n> > [Markdown syntax](https://www.markdownguide.org/basic-syntax/#links),\n> > which provides some structure aronud them.\n>\n> Okay thank you for this.\n> >\n> > > The first steps to migrating existing tests to Clar would be studying\n> > > existing tests in the t/helper and t/unit-tests directory which will\n> > > enable me to determine those appropriate for conversion.\n> > >\n> > > Liaise with mentors and community members to determine the viability\n> > > of converting the selected test for conversion.\n> > >\n> > > Convert the selected test to Clar while in constant effective\n> > > communication with the mentors and Git community, implementing\n> > > feedback and review suggestions.\n> > >\n> > > Properly test converted scripts to ensure validity and correctness.\n> > >\n> > > Steps to converting the existing unit tests to the Clar Testing Framework\n> > >\n> > >  From the project description in the Outreachy Project Description page,\n> > >\n> > >\n> > > https://www.outreachy.org/outreachy-dec-2024-internship-cohort/communities/git/#convert-unit-tests-to-use-the-clar-testing-framewo,\n> > > the goal is to convert all Git’s existing unit tests to use the Clar\n> > > testing framework exclusively.\n> >\n> > It might also make sense to plan some time to add missing features to\n> > the clar if we hit anything during the conversion.\n>\n> Okay noted.\n> >\n> > > The existing unit tests which would need to be converted to Clar are;\n> > >\n> > > .c test files present in t/unit-tests: Tests in this directory use the\n> > > t/unit-tests/test-lib testing framework and are “.c” scripts,\n> > > converted from the shell-based testing which used the tests in\n> > > t/helper/ and corresponding t<number>-<name>.sh test files. Examples\n> > > of this conversion can be seen in the link below which references Achu\n> > > Luma’s work\n> > >\n> > > https://lore.kernel.org/git/20240226143350.3596-1-ach.lumap@gmail.com/.\n> > >\n> > >\n> > > The link shows the work done in converting the test from\n> > > t/helper/test-sha1.c and test/helper/test-sha256.c to use\n> > > t/unit-tests/t-hash.c which uses the t/unit-tests/test-lib.h framework\n> > >\n> > >\n> > > The steps to convert files located in this directory include;\n> > >\n> > > - Identify the test files to be converted.\n> > >\n> > > Examples of such files are the t/unit-tests/t-hash.c, t/unit-tests/t-strbuf.c\n> > >\n> > > - Rename the test file from t-<name>.c to <name>.c. This pattern\n> > > follows the style used by Patrick Steinhardt in his conversion of the\n> > > t-strvec.c and t-ctype.c files to use the clar framework.\n> > >\n> > > https://lore.kernel.org/git/604303e31aad3a9e74f7bdddc84f11d4d137c864.1725459142.git.ps@pks.im/\n> > > and\n> > >\n> > > https://lore.kernel.org/git/ba05b9f1eef8136e087846ee54a076558097a240.1725459142.git.ps@pks.im/\n> > >\n> > > As a sample demonstration, we will convert the t/unit-tests/t-hash.c\n> > > to use Clar.\n> >\n> > I think the previous explanations are sufficient -- going into the\n> > technical details like you do below is appreciated, but ultimately not\n> > necessary in my opinion. What I'm after here is that you have a rough\n> > understanding of what needs to be done for each of the tests, and that\n> > is sufficiently demonstrated by a high-level explanation.\n>\n> Okay noted.\n> >\n> > > The test scripts in the t/helper directory:\n> > >\n> > > The tests in this directory are invoked by the corresponding shell\n> > > scripts which spawn processes to test the different unit tests in the\n> > > t/helper directory.\n> > >\n> > > The process involved in converting these shell scripts to Clar\n> > > framework will typically follow the same steps as illustrated above\n> > > bar the following differences.\n> > >\n> > > Identifying the tests to be converted to Clar\n> > >\n> > > Create a new .c  file name which should be named appropriately to\n> > > illustrate what the file is testing.\n> > >\n> > > However, the shell-based script which tests the functions in t/helper\n> > > will be studied for in-depth understanding and then refactored into a\n> > > .c file which follows the steps above in converting to use Clar.\n> >\n> > As mentioned above, I thought we didn't have any such tests anymore. If\n> > we do, it might make sense to provide an example of such a thing that\n> > needs to be converted.\n>\n> Thank you Patrick\n> Okay from my understanding, such tests have a .c file in t/helper and\n> a corresponding t/t-<number>-<name>.sh file.\n> From my master branch which I study, I can see for example\n>    - test-env-helper.c in t/helper and t0017-env-helper.sh\n>    - test-find-pack.c in t/helper and t0081-find-pack.sh.\n> I concluded since the shell script used to compare the output against\n> the expected still exists\n> and no such file names exist in t/unit-tests, I assumed they have not\n> been ported which is why I listed files\n> in t/helper will be converted to clear.\n> Please I will be happy if I can get more clarity, thanks.\n>\n> >\n> > > Project Timeline:\n> > >\n> > > Community Bonding (Present - November 26):\n> > >\n> > > Continue making contributions to the Git codebase working on different\n> > > things within my capacity and getting more familiar with the codebase,\n> > > participating in patches review.\n> > >\n> > > Conversion of tests begins (December 9 - December 23): Familiarize me\n> > > with the conversion process to further enhance my understanding,\n> > > identify files for conversion and start the conversion process, and\n> > > set up a blog for weekly updates on my conversion process.\n> >\n> > Makes sense.\n> >\n> > > Implementation of community and mentor reviews (December 27 - January 31):\n> > >\n> > > Continue with conversions while testing converted tests, communicating\n> > > with reviewers and implementing reviews.\n> > >\n> > > Testing (February 1 - March 1): Continuously determine the correctness\n> > > of the converted tests by continuously testing and also liaising with\n> > > mentors constantly.\n> >\n> > For this one here'd I'd recommend to start more iteratively. What you\n> > have here sounds a bit like a waterfall model, where you first convert\n> > all tests and then eventually test and send things over to the mailing\n> > list.\n> >\n> > In the Git community you will likely have more success if you work in\n> > smaller patches. E.g. pick a small set of tests to convert, convert\n> > them, polish the series and then send it to the mailing list. That cycle\n> > would then repeat several times until you have converted all of the\n> > tests.\n>\n> Yes, my contributions have made me understand this process.\n> I will make appropriate adjustments. Thank you\n> >\n> > > Availability:\n> > >\n> > >  I am not currently enrolled in any academic program or have any jobs,\n> > > and will be available to work on the project for a minimum of 45 hours\n> > > per week.\n> >\n> > You really shouldn't be working more than 40 hours per week ;) The\n> > [Outreachy Internship Guide](https://www.outreachy.org/docs/internship/)\n> > recommends 30 hours per week, and I don't expect any more of you,\n> > either.\n>\n> >\n> > Other than that this document looks good to me, thanks!\n> >\n> > Patrick\n>\n> Thank you very much Patrick, I appreciate your time. Please I will\n> also like to know if i should send the corrected proposal\n> as a mail to the list as I did with this first version.\n>\n> Thanks again for your time.\n> Abraham Samuel\n\n\nHello Git Community,\n\n\nI hope this mail finds you well.\n\nI am Abraham Samuel, participating in the Outreachy internship program\nand I write to express my delight, enthusiasm and interest in working\non the project “Convert unit test to use the Clar testing framework”.\n\nMy first exposure to Git started with the book “Learn Enough Git to Be\nDangerous” which taught me the basics of using Git for version control\nand collaborations and I felt truly dangerous :-).\n\n\nI am passionate about FOSS and now that I am presented with the\nopportunity to contribute to Git, It is indeed a great opportunity to\nunderstand what happens under the hood and I have never been happier.\n\n\n## Introduction:\n\nI completed my ALX Software Engineering program in 2023 and I have\nbeen engaged in various software development projects, open source\ndevelopment and various personal projects, providing me with valuable\ntechnical and collaborative skills.\n\n\n## Project Overview - Convert unit test to use the Clar testing framework:\n\nI understand that the Git project is in the process of converting its\nunit tests to the Clar testing framework to improve test readability,\nconsistency and maintainability, a move away from homegrown unit test\nframework t/unit-test/test-lib.h.\n\nPart of the reasons for this\n[decision](https://lore.kernel.org/git/cover.1722415748.git.ps@pks.im/)\nincludes:\n\n1. Avoidance of duplication when declaring test functions which occurs\nwhen using the t/unit-tests/test-lib.h framework\n\n2. Having a proper unit testing framework instead of reinventing the wheel\n\n3. Clar can be easily extended\n\n4. Clar provides a structured and efficient way to write and execute\ntests and is well-suited for a project like Git where robust testing\nis essential to maintain quality and stability.\n\n\n## Contribution to the Git Community:\n\nI have participated in contributions to Git’s codebase after getting\naccepted into the contribution phase in October 2024, working on what\nI found doable and within my reach. Below is the list of my\ncontributions:\n\n- [PATCH v4] t7300-clean.sh: use test_path* helper functions for error logging.\n\n       List thread:\nhttps://lore.kernel.org/git/pull.1811.v4.git.1728498122419.gitgitgadget@gmail.com/\n\n       Status: merged into master\n\n       Merge Commit: 77af53f56f100b49fdcf294f687b36064d16feca\n\n       Description: The patch converted instances of  “test - [def]”\nin test cases to test_path_* functions to get error logs when the test\ncase fails when testing for the existence of a file or directory after\n“git clean” or “git clean -d” is called as the case may be.\n\n\n\n- [PATCH v4] notes: teach the -e option to edit messages in the editor\n\n       Status: integrated into Seen\n\n       List thread:\nhttps://lore.kernel.org/git/pull.1817.git.1729296853800.gitgitgadget@gmail.com/\n\n       Description: The patch worked on a #leftover bit which added\nthe “-e” option to “git notes add” and “git notes append” subcommands\nwhen the message is supplied with the -F and/or -m options. The patch\nenables fine-tuning the message by invoking the user’s default editor\nprefilling the message in the editor to allow editing the message to\nthe required taste before adding the note to the commit\n\n\n## Project Plan:\n\n      - Identify files for conversion in the t/unit-tests directory\n\n      - Write incremental patches\n\n      - Convert test and implement community and mentors’ feedback\n\n      - Validate converted tests\n\n\n## Detailed Steps\n\n\n### Identify files for conversion in the t/unit-tests directory:\n\nFrom the project description in the [Outreachy Git Project Description\npage](https://www.outreachy.org/outreachy-dec-2024-internship-cohort/communities/git/#convert-unit-tests-to-use-the-clar-testing-framewo),\nthe goal is to convert all Git’s existing unit tests to use the Clar\ntesting framework exclusively and also add any missing features which\nmight be necessary for the conversions.\n\nI will begin by selecting files from the t/unit-tests directory for\nconversion to the Clar testing framework. This approach allows me to\nstart with smaller, manageable patches that the community can review\nincrementally.\n\nThe existing unit tests which would need to be converted to Clar are\n.c test files present in t/unit-tests . Tests in this directory use\nthe t/unit-tests/test-lib testing framework and are “.c” scripts (for\nexample t/unit-tests/t-hash.c and t/unit-tests/t-strbuf.c), converted\nfrom the shell-based testing which used the t/helper/test-tool\nframework and corresponding t<number>-<name>.sh test files. Examples\nof this conversion can be seen in [Achu Luma’s\nwork](https://lore.kernel.org/git/20240226143350.3596-1-ach.lumap@gmail.com/),\nwhich shows the work done in converting the test from\nt/helper/test-sha1.c and test/helper/test-sha256.c to use\nt/unit-tests/t-hash.c which uses the t/unit-tests/test-lib.h framework\n\n\n### Write incremental patches\n\nEach test conversion will be submitted as an incremental patch,\nfollowing [Git’s contribution\nguidelines](https://github.com/git/git/blob/master/Documentation/SubmittingPatches).\nBy keeping patches incremental, the community can provide focused\nfeedback on each test conversion, improving the outcome.\n\n\n### Convert test and implement feedback\n\nOnce the files are identified, I will proceed with the conversions\nwhile regularly communicating with the mentors and the Git community.\nThis communication will ensure alignment on the implementation and\nallow immediate adjustments based on any feedback received.\n\nEach file conversion will typically have the following steps:\n\n       - Rename the test file from t-<name>.c to <name>.c. This\npattern follows the style used by Patrick Steinhardt in his conversion\nof [t-strvec.c](https://lore.kernel.org/git/604303e31aad3a9e74f7bdddc84f11d4d137c864.1725459142.git.ps@pks.im/)\nand [t-ctype.c](https://lore.kernel.org/git/ba05b9f1eef8136e087846ee54a076558097a240.1725459142.git.ps@pks.im/).\n\n       - Add the module name to CLAR_TEST_SUITE variable in the MAKE file.\n            CLAR_TEST_SUITE += <name>\n\n       - The next steps will typically involve writing optional setup\nand cleanup functions with the signature “void\ntest_<suitename>__initialize(void)” and void\ntest_<suite_name>__cleanup(void) and the actual tests also with the\nsignature\n\nvoid test_<suitname>__<testname>(void) and the Clar methods such as\ncl_assert(), cl_assert_equal_s(), cl_assert_equal_i() and any other\nimplemented assertion methods can be used to verify the results\nagainst the expected.\n\n\n\n ### Validate converted tests\n\nFinally, each converted test will be validated to ensure it behaves as\nexpected. Tests will undergo a thorough review to confirm that the\nconverted scripts accurately replicate the original test’s\nfunctionality.\n\n\nProject Timeline:\n\nCommunity Bonding (Present - November 26):\n\nContinue making contributions to the Git codebase working on different\nthings within my capacity and getting more familiar with the codebase,\nparticipating in patches review.\n\nConversion of tests begins (December 9 - March 1):\n\n    - Identify files for conversion with mentor’s guidance\n\n    - Start conversion process for selected\n\n    - Send incremental patches to the mailing list for review by\nmentors and   community members\n\n    - Implement review feedback and resend patches to the mailing list\nuntil an agreed patch is agreed upon.\n\n    - Update my blog to talk about each conversion and the\nachievements, challenges and goals achieved.\n\n\n\n## Availability:\n\n I am not currently enrolled in any academic program or have any jobs,\nand will be available to work on the project for a minimum of 30 hours\nper week.\n\n\n## After the Internship:\n\nThe Git community fosters proper and effective communication,\nregardless of one’s level of experience. The patience, guidance and\nexplanation of technical concepts shown by community members are\nwonderful and this has made me grow not just technically but also\nbehaviorally. Due to this, I plan to continue actively participating\nthe in Git community and be part next generation of those saddled with\nsustaining this great project and preserving its legacy.\n\n\nI look forward to reviews as regards my proposal.\n\n\nA special appreciation to everyone on the mailing list for reviewing my patches.\n\nMy mentors Patrick and Phillip, Junio, Eric, Christian, Brian,\nKristoff, Taylor, and Josh.\n\nI am grateful to you all.\n\nThanks\n\nAbraham Samuel.\n"},{"id":"506190","messageId":"CADYq+fbsnyyYosGFVEG=EWRhrwtKhynw6HAN1ac4NJM+an0tRg@mail.gmail.com","threadId":"62401","inReplyTo":"CADYq+faOBCRMS3GiQMuACJ2pLdirnODJBxuJTsR=2QPPpzwo2A@mail.gmail.com","subject":"Re: [Outreachy][proposal]: Convert unit tests to use the Clar testing framwork","fromName":"Samuel Abraham","fromEmail":"abrahamadekunle50@gmail.com","sentAt":"2024-10-28T05:24:59Z","receivedAt":"2024-10-28T05:25:10Z","isPatch":false,"sender":{"key":"abrahamadekunle50@gmail.com","avatar":"https://avatars.githubusercontent.com/u/110066922?v=4"},"body":"On Fri, Oct 25, 2024 at 6:56 PM Samuel Abraham\n<abrahamadekunle50@gmail.com> wrote:\n>\n> On Fri, Oct 25, 2024 at 2:22 PM Samuel Abraham\n> <abrahamadekunle50@gmail.com> wrote:\n> >\n> > On Fri, Oct 25, 2024 at 11:04 AM Patrick Steinhardt <ps@pks.im> wrote:\n> > >\n> > > On Wed, Oct 23, 2024 at 10:45:52PM +0100, Samuel Abraham wrote:\n> > >\n> > > Thanks for your application!\n> > >\n> > > > ## Project Overview - Convert unit test to use the Clar testing framework:\n> > > >\n> > > > I understand that the Git project is in the process of converting its\n> > > > unit tests to the Clar testing framework to improve test readability,\n> > > > consistency and maintainability, a move away from homegrown unit test\n> > > > frameworks such as t/helper/test-tool.h and t/unit-test/test-lib.h.\n> > >\n> > > Nit: we've basically moved away from test-tool for unit tests already,\n> > > to the best of my knowledge. So this is more about the second part,\n> > > moving away from our own test framework.\n> >\n> > Thank you very much for the clarity.\n> > >\n> > > > Clar provides a structured and efficient way to write and execute\n> > > > tests and is well-suited for a project like Git where robust testing\n> > > > is essential to maintain quality and stability.\n> > >\n> > > It would be nice to provide some pointers _why_ we think that clar is\n> > > better suited ;) Hint: you may have a look at the patch series that\n> > > introduced the clar for some ideas there.\n> >\n> > Okay I will do that.\n> >\n> > >\n> > > [snip]\n> > > > ## Project Plan:\n> > >\n> > > Formatting of this section is a bit funky, which makes it harder than\n> > > necessary to figure out which parts belong together. I'd propose to\n> > > first provide a high-level list of the steps you want to do with a\n> > > bulleted list and then maybe put more detailed explanations into\n> > > separate \"### subsections\". You may also want to convert links to use\n> > > [Markdown syntax](https://www.markdownguide.org/basic-syntax/#links),\n> > > which provides some structure aronud them.\n> >\n> > Okay thank you for this.\n> > >\n> > > > The first steps to migrating existing tests to Clar would be studying\n> > > > existing tests in the t/helper and t/unit-tests directory which will\n> > > > enable me to determine those appropriate for conversion.\n> > > >\n> > > > Liaise with mentors and community members to determine the viability\n> > > > of converting the selected test for conversion.\n> > > >\n> > > > Convert the selected test to Clar while in constant effective\n> > > > communication with the mentors and Git community, implementing\n> > > > feedback and review suggestions.\n> > > >\n> > > > Properly test converted scripts to ensure validity and correctness.\n> > > >\n> > > > Steps to converting the existing unit tests to the Clar Testing Framework\n> > > >\n> > > >  From the project description in the Outreachy Project Description page,\n> > > >\n> > > >\n> > > > https://www.outreachy.org/outreachy-dec-2024-internship-cohort/communities/git/#convert-unit-tests-to-use-the-clar-testing-framewo,\n> > > > the goal is to convert all Git’s existing unit tests to use the Clar\n> > > > testing framework exclusively.\n> > >\n> > > It might also make sense to plan some time to add missing features to\n> > > the clar if we hit anything during the conversion.\n> >\n> > Okay noted.\n> > >\n> > > > The existing unit tests which would need to be converted to Clar are;\n> > > >\n> > > > .c test files present in t/unit-tests: Tests in this directory use the\n> > > > t/unit-tests/test-lib testing framework and are “.c” scripts,\n> > > > converted from the shell-based testing which used the tests in\n> > > > t/helper/ and corresponding t<number>-<name>.sh test files. Examples\n> > > > of this conversion can be seen in the link below which references Achu\n> > > > Luma’s work\n> > > >\n> > > > https://lore.kernel.org/git/20240226143350.3596-1-ach.lumap@gmail.com/.\n> > > >\n> > > >\n> > > > The link shows the work done in converting the test from\n> > > > t/helper/test-sha1.c and test/helper/test-sha256.c to use\n> > > > t/unit-tests/t-hash.c which uses the t/unit-tests/test-lib.h framework\n> > > >\n> > > >\n> > > > The steps to convert files located in this directory include;\n> > > >\n> > > > - Identify the test files to be converted.\n> > > >\n> > > > Examples of such files are the t/unit-tests/t-hash.c, t/unit-tests/t-strbuf.c\n> > > >\n> > > > - Rename the test file from t-<name>.c to <name>.c. This pattern\n> > > > follows the style used by Patrick Steinhardt in his conversion of the\n> > > > t-strvec.c and t-ctype.c files to use the clar framework.\n> > > >\n> > > > https://lore.kernel.org/git/604303e31aad3a9e74f7bdddc84f11d4d137c864.1725459142.git.ps@pks.im/\n> > > > and\n> > > >\n> > > > https://lore.kernel.org/git/ba05b9f1eef8136e087846ee54a076558097a240.1725459142.git.ps@pks.im/\n> > > >\n> > > > As a sample demonstration, we will convert the t/unit-tests/t-hash.c\n> > > > to use Clar.\n> > >\n> > > I think the previous explanations are sufficient -- going into the\n> > > technical details like you do below is appreciated, but ultimately not\n> > > necessary in my opinion. What I'm after here is that you have a rough\n> > > understanding of what needs to be done for each of the tests, and that\n> > > is sufficiently demonstrated by a high-level explanation.\n> >\n> > Okay noted.\n> > >\n> > > > The test scripts in the t/helper directory:\n> > > >\n> > > > The tests in this directory are invoked by the corresponding shell\n> > > > scripts which spawn processes to test the different unit tests in the\n> > > > t/helper directory.\n> > > >\n> > > > The process involved in converting these shell scripts to Clar\n> > > > framework will typically follow the same steps as illustrated above\n> > > > bar the following differences.\n> > > >\n> > > > Identifying the tests to be converted to Clar\n> > > >\n> > > > Create a new .c  file name which should be named appropriately to\n> > > > illustrate what the file is testing.\n> > > >\n> > > > However, the shell-based script which tests the functions in t/helper\n> > > > will be studied for in-depth understanding and then refactored into a\n> > > > .c file which follows the steps above in converting to use Clar.\n> > >\n> > > As mentioned above, I thought we didn't have any such tests anymore. If\n> > > we do, it might make sense to provide an example of such a thing that\n> > > needs to be converted.\n> >\n> > Thank you Patrick\n> > Okay from my understanding, such tests have a .c file in t/helper and\n> > a corresponding t/t-<number>-<name>.sh file.\n> > From my master branch which I study, I can see for example\n> >    - test-env-helper.c in t/helper and t0017-env-helper.sh\n> >    - test-find-pack.c in t/helper and t0081-find-pack.sh.\n> > I concluded since the shell script used to compare the output against\n> > the expected still exists\n> > and no such file names exist in t/unit-tests, I assumed they have not\n> > been ported which is why I listed files\n> > in t/helper will be converted to clear.\n> > Please I will be happy if I can get more clarity, thanks.\n> >\n> > >\n> > > > Project Timeline:\n> > > >\n> > > > Community Bonding (Present - November 26):\n> > > >\n> > > > Continue making contributions to the Git codebase working on different\n> > > > things within my capacity and getting more familiar with the codebase,\n> > > > participating in patches review.\n> > > >\n> > > > Conversion of tests begins (December 9 - December 23): Familiarize me\n> > > > with the conversion process to further enhance my understanding,\n> > > > identify files for conversion and start the conversion process, and\n> > > > set up a blog for weekly updates on my conversion process.\n> > >\n> > > Makes sense.\n> > >\n> > > > Implementation of community and mentor reviews (December 27 - January 31):\n> > > >\n> > > > Continue with conversions while testing converted tests, communicating\n> > > > with reviewers and implementing reviews.\n> > > >\n> > > > Testing (February 1 - March 1): Continuously determine the correctness\n> > > > of the converted tests by continuously testing and also liaising with\n> > > > mentors constantly.\n> > >\n> > > For this one here'd I'd recommend to start more iteratively. What you\n> > > have here sounds a bit like a waterfall model, where you first convert\n> > > all tests and then eventually test and send things over to the mailing\n> > > list.\n> > >\n> > > In the Git community you will likely have more success if you work in\n> > > smaller patches. E.g. pick a small set of tests to convert, convert\n> > > them, polish the series and then send it to the mailing list. That cycle\n> > > would then repeat several times until you have converted all of the\n> > > tests.\n> >\n> > Yes, my contributions have made me understand this process.\n> > I will make appropriate adjustments. Thank you\n> > >\n> > > > Availability:\n> > > >\n> > > >  I am not currently enrolled in any academic program or have any jobs,\n> > > > and will be available to work on the project for a minimum of 45 hours\n> > > > per week.\n> > >\n> > > You really shouldn't be working more than 40 hours per week ;) The\n> > > [Outreachy Internship Guide](https://www.outreachy.org/docs/internship/)\n> > > recommends 30 hours per week, and I don't expect any more of you,\n> > > either.\n> >\n> > >\n> > > Other than that this document looks good to me, thanks!\n> > >\n> > > Patrick\n> >\n> > Thank you very much Patrick, I appreciate your time. Please I will\n> > also like to know if i should send the corrected proposal\n> > as a mail to the list as I did with this first version.\n> >\n> > Thanks again for your time.\n> > Abraham Samuel\n>\n>\n> Hello Git Community,\n>\n>\n> I hope this mail finds you well.\n>\n> I am Abraham Samuel, participating in the Outreachy internship program\n> and I write to express my delight, enthusiasm and interest in working\n> on the project “Convert unit test to use the Clar testing framework”.\n>\n> My first exposure to Git started with the book “Learn Enough Git to Be\n> Dangerous” which taught me the basics of using Git for version control\n> and collaborations and I felt truly dangerous :-).\n>\n>\n> I am passionate about FOSS and now that I am presented with the\n> opportunity to contribute to Git, It is indeed a great opportunity to\n> understand what happens under the hood and I have never been happier.\n>\n>\n> ## Introduction:\n>\n> I completed my ALX Software Engineering program in 2023 and I have\n> been engaged in various software development projects, open source\n> development and various personal projects, providing me with valuable\n> technical and collaborative skills.\n>\n>\n> ## Project Overview - Convert unit test to use the Clar testing framework:\n>\n> I understand that the Git project is in the process of converting its\n> unit tests to the Clar testing framework to improve test readability,\n> consistency and maintainability, a move away from homegrown unit test\n> framework t/unit-test/test-lib.h.\n>\n> Part of the reasons for this\n> [decision](https://lore.kernel.org/git/cover.1722415748.git.ps@pks.im/)\n> includes:\n>\n> 1. Avoidance of duplication when declaring test functions which occurs\n> when using the t/unit-tests/test-lib.h framework\n>\n> 2. Having a proper unit testing framework instead of reinventing the wheel\n>\n> 3. Clar can be easily extended\n>\n> 4. Clar provides a structured and efficient way to write and execute\n> tests and is well-suited for a project like Git where robust testing\n> is essential to maintain quality and stability.\n>\n>\n> ## Contribution to the Git Community:\n>\n> I have participated in contributions to Git’s codebase after getting\n> accepted into the contribution phase in October 2024, working on what\n> I found doable and within my reach. Below is the list of my\n> contributions:\n>\n> - [PATCH v4] t7300-clean.sh: use test_path* helper functions for error logging.\n>\n>        List thread:\n> https://lore.kernel.org/git/pull.1811.v4.git.1728498122419.gitgitgadget@gmail.com/\n>\n>        Status: merged into master\n>\n>        Merge Commit: 77af53f56f100b49fdcf294f687b36064d16feca\n>\n>        Description: The patch converted instances of  “test - [def]”\n> in test cases to test_path_* functions to get error logs when the test\n> case fails when testing for the existence of a file or directory after\n> “git clean” or “git clean -d” is called as the case may be.\n>\n>\n>\n> - [PATCH v4] notes: teach the -e option to edit messages in the editor\n>\n>        Status: integrated into next\n>\n>        List thread:\n> https://lore.kernel.org/git/pull.1817.git.1729296853800.gitgitgadget@gmail.com/\n>\n>        Description: The patch worked on a #leftover bit which added\n> the “-e” option to “git notes add” and “git notes append” subcommands\n> when the message is supplied with the -F and/or -m options. The patch\n> enables fine-tuning the message by invoking the user’s default editor\n> prefilling the message in the editor to allow editing the message to\n> the required taste before adding the note to the commit\n>\n>\n> ## Project Plan:\n>\n>       - Identify files for conversion in the t/unit-tests directory\n>\n>       - Write incremental patches\n>\n>       - Convert test and implement community and mentors’ feedback\n>\n>       - Validate converted tests\n>\n>\n> ## Detailed Steps\n>\n>\n> ### Identify files for conversion in the t/unit-tests directory:\n>\n> From the project description in the [Outreachy Git Project Description\n> page](https://www.outreachy.org/outreachy-dec-2024-internship-cohort/communities/git/#convert-unit-tests-to-use-the-clar-testing-framewo),\n> the goal is to convert all Git’s existing unit tests to use the Clar\n> testing framework exclusively and also add any missing features which\n> might be necessary for the conversions.\n>\n> I will begin by selecting files from the t/unit-tests directory for\n> conversion to the Clar testing framework. This approach allows me to\n> start with smaller, manageable patches that the community can review\n> incrementally.\n>\n> The existing unit tests which would need to be converted to Clar are\n> .c test files present in t/unit-tests . Tests in this directory use\n> the t/unit-tests/test-lib testing framework and are “.c” scripts (for\n> example t/unit-tests/t-hash.c and t/unit-tests/t-strbuf.c), converted\n> from the shell-based testing which used the t/helper/test-tool\n> framework and corresponding t<number>-<name>.sh test files. Examples\n> of this conversion can be seen in [Achu Luma’s\n> work](https://lore.kernel.org/git/20240226143350.3596-1-ach.lumap@gmail.com/),\n> which shows the work done in converting the test from\n> t/helper/test-sha1.c and test/helper/test-sha256.c to use\n> t/unit-tests/t-hash.c which uses the t/unit-tests/test-lib.h framework\n>\n>\n> ### Write incremental patches\n>\n> Each test conversion will be submitted as an incremental patch,\n> following [Git’s contribution\n> guidelines](https://github.com/git/git/blob/master/Documentation/SubmittingPatches).\n> By keeping patches incremental, the community can provide focused\n> feedback on each test conversion, improving the outcome.\n>\n>\n> ### Convert test and implement feedback\n>\n> Once the files are identified, I will proceed with the conversions\n> while regularly communicating with the mentors and the Git community.\n> This communication will ensure alignment on the implementation and\n> allow immediate adjustments based on any feedback received.\n>\n> Each file conversion will typically have the following steps:\n>\n>        - Rename the test file from t-<name>.c to <name>.c. This\n> pattern follows the style used by Patrick Steinhardt in his conversion\n> of [t-strvec.c](https://lore.kernel.org/git/604303e31aad3a9e74f7bdddc84f11d4d137c864.1725459142.git.ps@pks.im/)\n> and [t-ctype.c](https://lore.kernel.org/git/ba05b9f1eef8136e087846ee54a076558097a240.1725459142.git.ps@pks.im/).\n>\n>        - Add the module name to CLAR_TEST_SUITE variable in the MAKE file.\n>             CLAR_TEST_SUITE += <name>\n>\n>        - The next steps will typically involve writing optional setup\n> and cleanup functions with the signature “void\n> test_<suitename>__initialize(void)” and void\n> test_<suite_name>__cleanup(void) and the actual tests also with the\n> signature\n>\n> void test_<suitname>__<testname>(void) and the Clar methods such as\n> cl_assert(), cl_assert_equal_s(), cl_assert_equal_i() and any other\n> implemented assertion methods can be used to verify the results\n> against the expected.\n>\n>\n>\n>  ### Validate converted tests\n>\n> Finally, each converted test will be validated to ensure it behaves as\n> expected. Tests will undergo a thorough review to confirm that the\n> converted scripts accurately replicate the original test’s\n> functionality.\n>\n>\n> ## Project Timeline:\n>\n> Community Bonding (Present - November 26):\n>\n> Continue making contributions to the Git codebase working on different\n> things within my capacity and getting more familiar with the codebase,\n> participating in patches review.\n>\n\nUnderstand Git and Clar codebase (December 9 - December 22):\n\n       - I will familiarize myself with the Git codebase to understand\ncurrent tests\n       - Study previous conversion processes by previous interns to\nthe now-old unit test framework\n          for ideas that would benefit me.\n       - Work with Clar upstream to improve shortcomings discovered\nduring integration with Clar.\n       - Set up a blog for weekly updates on my conversion process\n\n> Conversion of tests begins (December 23 - March 1):\n>\n>     - Identify files for conversion with mentor’s guidance\n>\n>     - Start conversion process for selected\n>\n>     - Send incremental patches to the mailing list for review by\n>        mentors and   community members\n>\n>     - Implement review feedback and resend patches to the mailing list\n>        until an agreed patch is agreed upon.\n>\n>     - Update my blog to talk about each conversion and the\n>       achievements, challenges and goals achieved.\n\nFinal Stages (March 1 - March 7):\n       - Update my blog on the gains and knowledge gained during the internship\n       - Work with Git Community to ascertain level of satisfaction\nwith converted tests\n>\n>\n>\n> ## Availability:\n>\n>  I am not currently enrolled in any academic program or have any jobs,\n> and will be available to work on the project for a minimum of 30 hours\n> per week.\n>\n>\n> ## After the Internship:\n>\n> The Git community fosters proper and effective communication,\n> regardless of one’s level of experience. The patience, guidance and\n> explanation of technical concepts shown by community members are\n> wonderful and this has made me grow not just technically but also\n> behaviorally. Due to this, I plan to continue actively participating\n> the in Git community and be part next generation of those saddled with\n> sustaining this great project and preserving its legacy.\n>\n>\n> I look forward to reviews as regards my proposal.\n>\n>\n> A special appreciation to everyone on the mailing list for reviewing my patches.\n>\n> My mentors Patrick and Phillip, Junio, Eric, Christian, Brian,\n> Kristoff, Taylor, and Josh.\n>\n> I am grateful to you all.\n>\n> Thanks\n>\n> Abraham Samuel.\n"},{"id":"506197","messageId":"Zx8mqmzN2d3pU0zC@pks.im","threadId":"62401","inReplyTo":"CADYq+faOBCRMS3GiQMuACJ2pLdirnODJBxuJTsR=2QPPpzwo2A@mail.gmail.com","subject":"Re: [Outreachy][proposal]: Convert unit tests to use the Clar testing framwork","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-10-28T05:52:48Z","receivedAt":"2024-10-28T05:52:58Z","isPatch":false,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, Oct 25, 2024 at 07:56:05PM +0100, Samuel Abraham wrote:\n> Hello Git Community,\n> \n> I hope this mail finds you well.\n> \n> I am Abraham Samuel, participating in the Outreachy internship program\n> and I write to express my delight, enthusiasm and interest in working\n> on the project “Convert unit test to use the Clar testing framework”.\n> \n> My first exposure to Git started with the book “Learn Enough Git to Be\n> Dangerous” which taught me the basics of using Git for version control\n> and collaborations and I felt truly dangerous :-).\n> \n> \n> I am passionate about FOSS and now that I am presented with the\n> opportunity to contribute to Git, It is indeed a great opportunity to\n> understand what happens under the hood and I have never been happier.\n\nThanks, this version reads good to me overall. Please don't forget to\nenter all of this online with Outreachy if you haven't already done so\n:)\n\nPatrick\n"},{"id":"506207","messageId":"CADYq+faGcH4KRDm_n91vA1zdD8V3i=sfXXr4pOFKuN+Z9YiL0Q@mail.gmail.com","threadId":"62401","inReplyTo":"Zx8mqmzN2d3pU0zC@pks.im","subject":"Re: [Outreachy][proposal]: Convert unit tests to use the Clar testing framwork","fromName":"Samuel Abraham","fromEmail":"abrahamadekunle50@gmail.com","sentAt":"2024-10-28T08:27:55Z","receivedAt":"2024-10-28T08:28:06Z","isPatch":false,"sender":{"key":"abrahamadekunle50@gmail.com","avatar":"https://avatars.githubusercontent.com/u/110066922?v=4"},"body":"On Mon, Oct 28, 2024 at 5:52 AM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Fri, Oct 25, 2024 at 07:56:05PM +0100, Samuel Abraham wrote:\n> > Hello Git Community,\n> >\n> > I hope this mail finds you well.\n> >\n> > I am Abraham Samuel, participating in the Outreachy internship program\n> > and I write to express my delight, enthusiasm and interest in working\n> > on the project “Convert unit test to use the Clar testing framework”.\n> >\n> > My first exposure to Git started with the book “Learn Enough Git to Be\n> > Dangerous” which taught me the basics of using Git for version control\n> > and collaborations and I felt truly dangerous :-).\n> >\n> >\n> > I am passionate about FOSS and now that I am presented with the\n> > opportunity to contribute to Git, It is indeed a great opportunity to\n> > understand what happens under the hood and I have never been happier.\n>\n> Thanks, this version reads good to me overall. Please don't forget to\n> enter all of this online with Outreachy if you haven't already done so\n> :)\n>\n> Patrick\n\nThank you Patrick, I will like to add that while I have submitted a\nproposal for the second project\nhowever, this will be my preferred option.\n"}]}