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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
44 changes: 33 additions & 11 deletions .github/workflows/full-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:

- name: Install dependencies
run: |
brew install --overwrite go mage wget node
brew install --overwrite go mage wget node docker colima docker-credential-helper
pip3 install -r test/requirements.txt

- name: Install etcd
Expand All @@ -175,23 +175,41 @@ jobs:
TT_CLI_BUILD_SSL: 'static'
run: mage build

- name: Install tarantool
# - name: Install tarantool
# run: |
# ./tt init
# ./tt install tarantool 3.0.2
# # Delete the tt config so that it does not affect the test environment.
# rm -f tt.yaml
#
# - name: Add Tarantool to Path
# run: |
# echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH

- name: Set Tarantool include directory to the environment
run: |
./tt init
./tt install tarantool 3.0.2
# Delete the tt config so that it does not affect the test environment.
rm -f tt.yaml
echo "TT_CLI_TARANTOOL_PREFIX=${GITHUB_WORKSPACE}/include/" >> $GITHUB_ENV

- name: Add Tarantool to Path
- name: Start colima and patch mount options
# Also we need to delete line with 'credSotre' to download docker image.
run: |
echo "${GITHUB_WORKSPACE}/bin" >> $GITHUB_PATH
colima start --vm-type vz --mount /private/var/folders:w

- name: Set Tarantool include directory to the environment
- name: Print docker config
run: |
echo "TT_CLI_TARANTOOL_PREFIX=${GITHUB_WORKSPACE}/include/" >> $GITHUB_ENV
cat ~/.docker/config.json
docker rmi -f $(docker images -aq)

# - name: Docker build
# run: docker build -t ubuntu:tt_test cli/docker/testdata/

- name: Run unit tests
run: mage unitfull
# run: mage -v unitfull
run: go test -C cli/docker -tags integration,integration_docker

- name: Print logs
if: always()
run: cat /tmp/out.log

- name: Integration tests
run: mage integrationfull
Expand All @@ -212,6 +230,10 @@ jobs:
TARANTOOL_BIN=${GITHUB_WORKSPACE}/bin/tarantool;
pkill -SIGINT -f ${TARANTOOL_BIN} || true

- name: Kill colima
if: always()
run: colima delete

# ee suffix means that the job runs ee integration tests.
full-ci-macOS-ee:
if: |
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:

- name: Install dependencies
run: |
brew install --overwrite go mage node
brew install --overwrite go mage node docker colima
pip3 install -r test/requirements.txt

- name: Install etcd
Expand Down Expand Up @@ -189,6 +189,9 @@ jobs:
- name: Unit tests
run: mage unit

- name: Start colima and patch mount options
run: colima start --vm-type vz --mount /private/var/folders:w

- name: Run integration tests
run: mage integration

Expand All @@ -201,3 +204,7 @@ jobs:
run: |
ETCD_TT_BIN=${ETCD_PATH}etcd;
pkill -SIGINT -f ${ETCD_TT_BIN} || true

- name: Kill colima
if: always()
run: colima delete
10 changes: 7 additions & 3 deletions cli/docker/docker_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ func TestBuildImage(t *testing.T) {
client.WithAPIVersionNegotiation())
require.NoError(t, err)
defer dockerClient.Close()
// defer t.Cleanup(func() { findAndRemoveBuiltImage(t, dockerClient, "ubuntu:tt_test") })

require.NoError(t, buildDockerImage(dockerClient, "ubuntu:tt_test", "testdata", false,
os.Stdout))
findAndRemoveBuiltImage(t, dockerClient, "ubuntu:tt_test")
out, err := os.Create(filepath.Join("/tmp", "out.log"))
require.NoError(t, err)

require.NoError(t, buildDockerImage(dockerClient, "ubuntu:tt_test", "testdata", true,
out))
findAndRemoveBuiltImage(t, dockerClient, "ubuntu:tt_test")
}

func TestBuildImageFail(t *testing.T) {
Expand Down
Loading