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: fix macos tests #947

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/full-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,20 @@ jobs:
run: |
echo "TT_CLI_TARANTOOL_PREFIX=${GITHUB_WORKSPACE}/include/" >> $GITHUB_ENV

# Sometimes CI on macOS terminates with a “docker daemon not running” error.
# To prevent this we set the path to the docker socket directly.
- name: Prepare Docker
run: |
echo "DOCKER_HOST=unix:///${HOME}/.docker/run/docker.sock" >> $GITHUB_ENV
psergee marked this conversation as resolved.
Show resolved Hide resolved
docker context use default

- name: Run unit tests
run: mage unitfull

# We need to override TMPDIR here because of the very long path in macOS tests
# which causes a very long socket path error.
- name: Integration tests
run: mage integrationfull
run: TMPDIR=/tmp mage integrationfull
psergee marked this conversation as resolved.
Show resolved Hide resolved

# Etcd can be still running after integration tests when:
# 1. pytest recieve SIGALRM (can be caused by pytest-timeout plugin)
Expand All @@ -207,12 +216,6 @@ jobs:
ETCD_TT_BIN=${ETCD_PATH}etcd;
pkill -SIGINT -f ${ETCD_TT_BIN} || true

- name: Kill tarantool, if it was left
if: always()
run: |
TARANTOOL_BIN=${GITHUB_WORKSPACE}/bin/tarantool;
pkill -SIGINT -f ${TARANTOOL_BIN} || true

# ee suffix means that the job runs ee integration tests.
full-ci-macOS-ee:
if: |
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,20 @@ jobs:
run: |
echo "TT_CLI_TARANTOOL_PREFIX=${GITHUB_WORKSPACE}/include/" >> $GITHUB_ENV

# Sometimes CI on macOS terminates with a “docker daemon not running” error.
# To prevent this we set the path to the docker socket directly.
- name: Prepare Docker
run: |
echo "DOCKER_HOST=unix:///${HOME}/.docker/run/docker.sock" >> $GITHUB_ENV
docker context use default

- name: Unit tests
run: mage unit

# We need to override TMPDIR here because of the very long path in macOS tests
# which causes a very long socket path error.
- name: Run integration tests
run: mage integration
run: TMPDIR=/tmp mage integration

# Etcd can be still running after integration tests when:
# 1. pytest recieve SIGALRM (can be caused by pytest-timeout plugin)
Expand Down
4 changes: 2 additions & 2 deletions cli/connector/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ func runTestMain(m *testing.M) int {
WorkDir: workDir,
User: opts.User,
Pass: opts.Pass,
WaitStart: time.Second,
WaitStart: 5 * time.Second,
ConnectRetry: 5,
RetryTimeout: 200 * time.Millisecond,
RetryTimeout: 100 * time.Millisecond,
})
defer test_helpers.StopTarantoolWithCleanup(inst)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions cli/replicaset/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
)

const workDir = "work_dir"
const server = "127.0.0.1:3013"
const server = "127.0.0.1:3015"
const console = workDir + "/" + "console.control"

var opts = tarantool.Opts{
Expand Down Expand Up @@ -166,7 +166,7 @@ func (e *instanceEvalerMock) Eval(instance running.InstanceCtx,
require.NotNil(e.T, evaler)
data, err := evaler.Eval("return box.cfg.listen", []any{}, connector.RequestOpts{})
require.NoError(e.T, err)
require.Equal(e.T, []any{"127.0.0.1:3013"}, data)
require.Equal(e.T, []any{"127.0.0.1:3015"}, data)

return e.Done, e.Error
}
Expand Down Expand Up @@ -551,9 +551,9 @@ func runTestMain(m *testing.M) int {
WorkDir: workDir,
User: opts.User,
Pass: opts.Pass,
WaitStart: time.Second,
WaitStart: 5 * time.Second,
ConnectRetry: 5,
RetryTimeout: 200 * time.Millisecond,
RetryTimeout: 100 * time.Millisecond,
})
defer test_helpers.StopTarantoolWithCleanup(inst)
if err != nil {
Expand Down
Loading