Skip to content

Commit

Permalink
Optimize mmctl CI run (mattermost#24732)
Browse files Browse the repository at this point in the history
* Optimize mmctl CI run

- Remove coverage mode. They increase run time by 3x.
- Remove -race mode in PR builds. They increase run time by 2x and memory consumption as well.

```release-note
NONE
```

* caching go.sum path

```release-note
NONE
```
  • Loading branch information
agnivade authored Oct 6, 2023
1 parent e440ba0 commit fcf2385
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/mmctl-test-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
go-version: ${{ env.go-version }}
cache-dependency-path: server/go.sum
- name: Run setup-go-work
run: |
cd server
Expand All @@ -47,6 +48,9 @@ jobs:
docker-compose --ansi never ps
- name: Run mmctl Tests
run: |
if [[ ${{ github.ref_name }} == 'master' ]]; then
export MMCTL_TESTFLAGS="-timeout 30m -race"
fi
docker run --net ghactions_mm-test \
--ulimit nofile=8096:8096 \
--env-file=server/build/dotenv/test.env \
Expand All @@ -56,7 +60,7 @@ jobs:
-v $PWD:/mattermost \
-w /mattermost/server \
$BUILD_IMAGE \
make test-mmctl-coverage BUILD_NUMBER=$GITHUB_HEAD_REF-$GITHUB_RUN_ID
make test-mmctl BUILD_NUMBER=$GITHUB_HEAD_REF-$GITHUB_RUN_ID
- name: Stop docker compose
run: |
cd server/build
Expand Down
2 changes: 1 addition & 1 deletion server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ GOTESTSUM_JSONFILE ?= gotestsum.json

# mmctl
MMCTL_BUILD_TAGS =
MMCTL_TESTFLAGS = -timeout 30m -race
MMCTL_TESTFLAGS ?= -timeout 30m
MMCTL_PKG = github.com/mattermost/mattermost/server/v8/cmd/mmctl/commands
LDFLAGS += -X "$(MMCTL_PKG).gitCommit=$(BUILD_HASH)"
LDFLAGS += -X "$(MMCTL_PKG).gitTreeState=$(GIT_TREESTATE)"
Expand Down

0 comments on commit fcf2385

Please sign in to comment.