-
Couldn't load subscription status.
- Fork 0
driver: implement TCS driver for tarantool support #10
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
Open
bigbes
wants to merge
1
commit into
master
Choose a base branch
from
elhimov/tntp-4188-implement-tkv-driver
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: "Prepare test environment with Tarantool EE" | ||
| description: "Prepares test environment with Tarantool EE" | ||
|
|
||
| inputs: | ||
| sdk-version: | ||
| required: true | ||
| type: string | ||
| sdk-build: | ||
| required: false | ||
| type: string | ||
| default: release | ||
| sdk-gc: | ||
| required: false | ||
| type: string | ||
| default: gc64 | ||
| sdk-download-token: | ||
| required: true | ||
| type: string | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Cache Tarantool SDK | ||
| id: cache-sdk | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: tarantool-enterprise | ||
| key: ${{ matrix.sdk-version }} | ||
|
|
||
| - name: Download Tarantool SDK | ||
| run: | | ||
| ARCHIVE_NAME=tarantool-enterprise-sdk-${{ inputs.sdk-gc }}-${{ inputs.sdk-version }}.tar.gz | ||
| ARCHIVE_PATH=$(echo ${{ inputs.sdk-version }} | sed -rn \ | ||
| 's/^([0-9]+)\.([0-9]+)\.([0-9]+-){2}([a-z0-9]+-)?r[0-9]+\.([a-z]+)\.([a-z0-9_]+)$/${{ inputs.sdk-build }}\/\5\/\6\/\1\.\2/p') | ||
| curl -O -L \ | ||
| https://${{ inputs.sdk-download-token }}@download.tarantool.io/enterprise/${ARCHIVE_PATH}/${ARCHIVE_NAME} | ||
| if [ $(stat -c%s "${ARCHIVE_NAME}") -eq 0 ]; then | ||
| echo "Failed to download Tarantool EE SDK: '${ARCHIVE_PATH}/${ARCHIVE_NAME}'" | ||
| exit 1 | ||
| fi | ||
| tar -xzf ${ARCHIVE_NAME} | ||
| rm -f ${ARCHIVE_NAME} | ||
| source tarantool-enterprise/env.sh | ||
| shell: bash | ||
|
|
||
| - name: Add SDK to PATH and set TARANTOOL_SDK_PATH variable | ||
| run: | | ||
| SDK_PATH="$(realpath tarantool-enterprise)" | ||
| echo "${SDK_PATH}" >> ${GITHUB_PATH} | ||
| echo "TARANTOOL_SDK_PATH=${SDK_PATH}" >> ${GITHUB_ENV} | ||
| shell: bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,57 @@ | ||||||
| name: tcs.yaml | ||||||
| on: | ||||||
| pull_request_target: | ||||||
| types: [ labeled ] | ||||||
|
|
||||||
| env: | ||||||
| # Note: Use exactly match version of tool, to avoid unexpected issues with test on CI. | ||||||
| GO_VERSION: '1.24.9' | ||||||
|
|
||||||
| jobs: | ||||||
| full-ci-ee: | ||||||
| # Tests will run only when the pull request is labeled with `full-ci`. To | ||||||
| # avoid security problems, the label must be reset manually for every run. | ||||||
| # | ||||||
| # We need to use `pull_request_target` because it has access to base | ||||||
| # repository secrets unlike `pull_request`. | ||||||
| if: (github.event_name == 'push') || | ||||||
| (github.event_name == 'pull_request_target' && | ||||||
| github.event.action == 'labeled' && | ||||||
| github.event.label.name == 'full-ci') || | ||||||
| (github.event_name == 'pull_request' && | ||||||
| github.event.action == 'synchronize' && | ||||||
| github.event.pull_request.head.repo.full_name == github.repository && | ||||||
| contains(github.event.pull_request.labels.*.name, 'full-ci')) | ||||||
| runs-on: ubuntu-22.04 | ||||||
| strategy: | ||||||
| matrix: | ||||||
| sdk-version: | ||||||
| - "3.5.0-0-r70.linux.x86_64" | ||||||
| fail-fast: false | ||||||
| steps: | ||||||
| # `ref` as merge request is needed for pull_request_target because this | ||||||
| # target runs in the context of the base commit of the pull request. | ||||||
| - uses: actions/checkout@v4 | ||||||
| if: github.event_name == 'pull_request_target' | ||||||
| with: | ||||||
| fetch-depth: 0 | ||||||
| ref: ${{ github.event.pull_request.head.sha }} | ||||||
|
|
||||||
| - uses: actions/checkout@v4 | ||||||
| if: github.event_name != 'pull_request_target' | ||||||
| with: | ||||||
| fetch-depth: 0 | ||||||
|
|
||||||
| - name: Prepare EE env | ||||||
| uses: ./.github/actions/prepare-ee-test-env | ||||||
| with: | ||||||
| sdk-version: '${{ matrix.sdk-version }}' | ||||||
| sdk-download-token: '${{ secrets.SDK_DOWNLOAD_TOKEN }}' | ||||||
|
|
||||||
| - name: Integration tests | ||||||
| run: | ||||||
| go test ./... -count=1 -v | ||||||
oleg-jukovec marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| - name: Integration tests | ||||||
| run: | ||||||
| go test ./... -count=100 -v -race | ||||||
|
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. Do we need it here?
Suggested change
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| package tcs | ||
|
|
||
| import ( | ||
| "fmt" | ||
| ) | ||
|
|
||
| // DecodingError represents an error that occurs during decoding operations. | ||
| type DecodingError struct { | ||
| ObjectType string | ||
| Text string | ||
| Err error | ||
| } | ||
|
|
||
| // Error returns the error message. | ||
| func (e DecodingError) Error() string { | ||
| suffix := e.ObjectType | ||
| if e.Text != "" { | ||
| suffix = fmt.Sprintf("%s, %s", suffix, e.Text) | ||
| } | ||
|
|
||
| return fmt.Sprintf("failed to decode %s: %s", suffix, e.Err) | ||
| } | ||
|
|
||
| func (e DecodingError) Unwrap() error { | ||
| return e.Err | ||
| } | ||
|
|
||
| // NewTxnOpResponseDecodingError returns a new txnOpResponse decoding error. | ||
| func NewTxnOpResponseDecodingError(err error) error { | ||
| if err == nil { | ||
| return nil | ||
| } | ||
|
|
||
| return DecodingError{ | ||
| ObjectType: "txnOpResponse", | ||
| Text: "", | ||
| Err: err, | ||
| } | ||
| } | ||
|
|
||
| // EncodingError represents an error that occurs during encoding operations. | ||
| type EncodingError struct { | ||
| ObjectType string | ||
| Text string | ||
| Err error | ||
| } | ||
|
|
||
| // Error returns the error message. | ||
| func (e EncodingError) Error() string { | ||
| if e.Text == "" { | ||
| return fmt.Sprintf("failed to encode %s: %s", e.ObjectType, e.Err) | ||
| } | ||
|
|
||
| return fmt.Sprintf("failed to encode %s, %s: %s", e.ObjectType, e.Text, e.Err) | ||
| } | ||
|
|
||
| func (e EncodingError) Unwrap() error { | ||
| return e.Err | ||
| } | ||
|
|
||
| // NewOperationEncodingError returns a new operation encoding error. | ||
| func NewOperationEncodingError(text string, err error) error { | ||
| if err == nil { | ||
| return nil | ||
| } | ||
|
|
||
| return EncodingError{ | ||
| ObjectType: "operation", | ||
| Text: text, | ||
| Err: err, | ||
| } | ||
| } | ||
|
|
||
| // NewPredicateEncodingError returns a new predicate encoding error. | ||
| func NewPredicateEncodingError(text string, err error) error { | ||
| if err == nil { | ||
| return nil | ||
| } | ||
|
|
||
| return EncodingError{ | ||
| ObjectType: "predicate", | ||
| Text: text, | ||
| Err: err, | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.