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

ci: add unit test to github action #1604

Merged
merged 7 commits into from
Jun 11, 2023

Conversation

machinly
Copy link
Collaborator

@machinly machinly commented Jun 9, 2023

Add unit tests to Github Action, and comment out some test files that can't pass.

@machinly machinly requested a review from chenbt-hz June 9, 2023 05:46
pikatests.sh Show resolved Hide resolved
tests/test_helper.tcl Show resolved Hide resolved
tests/test_helper.tcl Show resolved Hide resolved
tests/test_helper.tcl Show resolved Hide resolved
tests/test_helper.tcl Show resolved Hide resolved
exit 1
fi
cleanup
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code review of this patch is as follows:

  • A cleanup function is added to remove log, db and dbsync directories
  • Functions are defined to check if tcl is installed, setup build directory, and pika binary and configuration file
  • The removal of the "rm -rf ./db" command from the original script may potentially leave residual database files in the current directory and the new cleanup function does not remove these either.
  • Code seems to lack proper error handling mechanisms, i.e., it just exits with an error message but does not specify what caused the error or how to fix it.
  • It might be useful to add a logging mechanism to stream output to a separate file and ensure that users can review test results more easily.

Some possible improvements to the existing code may include:

  • Adding proper error handling to the code, such as specifying error types and potential solutions.
  • Instead of using multiple functions, it would be better to use a single function broken down into logical blocks for readability and simplicity.
  • Checking the permissions before removing files or directories to avoid accidental deletion of critical files that can cause issues later on.
  • Clearing the necessary directories more effectively by using more specialized commands like find instead of rm -rf.

@wanghenshui
Copy link
Collaborator

先合入,后面再优化,先有个架子

@wanghenshui wanghenshui self-requested a review June 11, 2023 10:01
@wanghenshui
Copy link
Collaborator

我没有合入权限,@AlexStocks 合一下

@chenbt-hz chenbt-hz self-requested a review June 11, 2023 11:24
@AlexStocks AlexStocks merged commit 7265daf into OpenAtomFoundation:unstable Jun 11, 2023
@machinly machinly deleted the pika-unit-test branch June 12, 2023 03:15
lqxhub pushed a commit to lqxhub/pika that referenced this pull request Jun 18, 2023
AlexStocks added a commit that referenced this pull request Jul 2, 2023
* feat: supported 'ptype' command

* Simplified command `type` and `ptype` code

* Remove the capacity judgment

