-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Supports Centos on CI #1772
Changes from all commits
4f26516
9b6fa1b
fe61a29
91c3345
1669d94
a23fa93
95d463e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ env: | |
BUILD_TYPE: RelWithDebInfo | ||
|
||
jobs: | ||
build: | ||
build_on_ubuntu: | ||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | ||
# You can convert this to a matrix build if you need cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
|
@@ -86,49 +86,62 @@ jobs: | |
run: | | ||
yum install -y wget git autoconf centos-release-scl | ||
yum install -y devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-make devtoolset-10-bin-util | ||
yum install -y llvm-toolset-7 | ||
yum install -y llvm-toolset-7-clang | ||
yum install -y llvm-toolset-7 llvm-toolset-7-clang tcl unzip which python3 | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install redis | ||
source /opt/rh/devtoolset-10/enable | ||
gcc --version | ||
make --version | ||
|
||
python3 --version | ||
|
||
- name: Install cmake | ||
run: | | ||
wget https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-x86_64.sh | ||
bash ./cmake-3.26.4-linux-x86_64.sh --skip-license --prefix=/usr | ||
cmake --version | ||
|
||
- name: checkout | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
echo Fetching $GITHUB_REPOSITORY@$GITHUB_SHA | ||
git init | ||
git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY $GITHUB_SHA | ||
git checkout $GITHUB_SHA | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure CMake | ||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
run: | | ||
source /opt/rh/devtoolset-10/enable | ||
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_PIKA_TOOLS=ON | ||
cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DUSE_PIKA_TOOLS=ON | ||
|
||
- name: Build | ||
# Build your program with the given configuration | ||
run: | | ||
cd ${{github.workspace}} | ||
source /opt/rh/devtoolset-10/enable | ||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | ||
cmake --build build --config ${{env.BUILD_TYPE}} | ||
|
||
- name: Test | ||
# Execute tests defined by the CMake configuration. | ||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | ||
run: | | ||
cd ${{github.workspace}}/build | ||
source /opt/rh/devtoolset-10/enable | ||
ctest -C ${{env.BUILD_TYPE}} | ||
|
||
- name: Unit Test | ||
run: | | ||
chmod +x pikatests.sh | ||
sh pikatests.sh all | ||
|
||
# master on port 9221, slave on port 9231, all with 2 db | ||
- name: Start pika master and slave | ||
run: | | ||
cd build | ||
chmod +x ../tests/integration/start_master_and_slave.sh | ||
sh ../tests/integration/start_master_and_slave.sh | ||
|
||
- name: Run Python E2E Tests | ||
run: | | ||
python3 tests/integration/pika_replication_test.py | ||
python3 tests/unit/Blpop_Brpop_test.py | ||
|
||
build_on_macos: | ||
runs-on: macos-latest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here are some bug risks and improvement suggestions for the code patch:
These are suggestions based on the provided code, but please note that a more thorough review may require understanding the overall context and requirements of your project. |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overall, the code patch looks good. Here are a few suggestions and improvements:
Remember to test the updated workflow thoroughly to ensure all the modifications work as expected. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overall, the code patch includes several improvements and bug fixes. Here are some suggestions for further improvement:
Remember, these suggestions are based on a superficial review of the code patch. It's always important to thoroughly test the changes and consider the specific requirements and constraints of your project. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overall, the code patch looks fine, but there are a few bug risks and improvement suggestions:
These suggestions aim to improve code readability, maintainability, and overall reliability of the workflow. It's important to thoroughly test and validate the workflow changes before applying them to production environments. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overall, the code patch seems to have some improvements and bug fixes. Here are a few suggestions for further improvement:
Remember to thoroughly test the updated workflow to verify its correctness and effectiveness. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overall, the code patch looks fine, but there are a few suggestions and improvements that can be made:
These suggestions are aimed at improving code clarity and reliability. Remember to thoroughly test the code patch after making these changes to ensure it works as expected. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here are some observations and suggestions for the code patch:
It's important to note that a complete code review would require analyzing the context and purpose of the entire workflow where this code patch is being integrated. This assessment is based solely on the provided code patch. |
||
|
@@ -161,11 +174,11 @@ jobs: | |
cmake -B ${{github.workspace}}/build -S . -DCMAKE_C_COMPILER=/usr/local/opt/gcc@10/bin/gcc-10 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | ||
|
||
- name: Test | ||
working-directory: ${{github.workspace}}/build | ||
run: | | ||
export CC=/usr/local/opt/gcc@10/bin/gcc-10 | ||
ctest -C ${{env.BUILD_TYPE}} | ||
- name: Test | ||
working-directory: ${{github.workspace}}/build | ||
run: | | ||
export CC=/usr/local/opt/gcc@10/bin/gcc-10 | ||
ctest -C ${{env.BUILD_TYPE}} | ||
|
||
- name: Unit Test | ||
working-directory: ${{github.workspace}} | ||
|
@@ -176,7 +189,7 @@ jobs: | |
- name: Start pika master and slave | ||
working-directory: ${{github.workspace}}/build | ||
run: | | ||
cd ${{github.workspace}}/build | ||
cd ${{github.workspace}}/build | ||
chmod +x ../tests/integration/start_master_and_slave.sh | ||
../tests/integration/start_master_and_slave.sh | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ def test_single_existing_list(db_): | |
assert result[0] == b'blist' and result[1] == b'b', f"Expected (b'blist1', b'b'), but got {result}" | ||
|
||
pika.close() | ||
print("test_single_existing_list Passed [✓], db:db%d" % (db_)) | ||
print("test_single_existing_list Passed [Passed], db:db%d" % (db_)) | ||
|
||
|
||
# 解阻塞测试(超时自动解阻塞,lpush解阻塞,rpush解阻塞,rpoplpush解阻塞) | ||
|
@@ -213,7 +213,7 @@ def brpop_thread51(): | |
assert blocked == False, f"Expected False but got {blocked}" | ||
thread.join() | ||
pika.close() | ||
print("test_blpop_brpop_unblock_lrpush_rpoplpush Passed [✓], db:db%d" % (db_)) | ||
print("test_blpop_brpop_unblock_lrpush_rpoplpush Passed [Passed], db:db%d" % (db_)) | ||
|
||
|
||
def test_concurrency_block_unblock(db_): | ||
|
@@ -350,7 +350,7 @@ def rpush_thread(list_, value_): | |
t.join() | ||
pika.delete('blist0', 'blist1', 'blist2', 'blist3') | ||
|
||
print("test_concurrency_block_unblock Passed [✓], db:db%d" % (db_)) | ||
print("test_concurrency_block_unblock Passed [Passed], db:db%d" % (db_)) | ||
pika.close() | ||
|
||
|
||
|
@@ -396,7 +396,7 @@ def test_multiple_existing_lists(db_): | |
assert result[0] == b'blist1' and result[1] == b'large', f"Expected (b'blist1', b'large'), but got {result}" | ||
|
||
pika.close() | ||
print("test_multiple_existing_lists Passed [✓], db:db%d" % (db_)) | ||
print("test_multiple_existing_lists Passed [Passed], db:db%d" % (db_)) | ||
|
||
|
||
def test_blpop_brpop_same_key_multiple_times(db_): | ||
|
@@ -488,7 +488,7 @@ def brpop_thread2(): | |
assert result[0] == b'list2' and result[1] == b'd', f"Expected (b'list2', b'd'), but got {result}" | ||
|
||
pika.close() | ||
print("test_blpop_brpop_same_key_multiple_times Passed [✓], db:db%d" % (db_)) | ||
print("test_blpop_brpop_same_key_multiple_times Passed [Passed], db:db%d" % (db_)) | ||
|
||
|
||
# 目标list被一条push增加了多个value,先完成多个value的入列再pop | ||
|
@@ -542,7 +542,7 @@ def brpop_thread(): | |
thread.join() | ||
# 检查blist的第一个元素 | ||
assert pika.lindex('blist', 0) == b'foo', "Expected 'foo'" | ||
print("test_blpop_brpop_variadic_lpush Passed [✓], db:db%d" % (db_)) | ||
print("test_blpop_brpop_variadic_lpush Passed [Passed], db:db%d" % (db_)) | ||
|
||
|
||
# 先被阻塞的先服务/阻塞最久的优先级最高 | ||
|
@@ -587,7 +587,7 @@ def brpop_thread(expect): | |
t4.join() | ||
|
||
pika.close() | ||
print("test_serve_priority Passed [✓], db:db%d" % (db_)) | ||
print("test_serve_priority Passed [Passed], db:db%d" % (db_)) | ||
|
||
|
||
# 主从复制测试 | ||
|
@@ -813,7 +813,7 @@ def rpush_thread(list_, value_, value2_, value3_, value4_, value5_): | |
|
||
master.close() | ||
slave.close() | ||
print("test_master_slave_replication Passed [✓], db:db%d" % (db_)) | ||
print("test_master_slave_replication Passed [Passed], db:db%d" % (db_)) | ||
|
||
def test_with_db(db_id): | ||
test_master_slave_replication(db_id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here are a few suggestions to improve the code:
Overall, the code appears to be mostly focused on printing some success messages and assertions. Without a complete understanding of the context and requirements, it's difficult to identify specific bug risks or suggest further improvements. It's recommended to thoroughly test the code with different scenarios to ensure its correctness and efficiency. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overall, the code patch seems to be mostly focused on modifying print statements to change the output messages. There don't appear to be any bug risks or improvement suggestions based on the provided context. However, here are a few general good practices for code review:
Remember, without the full context of the code and its purpose, it's difficult to provide specific improvements or identify potential bugs. It's always a good practice to thoroughly test your code with different scenarios to ensure its correctness and reliability. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on the code patch, here are some observations and suggestions:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on the provided code patch, here are some potential bug risks and improvement suggestions:
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some code review suggestions for the given code patch:
It seems that a new job called
build_on_ubuntu
has been added, while the existingbuild
job is commented out. Make sure this change aligns with your intended workflow.In the
Upload workspace artifact
step, you can consider specifying a different path for the uploaded artifact to avoid potential conflicts with existing files or directories. For example, instead of using the root directory, you can specify a subdirectory within the artifact space.The commented-out
Test
step can be re-enabled and modified to execute the desired test command after the build. Adjust the commands to match your project's test setup.In the
Download workspace artifact
step, you may want to consider providing a specific version or using a unique name for the downloaded artifact to avoid using conflicting or outdated artifacts.If the symbolic link creation in the
Create build soft link
step is necessary for subsequent steps, make sure it points to the correct target location. Verify the paths and adjust accordingly.In the
Unzip workspace directory
step, consider specifying a destination directory other than/github/workspace/artifacts
. Using a dedicated directory for unzipping might prevent conflicts with existing files or directories.In the
Unit Test
step, make sure that the paths and directories accessed by the commands are accurate and point to the correct locations. Double-check the paths and adjust if needed.Ensure that all required dependencies and packages are installed properly in each platform-specific block (
run
) based on your project's needs.Remember to thoroughly test the workflow after implementing these changes to ensure everything works as expected.