mattermost / mattermost-plugin-starter-template

Build scripts and templates for writing Mattermost plugins.
https://developers.mattermost.com/extend/plugins/
Apache License 2.0
129 stars 120 forks source link

Build fail #134

Closed vladimirshikhov closed 3 years ago

vladimirshikhov commented 3 years ago

after make command:

Checking for style guide compliance
cd webapp && npm run lint

> @ lint /home/vovan/mattermost_plugin/com.example.my-plugin/webapp
> eslint --ignore-pattern node_modules --ignore-pattern dist --ext .js --ext .jsx --ext tsx --ext ts . --quiet --cache

cd webapp && npm run check-types

> @ check-types /home/vovan/mattermost_plugin/com.example.my-plugin/webapp
> tsc

Running golangci-lint
golangci-lint run ./...
/usr/bin/go test -v -race ./server/...
=== RUN   TestServeHTTP
--- PASS: TestServeHTTP (0.00s)
PASS
ok      github.com/mattermost/mattermost-plugin-starter-template/server (cached)
cd webapp && /home/vovan/.nvm/versions/node/v12.18.3/bin/npm run test;

> @ test /home/vovan/mattermost_plugin/com.example.my-plugin/webapp
> jest --forceExit --detectOpenHandles --verbose

 PASS  src/manifest.test.ts
  ✓ Plugin manifest, id and version are defined (3 ms)
  ✓ Plugin id and version are defined (2 ms)

Test Suites: 1 passed, 1 total
Tests:       2 passed, 2 total
Snapshots:   0 total
Time:        2.876 s, estimated 3 s
Ran all test suites.
cd ./build/sync && /usr/bin/go test -v -race ./...
go: downloading sigs.k8s.io/yaml v1.2.0
go: downloading gopkg.in/src-d/go-git.v4 v4.13.1
go: downloading github.com/emirpasic/gods v1.12.0
go: downloading github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99
go: downloading gopkg.in/src-d/go-billy.v4 v4.3.2
go: downloading github.com/sergi/go-diff v1.0.0
go: downloading github.com/src-d/gcfg v1.4.0
go: downloading github.com/xanzy/ssh-agent v0.2.1
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd
go: downloading golang.org/x/sys v0.0.0-20200817155316-9781c653f443
go: downloading gopkg.in/warnings.v0 v0.1.2
?       github.com/mattermost/mattermost-plugin-starter-template/build/sync [no test files]
=== RUN   TestCopyDirectory
--- PASS: TestCopyDirectory (0.00s)
=== RUN   TestOverwriteFileAction
--- PASS: TestOverwriteFileAction (0.00s)
=== RUN   TestOverwriteDirectoryAction
--- PASS: TestOverwriteDirectoryAction (0.00s)
=== RUN   TestRepoIsCleanChecker
--- PASS: TestRepoIsCleanChecker (0.00s)
=== RUN   TestPathExistsChecker
--- PASS: TestPathExistsChecker (0.00s)
=== RUN   TestUnalteredChecker
    checks_test.go:101: 
            Error Trace:    checks_test.go:101
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestUnalteredChecker
    checks_test.go:120: 
            Error Trace:    checks_test.go:120
            Error:          Should be true
            Test:           TestUnalteredChecker
    checks_test.go:121: 
            Error Trace:    checks_test.go:121
            Error:          Error message not equal:
                            expected: "file \"/tmp/test474968979/build/sync/plan/testdata/a\" has been altered"
                            actual  : "object not found"
            Test:           TestUnalteredChecker
