Fix some tests : make coverage -> test (#2492)

* Fix test : make coverage -> test

* Refactor integration tests to be able to run them in parallel

* Add custom local repository temp path
pull/2211/head^2
Antoine GIRARD 7 years ago committed by Bo-Yi Wu
parent eab4579e17
commit 69dfe43ffc
  1. 2
      .drone.yml
  2. 4
      .gitignore
  3. 25
      Makefile
  4. 0
      integrations/gitea-repositories-meta/user2/repo1.git/HEAD
  5. 0
      integrations/gitea-repositories-meta/user2/repo1.git/config
  6. 0
      integrations/gitea-repositories-meta/user2/repo1.git/description
  7. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/applypatch-msg.sample
  8. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/commit-msg.sample
  9. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/post-receive
  10. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/post-receive.d/gitea
  11. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/post-update.sample
  12. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/pre-applypatch.sample
  13. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/pre-commit.sample
  14. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/pre-push.sample
  15. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/pre-rebase.sample
  16. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/pre-receive
  17. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/pre-receive.d/gitea
  18. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/prepare-commit-msg.sample
  19. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/update
  20. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/update.d/gitea
  21. 0
      integrations/gitea-repositories-meta/user2/repo1.git/hooks/update.sample
  22. 0
      integrations/gitea-repositories-meta/user2/repo1.git/info/exclude
  23. 0
      integrations/gitea-repositories-meta/user2/repo1.git/info/refs
  24. 0
      integrations/gitea-repositories-meta/user2/repo1.git/objects/2a/2f1d4670728a2e10049e345bd7a276468beab6
  25. 0
      integrations/gitea-repositories-meta/user2/repo1.git/objects/4b/4851ad51df6a7d9f25c979345979eaeb5b349f
  26. 0
      integrations/gitea-repositories-meta/user2/repo1.git/objects/65/f1bf27bc3bf70f64657658635e66094edbcb4d
  27. 0
      integrations/gitea-repositories-meta/user2/repo1.git/objects/info/packs
  28. 0
      integrations/gitea-repositories-meta/user2/repo1.git/refs/heads/DefaultBranch
  29. 0
      integrations/gitea-repositories-meta/user2/repo1.git/refs/heads/develop
  30. 0
      integrations/gitea-repositories-meta/user2/repo1.git/refs/heads/feature/1
  31. 0
      integrations/gitea-repositories-meta/user2/repo1.git/refs/heads/master
  32. 0
      integrations/gitea-repositories-meta/user2/repo15.git/HEAD
  33. 0
      integrations/gitea-repositories-meta/user2/repo15.git/config
  34. 0
      integrations/gitea-repositories-meta/user2/repo15.git/description
  35. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/applypatch-msg.sample
  36. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/commit-msg.sample
  37. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/post-receive
  38. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/post-receive.d/gitea
  39. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/post-update.sample
  40. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/pre-applypatch.sample
  41. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/pre-commit.sample
  42. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/pre-push.sample
  43. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/pre-rebase.sample
  44. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/pre-receive
  45. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/pre-receive.d/gitea
  46. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/prepare-commit-msg.sample
  47. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/update
  48. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/update.d/gitea
  49. 0
      integrations/gitea-repositories-meta/user2/repo15.git/hooks/update.sample
  50. 0
      integrations/gitea-repositories-meta/user2/repo15.git/info/exclude
  51. 0
      integrations/gitea-repositories-meta/user2/repo16.git/HEAD
  52. 0
      integrations/gitea-repositories-meta/user2/repo16.git/config
  53. 0
      integrations/gitea-repositories-meta/user2/repo16.git/description
  54. 0
      integrations/gitea-repositories-meta/user2/repo16.git/hooks/applypatch-msg.sample
  55. 0
      integrations/gitea-repositories-meta/user2/repo16.git/hooks/commit-msg.sample
  56. 0
      integrations/gitea-repositories-meta/user2/repo16.git/hooks/post-update.sample
  57. 0
      integrations/gitea-repositories-meta/user2/repo16.git/hooks/pre-applypatch.sample
  58. 0
      integrations/gitea-repositories-meta/user2/repo16.git/hooks/pre-commit.sample
  59. 0
      integrations/gitea-repositories-meta/user2/repo16.git/hooks/pre-push.sample
  60. 0
      integrations/gitea-repositories-meta/user2/repo16.git/hooks/pre-rebase.sample
  61. 0
      integrations/gitea-repositories-meta/user2/repo16.git/hooks/pre-receive.sample
  62. 0
      integrations/gitea-repositories-meta/user2/repo16.git/hooks/prepare-commit-msg.sample
  63. 0
      integrations/gitea-repositories-meta/user2/repo16.git/hooks/update.sample
  64. 0
      integrations/gitea-repositories-meta/user2/repo16.git/info/exclude
  65. 0
      integrations/gitea-repositories-meta/user2/repo16.git/objects/0c/3d59dea27b97aa3cb66072745d7a2c51a7a8b1
  66. 0
      integrations/gitea-repositories-meta/user2/repo16.git/objects/24/f83a471f77579fea57bac7255d6e64e70fce1c
  67. 0
      integrations/gitea-repositories-meta/user2/repo16.git/objects/27/566bd5738fc8b4e3fef3c5e72cce608537bd95
  68. 0
      integrations/gitea-repositories-meta/user2/repo16.git/objects/3b/2b54fe3d9a8279d5b926124dccdf279b8eff2f
  69. 0
      integrations/gitea-repositories-meta/user2/repo16.git/objects/45/8121ce9a6b855c9733bae62093caf3f39685de
  70. 0
      integrations/gitea-repositories-meta/user2/repo16.git/objects/50/99b81332712fe655e34e8dd63574f503f61811
  71. 0
      integrations/gitea-repositories-meta/user2/repo16.git/objects/69/554a64c1e6030f051e5c3f94bfbd773cd6a324
  72. 0
      integrations/gitea-repositories-meta/user2/repo16.git/objects/a4/3476a501516e065c5a82f05fd58fd319598bc1
  73. 0
      integrations/gitea-repositories-meta/user2/repo16.git/objects/e9/4083fcdf1f10c545e9253a23c5e44a2ff68aac
  74. 0
      integrations/gitea-repositories-meta/user2/repo16.git/objects/f2/7c2b2b03dcab38beaf89b0ab4ff61f6de63441
  75. 0
      integrations/gitea-repositories-meta/user2/repo16.git/objects/f9/0451c72ef61a7645293d17b47be7a8e983da57
  76. 0
      integrations/gitea-repositories-meta/user2/repo16.git/refs/heads/good-sign
  77. 0
      integrations/gitea-repositories-meta/user2/repo16.git/refs/heads/good-sign-not-yet-validated
  78. 0
      integrations/gitea-repositories-meta/user2/repo16.git/refs/heads/master
  79. 0
      integrations/gitea-repositories-meta/user2/repo16.git/refs/heads/not-signed
  80. 0
      integrations/gitea-repositories-meta/user3/repo3.git/HEAD
  81. 0
      integrations/gitea-repositories-meta/user3/repo3.git/config
  82. 0
      integrations/gitea-repositories-meta/user3/repo3.git/description
  83. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/applypatch-msg.sample
  84. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/commit-msg.sample
  85. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/post-receive
  86. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/post-receive.d/gitea
  87. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/post-update.sample
  88. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/pre-applypatch.sample
  89. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/pre-commit.sample
  90. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/pre-push.sample
  91. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/pre-rebase.sample
  92. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/pre-receive
  93. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/pre-receive.d/gitea
  94. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/pre-receive.sample
  95. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/prepare-commit-msg.sample
  96. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/update
  97. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/update.d/gitea
  98. 0
      integrations/gitea-repositories-meta/user3/repo3.git/hooks/update.sample
  99. 0
      integrations/gitea-repositories-meta/user3/repo3.git/info/exclude
  100. 0
      integrations/gitea-repositories-meta/user3/repo3.git/objects/20/ade30d25e0ecaeec84e7f542a8456900858240
  101. Some files were not shown because too many files have changed in this diff Show More

@ -35,7 +35,7 @@ pipeline:
TAGS: bindata sqlite
GOPATH: /srv/app
commands:
- make coverage
- make test
when:
event: [ push, tag, pull_request ]

4
.gitignore vendored

@ -45,4 +45,6 @@ _testmain.go
/indexers
/log
/public/img/avatar
/integrations/gitea-integration
/integrations/gitea-integration-mysql
/integrations/gitea-integration-pgsql
/integrations/gitea-integration-sqlite

@ -54,7 +54,7 @@ all: build
.PHONY: clean
clean:
$(GO) clean -i ./...
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA) integrations*.test
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA) integrations*.test integrations/gitea-integration-pgsql/ integrations/gitea-integration-mysql/ integrations/gitea-integration-sqlite/
required-gofmt-version:
@$(GO) version | grep -q '\(1.7\|1.8\)' || { echo "We require go version 1.7 or 1.8 to format code" >&2 && exit 1; }
@ -160,12 +160,12 @@ test-sqlite: integrations.sqlite.test
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test
.PHONY: test-mysql
test-mysql: integrations.test
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.test
test-mysql: integrations.mysql.test
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test
.PHONY: test-pgsql
test-pgsql: integrations.test
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.test
test-pgsql: integrations.pgsql.test
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test
.PHONY: bench-sqlite
@ -173,20 +173,23 @@ bench-sqlite: integrations.sqlite.test
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.bench .
.PHONY: bench-mysql
bench-mysql: integrations.test
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.test -test.bench .
bench-mysql: integrations.mysql.test
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test -test.bench .
.PHONY: bench-pgsql
bench-pgsql: integrations.test
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.test -test.bench .
bench-pgsql: integrations.pgsql.test
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test -test.bench .
.PHONY: integration-test-coverage
integration-test-coverage: integrations.cover.test
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out
integrations.test: $(SOURCES)
$(GO) test -c code.gitea.io/gitea/integrations
integrations.mysql.test: $(SOURCES)
$(GO) test -c code.gitea.io/gitea/integrations -o integrations.mysql.test
integrations.pgsql.test: $(SOURCES)
$(GO) test -c code.gitea.io/gitea/integrations -o integrations.pgsql.test
integrations.sqlite.test: $(SOURCES)
$(GO) test -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite'

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save