* fix slavaof serialize response bug (#1583)

Co-authored-by: liuyuecai <[email protected]>

* fix (#1587) (#1588)

* fix unit test:type/set (#1577)

* Fix memory leaks in HandleBGWorkerWriteDB and HandleMetaSyncResponse (#1590)

* fix memory leaks in PikaReplBgWorker::HandleBGWorkerWriteDB(void* arg) and PikaReplClientConn::HandleMetaSyncResponse(void* arg).

* add address/thread sanitizer to CMakeLists

---------

Co-authored-by: cjh <[email protected]>

* refactor: replace pstd/env with std::filesystem (#1470)

* fix bug issue 1554: using unique_ptr.reset to fix the SIGABRT error (#1595)

using unique_ptr.reset to fix the SIGABRT error && using time-wait lock to notify quickly

* fix: incorrect manner of terminating the process (#1596)

* fix issue#1597: add rocksdb dependency to pstd (#1599)

* fix g++15 compile failure

* add rocksdb dependency to pstd

---------

Co-authored-by: J1senn <[email protected]>

* fix_info_command

* fix: gcc13 compile failed (#1601)

* ci: add unit test to github action (#1604)

* ci: add unit test in github workflow

* chore:change `PLATFORM` field logic (#1615)

* fix issue 1517: scan 命令不支持 type 参数 (#1582)

* fix: the unit test of type/set (#1617)

* test: optimize the return results of srandmember to avoid approximate results

* fix: use last_seed for random engine

* [fix issue1621] fix deadlock (#1620)

* [fix] fix deadlock

* [fix] fix

* command `type` and `ptype` add unit test

* fix member variable initialization

* Update issue templates

* feat: supported 'ptype' command

* fix unit test:type/set (#1577)

* fix issue#1597: add rocksdb dependency to pstd (#1599)

* fix g++15 compile failure

* add rocksdb dependency to pstd

---------

Co-authored-by: J1senn <[email protected]>

* fix: gcc13 compile failed (#1601)

* fix: the unit test of type/set (#1617)

* test: optimize the return results of srandmember to avoid approximate results

* fix: use last_seed for random engine

* Modify other modules to use the new `type` function

* fix function repeat

---------

Co-authored-by: Yuecai Liu <[email protected]>
Co-authored-by: liuyuecai <[email protected]>
Co-authored-by: Peter Chan <[email protected]>
Co-authored-by: chenbt <[email protected]>
Co-authored-by: Junhua Chen <[email protected]>
Co-authored-by: cjh <[email protected]>
Co-authored-by: kang jinci <[email protected]>
Co-authored-by: Xin.Zh <[email protected]>
Co-authored-by: machinly <[email protected]>
Co-authored-by: A2ureStone <[email protected]>
Co-authored-by: J1senn <[email protected]>
Co-authored-by: chejinge <[email protected]>
Co-authored-by: baerwang <[email protected]>
Co-authored-by: ptbxzrt <[email protected]>
Co-authored-by: 你不要过来啊 <[email protected]>
bigdaronlee163 pushed a commit to bigdaronlee163/pika that referenced this pull request Jun 8, 2024
bigdaronlee163 pushed a commit to bigdaronlee163/pika that referenced this pull request Jun 8, 2024
* feat: supported 'ptype' command

* Simplified command `type` and `ptype` code

* Remove the capacity judgment

* fix slavaof serialize response bug (OpenAtomFoundation#1583)

Co-authored-by: liuyuecai <[email protected]>

* fix (OpenAtomFoundation#1587) (OpenAtomFoundation#1588)

* fix unit test:type/set (OpenAtomFoundation#1577)

* Fix memory leaks in HandleBGWorkerWriteDB and HandleMetaSyncResponse (OpenAtomFoundation#1590)

* fix memory leaks in PikaReplBgWorker::HandleBGWorkerWriteDB(void* arg) and PikaReplClientConn::HandleMetaSyncResponse(void* arg).

* add address/thread sanitizer to CMakeLists

---------

Co-authored-by: cjh <[email protected]>

* refactor: replace pstd/env with std::filesystem (OpenAtomFoundation#1470)

* fix bug issue 1554: using unique_ptr.reset to fix the SIGABRT error (OpenAtomFoundation#1595)

using unique_ptr.reset to fix the SIGABRT error && using time-wait lock to notify quickly

* fix: incorrect manner of terminating the process (OpenAtomFoundation#1596)

* fix issue#1597: add rocksdb dependency to pstd (OpenAtomFoundation#1599)

* fix g++15 compile failure

* add rocksdb dependency to pstd

---------

Co-authored-by: J1senn <[email protected]>

* fix_info_command

* fix: gcc13 compile failed (OpenAtomFoundation#1601)

* ci: add unit test to github action (OpenAtomFoundation#1604)

* ci: add unit test in github workflow

* chore:change `PLATFORM` field logic (OpenAtomFoundation#1615)

* fix issue 1517: scan 命令不支持 type 参数 (OpenAtomFoundation#1582)

* fix: the unit test of type/set (OpenAtomFoundation#1617)

* test: optimize the return results of srandmember to avoid approximate results

* fix: use last_seed for random engine

* [fix issue1621] fix deadlock (OpenAtomFoundation#1620)

* [fix] fix deadlock

* [fix] fix

* command `type` and `ptype` add unit test

* fix member variable initialization

* Update issue templates

* feat: supported 'ptype' command

* fix unit test:type/set (OpenAtomFoundation#1577)

* fix issue#1597: add rocksdb dependency to pstd (OpenAtomFoundation#1599)

* fix g++15 compile failure

* add rocksdb dependency to pstd

---------

Co-authored-by: J1senn <[email protected]>

* fix: gcc13 compile failed (OpenAtomFoundation#1601)

* fix: the unit test of type/set (OpenAtomFoundation#1617)

* test: optimize the return results of srandmember to avoid approximate results

* fix: use last_seed for random engine

* Modify other modules to use the new `type` function

* fix function repeat

---------

Co-authored-by: Yuecai Liu <[email protected]>
Co-authored-by: liuyuecai <[email protected]>
Co-authored-by: Peter Chan <[email protected]>
Co-authored-by: chenbt <[email protected]>
Co-authored-by: Junhua Chen <[email protected]>
Co-authored-by: cjh <[email protected]>
Co-authored-by: kang jinci <[email protected]>
Co-authored-by: Xin.Zh <[email protected]>
Co-authored-by: machinly <[email protected]>
Co-authored-by: A2ureStone <[email protected]>
Co-authored-by: J1senn <[email protected]>
Co-authored-by: chejinge <[email protected]>
Co-authored-by: baerwang <[email protected]>
Co-authored-by: ptbxzrt <[email protected]>
Co-authored-by: 你不要过来啊 <[email protected]>
cheniujh pushed a commit to cheniujh/pika that referenced this pull request Sep 24, 2024
cheniujh added a commit to cheniujh/pika that referenced this pull request Sep 24, 2024
* feat: supported 'ptype' command

* Simplified command `type` and `ptype` code

* Remove the capacity judgment

* fix slavaof serialize response bug (OpenAtomFoundation#1583)

Co-authored-by: liuyuecai <[email protected]>

* fix (OpenAtomFoundation#1587) (OpenAtomFoundation#1588)

* fix unit test:type/set (OpenAtomFoundation#1577)

* Fix memory leaks in HandleBGWorkerWriteDB and HandleMetaSyncResponse (OpenAtomFoundation#1590)

* fix memory leaks in PikaReplBgWorker::HandleBGWorkerWriteDB(void* arg) and PikaReplClientConn::HandleMetaSyncResponse(void* arg).

* add address/thread sanitizer to CMakeLists

---------

Co-authored-by: cjh <[email protected]>

* refactor: replace pstd/env with std::filesystem (OpenAtomFoundation#1470)

* fix bug issue 1554: using unique_ptr.reset to fix the SIGABRT error (OpenAtomFoundation#1595)

using unique_ptr.reset to fix the SIGABRT error && using time-wait lock to notify quickly

* fix: incorrect manner of terminating the process (OpenAtomFoundation#1596)

* fix issue#1597: add rocksdb dependency to pstd (OpenAtomFoundation#1599)

* fix g++15 compile failure

* add rocksdb dependency to pstd

---------

Co-authored-by: J1senn <[email protected]>

* fix_info_command

* fix: gcc13 compile failed (OpenAtomFoundation#1601)

* ci: add unit test to github action (OpenAtomFoundation#1604)

* ci: add unit test in github workflow

* chore:change `PLATFORM` field logic (OpenAtomFoundation#1615)

* fix issue 1517: scan 命令不支持 type 参数 (OpenAtomFoundation#1582)

* fix: the unit test of type/set (OpenAtomFoundation#1617)

* test: optimize the return results of srandmember to avoid approximate results

* fix: use last_seed for random engine

* [fix issue1621] fix deadlock (OpenAtomFoundation#1620)

* [fix] fix deadlock

* [fix] fix

* command `type` and `ptype` add unit test

* fix member variable initialization

* Update issue templates

* feat: supported 'ptype' command

* fix unit test:type/set (OpenAtomFoundation#1577)

* fix issue#1597: add rocksdb dependency to pstd (OpenAtomFoundation#1599)

* fix g++15 compile failure

* add rocksdb dependency to pstd

---------

Co-authored-by: J1senn <[email protected]>

* fix: gcc13 compile failed (OpenAtomFoundation#1601)

* fix: the unit test of type/set (OpenAtomFoundation#1617)

* test: optimize the return results of srandmember to avoid approximate results

* fix: use last_seed for random engine

* Modify other modules to use the new `type` function

* fix function repeat

---------

Co-authored-by: Yuecai Liu <[email protected]>
Co-authored-by: liuyuecai <[email protected]>
Co-authored-by: Peter Chan <[email protected]>
Co-authored-by: chenbt <[email protected]>
Co-authored-by: Junhua Chen <[email protected]>
Co-authored-by: cjh <[email protected]>
Co-authored-by: kang jinci <[email protected]>
Co-authored-by: Xin.Zh <[email protected]>
Co-authored-by: machinly <[email protected]>
Co-authored-by: A2ureStone <[email protected]>
Co-authored-by: J1senn <[email protected]>
Co-authored-by: chejinge <[email protected]>
Co-authored-by: baerwang <[email protected]>
Co-authored-by: ptbxzrt <[email protected]>
Co-authored-by: 你不要过来啊 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants