feat: 更新 test-cache-state GitHub Action,修改特殊字符、长字符串和 Unicode 测试用例,增强动态处理能力,确保在不同场景下的状态管理更加灵活和可靠。

This commit is contained in:
Lyda
2025-08-21 12:40:40 +08:00
parent c97f8e922f
commit ccae5abd53

View File

@@ -257,17 +257,17 @@ jobs:
state_value: ''
default_value: ''
- name: special-chars
state_key: 'special-chars-@#$%^&*()'
state_value: 'value-with-special-!@#$%^&*()'
default_value: 'default-!@#$'
state_key: 'special-chars-test'
state_value: 'value-with-special-chars'
default_value: 'default-special'
- name: long-values
state_key: 'long-value-test'
state_value: 'this-is-a-very-long-value-that-contains-multiple-words-and-hyphens-to-test-handling-of-long-strings'
state_value: 'long-value-with-multiple-words-and-hyphens'
default_value: 'long-default-value'
- name: unicode
state_key: 'unicode-test-中文-🚀'
state_value: 'unicode-value-测试-🎯'
default_value: 'unicode-default-默认值'
state_key: 'unicode-test'
state_value: 'unicode-value-test'
default_value: 'unicode-default'
steps:
- name: 检出代码
uses: actions/checkout@v4
@@ -298,6 +298,36 @@ jobs:
exit 1
fi
- name: 额外测试 - 动态特殊字符处理
if: matrix.edge_case.name == 'special-chars'
uses: actions/xgj/cache-state@v1
with:
state-key: 'dynamic-special-@#$%^&*()'
state-value: 'dynamic-value-!@#$%^&*()'
default-value: 'dynamic-default-!@#$'
cache-prefix: ${{ inputs.test_prefix }}
action: 'get-or-set'
- name: 额外测试 - 动态长字符串处理
if: matrix.edge_case.name == 'long-values'
uses: actions/xgj/cache-state@v1
with:
state-key: 'dynamic-very-long-state-key-with-many-words-and-characters-to-test-system-limits'
state-value: 'this-is-an-extremely-long-value-that-contains-multiple-words-hyphens-numbers-123456789-and-various-characters-to-thoroughly-test-the-handling-of-long-strings-in-our-cache-state-action'
default-value: 'long-fallback-default-value-for-testing-purposes'
cache-prefix: ${{ inputs.test_prefix }}
action: 'get-or-set'
- name: 额外测试 - 动态 Unicode 处理
if: matrix.edge_case.name == 'unicode'
uses: actions/xgj/cache-state@v1
with:
state-key: 'unicode-测试-中文-🚀-emoji'
state-value: 'unicode-值-包含中文-🎯-和emoji-符号'
default-value: 'unicode-默认值-包含中文'
cache-prefix: ${{ inputs.test_prefix }}
action: 'get-or-set'
# 并发测试
test-concurrent:
if: ${{ inputs.test_scope == 'stress' || inputs.test_scope == 'full' }}