Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate unit tests to new framework #428

Open
7 of 12 tasks
madolson opened this issue May 3, 2024 · 3 comments · May be fixed by #441
Open
7 of 12 tasks

Migrate unit tests to new framework #428

madolson opened this issue May 3, 2024 · 3 comments · May be fixed by #441
Labels
good first issue Good for newcomers help wanted External contributions would be appreciated

Comments

@madolson
Copy link
Member

madolson commented May 3, 2024

The legacy unit tests were a collection of distinct tests stored at the bottom of various files, that required rebuilding the server with a special flag and starting the server. We're moving to a new framework that can always be built and are running on a unified infrastructure. This issue is keeping track of migration from the old to new framework.

To migrate the tests, remove the custom testing code in the testing file lists listed below, create a new test like src/unit/test_*.c, and remove the reference in

struct serverTest {
. See the README for more information about writing a new unit test.

@madolson madolson added help wanted External contributions would be appreciated good first issue Good for newcomers labels May 3, 2024
madolson pushed a commit that referenced this issue May 7, 2024
This PR fixes an error in the unit/READMED.md (see
#428) in order to correct the
steps for running single unit test file.

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
madolson pushed a commit that referenced this issue May 7, 2024
This PR migrates all tests related to util into new test framework as
part of the parent issue #428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
madolson added a commit that referenced this issue May 7, 2024
This PR migrates all tests related to kvstore into new test framework as
part of the parent issue #428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
madolson added a commit that referenced this issue May 9, 2024
This patch migrates all tests in sds.c into new test framework as part
of the parent issue #428.

---------

Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
madolson added a commit that referenced this issue May 10, 2024
This migrates unit tests related to sha1 to new framework, ref: #428.

---------

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
madolson added a commit that referenced this issue May 12, 2024
This PR migrates all tests related to endianconv into new test framework
as part of the parent issue #428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
karthyuom added a commit to karthyuom/valkey that referenced this issue May 13, 2024
This PR migrates all tests related to util into new test framework as
part of the parent issue valkey-io#428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
karthyuom added a commit to karthyuom/valkey that referenced this issue May 13, 2024
This PR migrates all tests related to kvstore into new test framework as
part of the parent issue valkey-io#428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
karthyuom pushed a commit to karthyuom/valkey that referenced this issue May 13, 2024
This patch migrates all tests in sds.c into new test framework as part
of the parent issue valkey-io#428.

---------

Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
karthyuom pushed a commit to karthyuom/valkey that referenced this issue May 13, 2024
This migrates unit tests related to sha1 to new framework, ref: valkey-io#428.

---------

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
madolson pushed a commit that referenced this issue May 14, 2024
This is the actual PR which is created to migrate all tests related to
zmalloc into new test framework as part of the parent issue
#428.

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
adetunjii pushed a commit to adetunjii/valkey that referenced this issue May 15, 2024
This PR migrates all tests related to endianconv into new test framework
as part of the parent issue valkey-io#428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
adetunjii pushed a commit to adetunjii/valkey that referenced this issue May 15, 2024
)

This is the actual PR which is created to migrate all tests related to
zmalloc into new test framework as part of the parent issue
valkey-io#428.

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
adetunjii pushed a commit to adetunjii/valkey that referenced this issue May 15, 2024
This PR migrates all tests related to endianconv into new test framework
as part of the parent issue valkey-io#428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
Signed-off-by: adetunjii <adetunjithomas1@outlook.com>
adetunjii pushed a commit to adetunjii/valkey that referenced this issue May 15, 2024
)

This is the actual PR which is created to migrate all tests related to
zmalloc into new test framework as part of the parent issue
valkey-io#428.

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: adetunjii <adetunjithomas1@outlook.com>
adetunjii pushed a commit to adetunjii/valkey that referenced this issue May 15, 2024
This PR migrates all tests related to endianconv into new test framework
as part of the parent issue valkey-io#428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
Signed-off-by: adetunjii <adetunjithomas1@outlook.com>
adetunjii pushed a commit to adetunjii/valkey that referenced this issue May 15, 2024
)