--- FAIL: TestUnalteredChecker (0.00s)
=== RUN   TestUnmarshalPlan
--- PASS: TestUnmarshalPlan (0.00s)
=== RUN   TestRunPlanSuccessfully
UPDATED somepath
--- PASS: TestRunPlanSuccessfully (0.00s)
=== RUN   TestRunPlanPreCheckFail
--- PASS: TestRunPlanPreCheckFail (0.00s)
=== RUN   TestRunPlanActionCheckFails
UPDATED somepath
--- PASS: TestRunPlanActionCheckFails (0.00s)
=== RUN   TestRunPlanNoFallbacks
FAILED  somepath: check failed, fail
--- PASS: TestRunPlanNoFallbacks (0.00s)
=== RUN   TestRunPlanCheckError
--- PASS: TestRunPlanCheckError (0.00s)
=== RUN   TestRunPlanActionError
action failed: fail
--- PASS: TestRunPlanActionError (0.00s)
FAIL
FAIL    github.com/mattermost/mattermost-plugin-starter-template/build/sync/plan    0.026s
=== RUN   TestFileHistory
    file_history_test.go:20: 
            Error Trace:    file_history_test.go:20
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestFileHistory
    file_history_test.go:21: 
            Error Trace:    file_history_test.go:21
            Error:          []string(nil) does not contain "ba7192052d7cf77c55d3b7bf40b350b8431b208b"
            Test:           TestFileHistory
    file_history_test.go:25: 
            Error Trace:    file_history_test.go:25
            Error:          Not equal: 
                            expected: &errors.errorString{s:"not found"}
                            actual  : &errors.errorString{s:"object not found"}

                            Diff:
                            --- Expected
                            +++ Actual
                            @@ -1,3 +1,3 @@
                             (*errors.errorString)({
                            - s: (string) (len=9) "not found"
                            + s: (string) (len=16) "object not found"
                             })
            Test:           TestFileHistory
--- FAIL: TestFileHistory (0.01s)
FAIL
FAIL    github.com/mattermost/mattermost-plugin-starter-template/build/sync/plan/git    0.024s
FAIL
make: *** [Makefile:189: test] Ошибка 1
hanzei commented 3 years ago

Hm, I can't reproduce this locally.

What commit did you use? And which go version are you running?

vladimirshikhov commented 3 years ago

Hi ! commit a09b4949fe0c9c9a9ed248fabc01ca5ba87cd796 go version go1.14.9 linux/amd64 golangci-lint has version 1.31.0 built from 3d6d0e7 on 2020-09-07T15:14:41Z

vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$ git log
commit a09b4949fe0c9c9a9ed248fabc01ca5ba87cd796 (grafted, HEAD -> master, origin/master, origin/HEAD)
Author: Jared Shields <shieldsjared@gmail.com>
Date:   Mon Sep 28 08:59:39 2020 -0400

    Removed trailing slash from site url. (#120)

    * Removed trailing slash from site url.

    * Reverted trimming of the URL. Updated reference in the build's go.mod to use specific commit in mattermost-server that contains fix for trailing slashes on the site url.

    Co-authored-by: jshields <jshields@caci.com>
vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$ go version
go version go1.14.9 linux/amd64
vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$ golangci-lint --version
golangci-lint has version 1.31.0 built from 3d6d0e7 on 2020-09-07T15:14:41Z
vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$ npm version
{
  npm: '6.14.6',
  ares: '1.16.0',
  brotli: '1.0.7',
  cldr: '37.0',
  http_parser: '2.9.3',
  icu: '67.1',
  llhttp: '2.0.4',
  modules: '72',
  napi: '6',
  nghttp2: '1.41.0',
  node: '12.18.3',
  openssl: '1.1.1g',
  tz: '2019c',
  unicode: '13.0',
  uv: '1.38.0',
  v8: '7.8.279.23-node.39',
  zlib: '1.2.11'
}
hanzei commented 3 years ago

https://github.com/mattermost/mattermost-plugin-starter-template/pull/128 did also broke the tests. Let's see if the fix for that also fixes your issue.

vladimirshikhov commented 3 years ago

i did a git pull, unfortunately the error persists:

vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$ git log
commit 5eb33f8675cfd66ae7761314975ce9273fa7a024 (HEAD -> master, origin/master, origin/HEAD)
Author: Domas Monkus <domas@monkus.lt>
Date:   Fri Oct 9 10:52:05 2020 +0300

    Removed file git history (#128)

commit 57f7843ae15acda81f8b7dfbdf502d675a34a4e8
Author: Ben Schumacher <ben.schumacher@mattermost.com>
Date:   Fri Oct 9 09:42:45 2020 +0200

    Make plan.yml general purpose (#125)

commit a09b4949fe0c9c9a9ed248fabc01ca5ba87cd796 (grafted)
Author: Jared Shields <shieldsjared@gmail.com>
Date:   Mon Sep 28 08:59:39 2020 -0400

    Removed trailing slash from site url. (#120)

    * Removed trailing slash from site url.

    * Reverted trimming of the URL. Updated reference in the build's go.mod to use specific commit in mattermost-server that contains fix for trailing slashes on the site url.

    Co-authored-by: jshields <jshields@caci.com>
vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$ make clean
rm -fr dist/
rm -fr server/coverage.txt
rm -fr server/dist
rm -fr build/bin/
vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$ make
Checking for style guide compliance
Running golangci-lint
golangci-lint run ./...
/usr/bin/go test -v -race ./server/...
=== RUN   TestServeHTTP
--- PASS: TestServeHTTP (0.00s)
PASS
ok      github.com/mattermost/mattermost-plugin-starter-template/server (cached)
cd ./build/sync && /usr/bin/go test -v -race ./...
?       github.com/mattermost/mattermost-plugin-starter-template/build/sync [no test files]
=== RUN   TestCopyDirectory
--- PASS: TestCopyDirectory (0.00s)
=== RUN   TestOverwriteFileAction
--- PASS: TestOverwriteFileAction (0.00s)
=== RUN   TestOverwriteDirectoryAction
--- PASS: TestOverwriteDirectoryAction (0.00s)
=== RUN   TestRepoIsCleanChecker
--- PASS: TestRepoIsCleanChecker (0.00s)
=== RUN   TestPathExistsChecker
--- PASS: TestPathExistsChecker (0.00s)
=== RUN   TestUnalteredCheckerSameFile
    checks_test.go:101: 
            Error Trace:    checks_test.go:101
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestUnalteredCheckerSameFile
--- FAIL: TestUnalteredCheckerSameFile (0.09s)
=== RUN   TestUnalteredCheckerDifferentContents
    checks_test.go:146: 
            Error Trace:    checks_test.go:146
            Error:          Should be true
            Test:           TestUnalteredCheckerDifferentContents
    checks_test.go:147: 
            Error Trace:    checks_test.go:147
            Error:          Error message not equal:
                            expected: "file \"/tmp/test176103025/build/sync/plan/testdata/a\" has been altered"
                            actual  : "object not found"
            Test:           TestUnalteredCheckerDifferentContents
--- FAIL: TestUnalteredCheckerDifferentContents (0.10s)
=== RUN   TestUnalteredCheckerNonExistant
    checks_test.go:188: 
            Error Trace:    checks_test.go:188
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestUnalteredCheckerNonExistant
--- FAIL: TestUnalteredCheckerNonExistant (0.10s)
=== RUN   TestUnmarshalPlan
--- PASS: TestUnmarshalPlan (0.00s)
=== RUN   TestRunPlanSuccessfully
UPDATED somepath
--- PASS: TestRunPlanSuccessfully (0.00s)
=== RUN   TestRunPlanPreCheckFail
--- PASS: TestRunPlanPreCheckFail (0.00s)
=== RUN   TestRunPlanActionCheckFails
UPDATED somepath
--- PASS: TestRunPlanActionCheckFails (0.00s)
=== RUN   TestRunPlanNoFallbacks
FAILED  somepath: check failed, fail
--- PASS: TestRunPlanNoFallbacks (0.00s)
=== RUN   TestRunPlanCheckError
--- PASS: TestRunPlanCheckError (0.00s)
=== RUN   TestRunPlanActionError
action failed: fail
--- PASS: TestRunPlanActionError (0.00s)
FAIL
FAIL    github.com/mattermost/mattermost-plugin-starter-template/build/sync/plan    0.321s
=== RUN   TestFileHistory
    file_history_test.go:21: 
            Error Trace:    file_history_test.go:21
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestFileHistory
    file_history_test.go:22: 
            Error Trace:    file_history_test.go:22
            Error:          []string(nil) does not contain "ba7192052d7cf77c55d3b7bf40b350b8431b208b"
            Test:           TestFileHistory
    file_history_test.go:26: 
            Error Trace:    file_history_test.go:26
            Error:          Not equal: 
                            expected: &errors.errorString{s:"not found"}
                            actual  : &errors.errorString{s:"object not found"}

                            Diff:
                            --- Expected
                            +++ Actual
                            @@ -1,3 +1,3 @@
                             (*errors.errorString)({
                            - s: (string) (len=9) "not found"
                            + s: (string) (len=16) "object not found"
                             })
            Test:           TestFileHistory
    file_history_test.go:31: 
            Error Trace:    file_history_test.go:31
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestFileHistory
    file_history_test.go:32: 
            Error Trace:    file_history_test.go:32
            Error:          Not equal: 
                            expected: []string{"213df5d04c108c99d3ec9ffe43a53f638f0ede0b"}
                            actual  : []string(nil)

                            Diff:
                            --- Expected
                            +++ Actual
                            @@ -1,4 +1,2 @@
                            -([]string) (len=1) {
                            - (string) (len=40) "213df5d04c108c99d3ec9ffe43a53f638f0ede0b"
                            -}
                            +([]string) <nil>

            Test:           TestFileHistory
--- FAIL: TestFileHistory (0.26s)
FAIL
FAIL    github.com/mattermost/mattermost-plugin-starter-template/build/sync/plan/git    0.281s
FAIL
make: *** [Makefile:188: test] Ошибка 1
vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$
hanzei commented 3 years ago

Would you please test with go 1.15?

vladimirshikhov commented 3 years ago

Yes, some result:

vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$ go version
go version go1.15.2 linux/amd64
vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$ make clean
rm -fr dist/
rm -fr server/coverage.txt
rm -fr server/dist
rm -fr build/bin/
vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$ make
Checking for style guide compliance
Running golangci-lint
golangci-lint run ./...
/usr/bin/go test -v -race ./server/...
=== RUN   TestServeHTTP
--- PASS: TestServeHTTP (0.00s)
PASS
ok      github.com/mattermost/mattermost-plugin-starter-template/server (cached)
cd ./build/sync && /usr/bin/go test -v -race ./...
?       github.com/mattermost/mattermost-plugin-starter-template/build/sync [no test files]
=== RUN   TestCopyDirectory
--- PASS: TestCopyDirectory (0.00s)
=== RUN   TestOverwriteFileAction
--- PASS: TestOverwriteFileAction (0.00s)
=== RUN   TestOverwriteDirectoryAction
--- PASS: TestOverwriteDirectoryAction (0.00s)
=== RUN   TestRepoIsCleanChecker
--- PASS: TestRepoIsCleanChecker (0.00s)
=== RUN   TestPathExistsChecker
--- PASS: TestPathExistsChecker (0.00s)
=== RUN   TestUnalteredCheckerSameFile
    checks_test.go:101: 
            Error Trace:    checks_test.go:101
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestUnalteredCheckerSameFile
--- FAIL: TestUnalteredCheckerSameFile (0.09s)
=== RUN   TestUnalteredCheckerDifferentContents
    checks_test.go:146: 
            Error Trace:    checks_test.go:146
            Error:          Should be true
            Test:           TestUnalteredCheckerDifferentContents
    checks_test.go:147: 
            Error Trace:    checks_test.go:147
            Error:          Error message not equal:
                            expected: "file \"/tmp/test016763141/build/sync/plan/testdata/a\" has been altered"
                            actual  : "object not found"
            Test:           TestUnalteredCheckerDifferentContents
--- FAIL: TestUnalteredCheckerDifferentContents (0.08s)
=== RUN   TestUnalteredCheckerNonExistant
    checks_test.go:188: 
            Error Trace:    checks_test.go:188
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestUnalteredCheckerNonExistant
--- FAIL: TestUnalteredCheckerNonExistant (0.08s)
=== RUN   TestUnmarshalPlan
--- PASS: TestUnmarshalPlan (0.00s)
=== RUN   TestRunPlanSuccessfully
UPDATED somepath
--- PASS: TestRunPlanSuccessfully (0.00s)
=== RUN   TestRunPlanPreCheckFail
--- PASS: TestRunPlanPreCheckFail (0.00s)
=== RUN   TestRunPlanActionCheckFails
UPDATED somepath
--- PASS: TestRunPlanActionCheckFails (0.00s)
=== RUN   TestRunPlanNoFallbacks
FAILED  somepath: check failed, fail
--- PASS: TestRunPlanNoFallbacks (0.00s)
=== RUN   TestRunPlanCheckError
--- PASS: TestRunPlanCheckError (0.00s)
=== RUN   TestRunPlanActionError
action failed: fail
--- PASS: TestRunPlanActionError (0.00s)
FAIL
FAIL    github.com/mattermost/mattermost-plugin-starter-template/build/sync/plan    0.276s
=== RUN   TestFileHistory
    file_history_test.go:21: 
            Error Trace:    file_history_test.go:21
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestFileHistory
    file_history_test.go:22: 
            Error Trace:    file_history_test.go:22
            Error:          []string(nil) does not contain "ba7192052d7cf77c55d3b7bf40b350b8431b208b"
            Test:           TestFileHistory
    file_history_test.go:26: 
            Error Trace:    file_history_test.go:26
            Error:          Not equal: 
                            expected: &errors.errorString{s:"not found"}
                            actual  : &errors.errorString{s:"object not found"}

                            Diff:
                            --- Expected
                            +++ Actual
                            @@ -1,3 +1,3 @@
                             (*errors.errorString)({
                            - s: (string) (len=9) "not found"
                            + s: (string) (len=16) "object not found"
                             })
            Test:           TestFileHistory
    file_history_test.go:31: 
            Error Trace:    file_history_test.go:31
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestFileHistory
    file_history_test.go:32: 
            Error Trace:    file_history_test.go:32
            Error:          Not equal: 
                            expected: []string{"213df5d04c108c99d3ec9ffe43a53f638f0ede0b"}
                            actual  : []string(nil)

                            Diff:
                            --- Expected
                            +++ Actual
                            @@ -1,4 +1,2 @@
                            -([]string) (len=1) {
                            - (string) (len=40) "213df5d04c108c99d3ec9ffe43a53f638f0ede0b"
                            -}
                            +([]string) <nil>

            Test:           TestFileHistory
--- FAIL: TestFileHistory (0.29s)
FAIL
FAIL    github.com/mattermost/mattermost-plugin-starter-template/build/sync/plan/git    0.305s
FAIL
make: *** [Makefile:188: test] Ошибка 1
hanzei commented 3 years ago

@tasdomas Do you have any ideas why the tests are failing?

tasdomas commented 3 years ago

@hanzei, the fix landed in https://github.com/mattermost/mattermost-plugin-starter-template, 95bcc7ac. I suspect a git merge origin master is all that's needed.

vladimirshikhov commented 3 years ago

@hanzei, the fix landed in https://github.com/mattermost/mattermost-plugin-starter-template, 95bcc7a. I suspect a git merge origin master is all that's needed.

Still can't build plugin:

vovan@vovan-System:~/mattermost_plugin$ git clone --depth 2 https://github.com/mattermost/mattermost-plugin-starter-template com.example.my-plugin
Клонирование в «com.example.my-plugin»…
remote: Enumerating objects: 83, done.
remote: Counting objects: 100% (83/83), done.
remote: Compressing objects: 100% (58/58), done.
remote: Total 83 (delta 6), reused 50 (delta 5), pack-reused 0
Распаковка объектов: 100% (83/83), 241.20 KiB | 1004.00 KiB/s, готово.
vovan@vovan-System:~/mattermost_plugin$ git log
fatal: не найден git репозиторий (или один из родительских каталогов): .git
vovan@vovan-System:~/mattermost_plugin$ cd com.example.my-plugin/
vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$ git log
commit 95bcc7ac80372ba48f01867033a641f99b5c8ba4 (HEAD -> master, origin/master, origin/HEAD)
Author: Domas Monkus <domas@monkus.lt>
Date:   Fri Oct 9 12:55:14 2020 +0300

    Disable git file history test that relies on commits not being squashed in github PR merges. (#135)

commit 5eb33f8675cfd66ae7761314975ce9273fa7a024 (grafted)
Author: Domas Monkus <domas@monkus.lt>
Date:   Fri Oct 9 10:52:05 2020 +0300

    Removed file git history (#128)
vovan@vovan-System:~/mattermost_plugin/com.example.my-plugin$ make
cd webapp && /home/vovan/.nvm/versions/node/v12.18.3/bin/npm install

> node-sass@4.14.1 install /home/vovan/mattermost_plugin/com.example.my-plugin/webapp/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/vovan/.npm/node-sass/4.14.1/linux-x64-72_binding.node

> core-js@2.6.11 postinstall /home/vovan/mattermost_plugin/com.example.my-plugin/webapp/node_modules/@babel/polyfill/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> core-js@2.6.11 postinstall /home/vovan/mattermost_plugin/com.example.my-plugin/webapp/node_modules/@babel/runtime-corejs2/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

> core-js@2.6.11 postinstall /home/vovan/mattermost_plugin/com.example.my-plugin/webapp/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

> core-js@3.6.4 postinstall /home/vovan/mattermost_plugin/com.example.my-plugin/webapp/node_modules/mattermost-redux/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

> core-js@3.1.4 postinstall /home/vovan/mattermost_plugin/com.example.my-plugin/webapp/node_modules/mattermost-webapp/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> core-js@3.6.5 postinstall /home/vovan/mattermost_plugin/com.example.my-plugin/webapp/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

> node-sass@4.14.1 postinstall /home/vovan/mattermost_plugin/com.example.my-plugin/webapp/node_modules/node-sass
> node scripts/build.js

Binary found at /home/vovan/mattermost_plugin/com.example.my-plugin/webapp/node_modules/node-sass/vendor/linux-x64-72/binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/babel-jest/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 2074 packages from 1124 contributors and audited 2084 packages in 27.067s

75 packages are looking for funding
  run `npm fund` for details

found 6 vulnerabilities (5 low, 1 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details
touch webapp/node_modules
Checking for style guide compliance
cd webapp && npm run lint

> @ lint /home/vovan/mattermost_plugin/com.example.my-plugin/webapp
> eslint --ignore-pattern node_modules --ignore-pattern dist --ext .js --ext .jsx --ext tsx --ext ts . --quiet --cache

Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration .
cd webapp && npm run check-types

> @ check-types /home/vovan/mattermost_plugin/com.example.my-plugin/webapp
> tsc

Running golangci-lint
golangci-lint run ./...
/usr/bin/go test -v -race ./server/...
=== RUN   TestServeHTTP
--- PASS: TestServeHTTP (0.00s)
PASS
ok      github.com/mattermost/mattermost-plugin-starter-template/server (cached)
cd webapp && /home/vovan/.nvm/versions/node/v12.18.3/bin/npm run test;

> @ test /home/vovan/mattermost_plugin/com.example.my-plugin/webapp
> jest --forceExit --detectOpenHandles --verbose

 PASS  src/manifest.test.tsx
  ✓ Plugin manifest, id and version are defined (3 ms)
  ✓ Plugin id and version are defined (2 ms)

Test Suites: 1 passed, 1 total
Tests:       2 passed, 2 total
Snapshots:   0 total
Time:        3.064 s
Ran all test suites.
cd ./build/sync && /usr/bin/go test -v -race ./...
?       github.com/mattermost/mattermost-plugin-starter-template/build/sync [no test files]
=== RUN   TestCopyDirectory
--- PASS: TestCopyDirectory (0.00s)
=== RUN   TestOverwriteFileAction
--- PASS: TestOverwriteFileAction (0.00s)
=== RUN   TestOverwriteDirectoryAction
--- PASS: TestOverwriteDirectoryAction (0.00s)
=== RUN   TestRepoIsCleanChecker
--- PASS: TestRepoIsCleanChecker (0.00s)
=== RUN   TestPathExistsChecker
--- PASS: TestPathExistsChecker (0.00s)
=== RUN   TestUnalteredCheckerSameFile
    checks_test.go:101: 
            Error Trace:    checks_test.go:101
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestUnalteredCheckerSameFile
--- FAIL: TestUnalteredCheckerSameFile (0.04s)
=== RUN   TestUnalteredCheckerDifferentContents
    checks_test.go:146: 
            Error Trace:    checks_test.go:146
            Error:          Should be true
            Test:           TestUnalteredCheckerDifferentContents
    checks_test.go:147: 
            Error Trace:    checks_test.go:147
            Error:          Error message not equal:
                            expected: "file \"/tmp/test440868068/build/sync/plan/testdata/a\" has been altered"
                            actual  : "object not found"
            Test:           TestUnalteredCheckerDifferentContents
--- FAIL: TestUnalteredCheckerDifferentContents (0.04s)
=== RUN   TestUnalteredCheckerNonExistant
    checks_test.go:188: 
            Error Trace:    checks_test.go:188
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestUnalteredCheckerNonExistant
--- FAIL: TestUnalteredCheckerNonExistant (0.05s)
=== RUN   TestUnmarshalPlan
--- PASS: TestUnmarshalPlan (0.00s)
=== RUN   TestRunPlanSuccessfully
UPDATED somepath
--- PASS: TestRunPlanSuccessfully (0.00s)
=== RUN   TestRunPlanPreCheckFail
--- PASS: TestRunPlanPreCheckFail (0.00s)
=== RUN   TestRunPlanActionCheckFails
UPDATED somepath
--- PASS: TestRunPlanActionCheckFails (0.00s)
=== RUN   TestRunPlanNoFallbacks
FAILED  somepath: check failed, fail
--- PASS: TestRunPlanNoFallbacks (0.00s)
=== RUN   TestRunPlanCheckError
--- PASS: TestRunPlanCheckError (0.00s)
=== RUN   TestRunPlanActionError
action failed: fail
--- PASS: TestRunPlanActionError (0.00s)
FAIL
FAIL    github.com/mattermost/mattermost-plugin-starter-template/build/sync/plan0.158s
=== RUN   TestFileHistory
    file_history_test.go:21: 
            Error Trace:    file_history_test.go:21
            Error:          Expected nil, but got: &errors.errorString{s:"object not found"}
            Test:           TestFileHistory
    file_history_test.go:22: 
            Error Trace:    file_history_test.go:22
            Error:          []string(nil) does not contain "ba7192052d7cf77c55d3b7bf40b350b8431b208b"
            Test:           TestFileHistory
    file_history_test.go:26: 
            Error Trace:    file_history_test.go:26
            Error:          Not equal: 
                            expected: &errors.errorString{s:"not found"}
                            actual  : &errors.errorString{s:"object not found"}

                            Diff:
                            --- Expected
                            +++ Actual
                            @@ -1,3 +1,3 @@
                             (*errors.errorString)({
                            - s: (string) (len=9) "not found"
                            + s: (string) (len=16) "object not found"
                             })
            Test:           TestFileHistory
--- FAIL: TestFileHistory (0.10s)
FAIL
FAIL    github.com/mattermost/mattermost-plugin-starter-template/build/sync/plan/git    0.118s
FAIL
make: *** [Makefile:189: test] Ошибка 1
tasdomas commented 3 years ago

The failure is caused by the --depth 2 you're doing when cloning the repo. Do a full clone and the test will pass. I'll look into making the file_history tests independent of the repository's history.

vladimirshikhov commented 3 years ago

The failure is caused by the --depth 2 you're doing when cloning the repo. Do a full clone and the test will pass. I'll look into making the file_history tests independent of the repository's history.

it's helpful, Thank's!

hanzei commented 3 years ago

@vladimirshikhov Did removing --depth 2 solve your issue?

moussetc commented 3 years ago

Hi, I have had the same error. 19 days ago, when I last built my plugin after update the template files to commit 1ce44fa, the build passed both locally and in my TravisCI build. Today, I made some new commits on the plugin, without anything related to the sync folder, and the build pass locally but fails on TravisCI because travisCI uses --depth 50 by default.

Updating the content of the build folder with the latest from mattermost-plugin-starter-template/master (95bcc7ac), was not enough as expected, but configuring TravisCI to clone the repo without --depth worked.

vladimirshikhov commented 3 years ago

@vladimirshikhov Did removing --depth 2 solve your issue?

Yes, it solve issue, thanks.