This is the actual PR which is created to migrate all tests related to
zmalloc into new test framework as part of the parent issue
valkey-io#428.

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: adetunjii <adetunjithomas1@outlook.com>
hallmason17 pushed a commit to hallmason17/valkey that referenced this issue May 15, 2024
This PR migrates all tests related to endianconv into new test framework
as part of the parent issue valkey-io#428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
hallmason17 pushed a commit to hallmason17/valkey that referenced this issue May 15, 2024
)

This is the actual PR which is created to migrate all tests related to
zmalloc into new test framework as part of the parent issue
valkey-io#428.

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
hallmason17 pushed a commit to hallmason17/valkey that referenced this issue May 18, 2024
This PR migrates all tests related to endianconv into new test framework
as part of the parent issue valkey-io#428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
hallmason17 pushed a commit to hallmason17/valkey that referenced this issue May 18, 2024
)

This is the actual PR which is created to migrate all tests related to
zmalloc into new test framework as part of the parent issue
valkey-io#428.

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
@SoulPancake
Copy link

Is there a part of this not WIP currently that I can pick up @madolson ?

@madolson
Copy link
Member Author

@SoulPancake The only one not picked up right now is dict.c.

srgsanky pushed a commit to srgsanky/valkey that referenced this issue May 19, 2024
This patch migrates all tests in sds.c into new test framework as part
of the parent issue valkey-io#428.

---------

Signed-off-by: Lipeng Zhu <lipeng.zhu@intel.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
srgsanky pushed a commit to srgsanky/valkey that referenced this issue May 19, 2024
This migrates unit tests related to sha1 to new framework, ref: valkey-io#428.

---------

Signed-off-by: Shivshankar-Reddy <shiva.sheri.github@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
srgsanky pushed a commit to srgsanky/valkey that referenced this issue May 19, 2024
This PR migrates all tests related to endianconv into new test framework
as part of the parent issue valkey-io#428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
srgsanky pushed a commit to srgsanky/valkey that referenced this issue May 19, 2024
)

This is the actual PR which is created to migrate all tests related to
zmalloc into new test framework as part of the parent issue
valkey-io#428.

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
@jazelly
Copy link

jazelly commented May 21, 2024

I have tried porting dict.c under the new framework, but there is an issue with the test (or new test framework, or even dict.c itself). Reproduce steps

  1. copy unit tests in dict.c to unit/test_dict.c
  2. comment out original unit tests
  3. update include in test_dict.c relatively. You will need #include "../dict.c" as there are some private functions used in the test.
  4. you can choose to use the new test_help.h and change the print macro, but optional
  5. make valkey-unit-tests
  6. valkey-unit-tests --single test_dict.c
  7. Observe the 3rd test getting segmentation fault on linux (stack overflow) or infinite loop on macos, caused by rehashidx always being 0

I've checked the new test framework but nothing could cause this inconsistency with original unit tests.

madolson pushed a commit that referenced this issue May 22, 2024
Issue #428.

Moved the SERVER_TEST block from ziplist.c into unit tests in
test_ziplist.c. I left the benchmark related tasks alone in their own
test, as I am not sure what to do with them.

Some of the assertions are a little vague/useless, but I will try to
refine them.

---------

Signed-off-by: Mason Hall <hallmason17@gmail.com>
adetunjii pushed a commit to adetunjii/valkey that referenced this issue May 22, 2024
This PR migrates all tests related to endianconv into new test framework
as part of the parent issue valkey-io#428.

---------

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
Signed-off-by: Samuel Adetunji <adetunjithomas1@outlook.com>
adetunjii pushed a commit to adetunjii/valkey that referenced this issue May 22, 2024
)

This is the actual PR which is created to migrate all tests related to
zmalloc into new test framework as part of the parent issue
valkey-io#428.

Signed-off-by: Karthick Ariyaratnam <karthyuom@gmail.com>
Signed-off-by: Samuel Adetunji <adetunjithomas1@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted External contributions would be appreciated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants