Commit Graph

88 Commits

Author SHA1 Message Date
Sandro Santilli 100ec93a65 Remove integration test executables on `make clean` (#2340) 2017-08-20 11:09:24 +08:00
Bo-Yi Wu 722bcefbbf refactor(Makefile): allow overriding default go program (#2310) 2017-08-16 08:46:41 +08:00
Antoine GIRARD a804f0e052 go get github.com/wadey/gocovmerge when needed (#2235) 2017-07-31 09:29:50 +08:00
silverwind d74d8ecc2e Generate small and large logos at 4x resolution (#2233)
To support High-DPI displays, generate images at 4 times their displayed
resolution, which should be enough to support all current devices
according to https://material.io/devices/.
2017-07-30 23:04:01 +03:00
Lunny Xiao a9cc538ab5 remove unused variable on makefile (#2225) 2017-07-29 12:22:10 +03:00
Lauris BH 60d7e56c69 Add task to generate images from SVG and change to new logo (#2194)
* Add makefile task to generate images from SVG and change to new logo

* use absolute path on generate-images
2017-07-28 13:51:20 +08:00
Bo-Yi Wu f011d6d4d7 fix: replace tmp with TMPDIR. (#2152) 2017-07-13 14:09:29 +03:00
Bo-Yi Wu 2c3efd72ce fix typo (#2145)
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-07-12 16:52:00 +08:00
Bo-Yi Wu 2b05b104ef Add verify changed less-file step to Makefile (#1861) 2017-07-12 04:28:57 +02:00
Roy Marples c016d48735 Use POSIX complaint ! operator in find (#2132)
* Use POSIX complaint ! operator in find

-not is a GNU extension and not all find(8) implementations
support it. It's just an alias for ! which is POSIX compliant.

Now gitea compiles on NetBSD at least.

* Revert change in vendor directory as requested
2017-07-10 09:48:46 +08:00
Lunny Xiao dde9a8648e Add make command update-translations for update translations from crodwin (#2097)
* add make command update-translations for update translations from crowdin to options/locale

* use curl & resolve double quote on make file
2017-07-03 16:37:00 +03:00
Mura Li 754482bf5d Add integration test for repository migration (#1983) 2017-06-20 19:23:16 +08:00
Antoine GIRARD 2bcd9471c9 Separate generate swagger + fix sed os specific (#1791)
* Separate generate-swagger

* Remove go generate rules

* Add missing definition replacement + remove use of -i sed flag

for compatibility with mac os default sed version.
This is a little hacky a better solution could be use.

* Use custom SED_INPLACE

depending of platform detection

* Use SED_INPLACE for swagger-ui also
2017-06-15 08:51:23 -05:00
Ethan Koenig 792cde7081 Coverage reports for integration tests (#1960) 2017-06-15 17:38:33 +08:00
Sandro Santilli f6b58964d7 Include formatting check to the `make test` (and thus also `check`) rule (#1366)
* Include formatting check to the `make check` rule

... and give it its own standalone target too (make fmt-check)

Show diff on fmt-check failure
Do not allow running "fmt-check" with incompatible go version
Also simplify the `fmt` rule

* Forbid running "make fmt" with Go version != 1.7 or 1.8

* Ignore bindata.go for spelling and formatting checks

also remove duplicated variable assignment for GOFILES

* Run `make fmt`
2017-06-06 08:53:16 -05:00
Bo-Yi Wu 703d18e50d feat: add check misspelling (#1877) 2017-06-05 02:49:46 -05:00
Bo-Yi Wu e7ae13deef fix: error from mktemp command in MacOS. (#1837)
* fix: error from mktemp command in MacOS.

* [ci skip] udpate temp name.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2017-06-04 03:48:18 -05:00
himaaaatti 0f5b399e35 Add variable for docker tag (#1825)
Signed-off-by: Shunsuke Mie <sux2mfgj@gmail.com>
2017-05-31 09:16:51 +08:00
Ethan Koenig cb74f1b84d Remove stale rule from Makefile (#1782) 2017-05-25 08:53:03 +08:00
Ethan Koenig ff96bda138 Only run coverage on merges/pushes to master (#1783) 2017-05-25 00:13:18 +08:00
Lunny Xiao d98a86d2a2 remove sqlite tag when integration test with mysql/postgres AND recreate database when init integration test (#1693) 2017-05-09 15:42:55 +02:00
Thomas Boerger c864ccf9b1 Enforce netgo build tag while cross-compilation (#1690) 2017-05-07 22:06:30 +08:00
Antoine GIRARD 3edb0c5894 Generate swagger json (#1402)
- Generate swagger.json into public/
- Add swagger-ui auto-installation
- Add footer link to local swagger-ui
- Add /swagger url for using app url.
- Fix Swagger-UI version via git tag
2017-05-02 15:35:59 +02:00
Antoine GIRARD bb5f694fc5 Improve govendor testing (#1623)
- Use `govendor list +outside +unused` for finding missing or unused deps and govendor status for catching modified vendor.  
- Remove appengine import
2017-05-02 15:22:21 +02:00
Lauris BH 0144817971 Do not allow commiting to protected branch from online editor (#1502)
* Do not allow commiting to protected branch from online editor

* Add editor integration tests for adding new file and not allowing to add new file to protected branch
2017-05-02 08:49:55 +08:00
Ethan Koenig 66c803fae2 MySQL, Postgres integration tests in drone (#1638)
* MySQL, Postgres integration tests in drone

* Fix .drone.yml

* sign drone

* resign drone
2017-04-30 14:30:12 +08:00
Kim "BKC" Carlbäcker cebe3a6b2f Revert "Set VERSION from git once, in a variable (#1447)"
This reverts commit 410af6971b.
2017-04-28 20:28:38 +02:00
Lunny Xiao fca7ddc6ea improve integration test to resue models/fixtures and store git repos with tests (#1627)
* improve integration test to resue models/fixtures and store git repos with source

* use gitea-integration-meta dir instead .tar.gz and cleanup every before every test

* fix import package name
2017-04-28 21:23:28 +08:00
Ethan Koenig c58708d3ee Integration test framework (#1290)
* Integration test framework

* udpate drone sign

* Formatting fixes and move router.go to routers/

* update sign for drone
2017-04-25 15:24:51 +08:00
Antoine GIRARD eb1075dd4c Check if missing/modified/unused deps in vendor and fix errors (#1468)
* Check if missing deps in vendor

This will catch import from other repos. (maybe by auto-import)

* Remove github.com/smartystreets unused deps

* Remove github.com/boltdb/bolt unused dep

* Fetch github.com/go-xorm/core + sync gopkg.in/ldap.v2/ldap.go

* Auto-install govendor + reinstall github.com/boltdb/bolt needed by vendor/github.com/blevesearch/bleve/index/store/boltdb

* Update go-xorm/xorm to a5cb21 in vendor.json

* Use a custom repo for implementing change to bolt dep.

* Switching bolt to github.com/go-gitea/bolt

* Switching bolt to github.com/go-gitea/bolt (fork version)

* change the drone sign
2017-04-24 22:31:46 +08:00
Sandro Santilli 410af6971b Set VERSION from git once, in a variable (#1447) 2017-04-06 23:32:28 +08:00
Mura Li 2d1efcc270 Add GOFLAGS and EXTRA_GOFLAGS (#1438) 2017-04-05 16:10:32 +08:00
Thomas Boerger 7ed00b6e8d Split the binary build (#985)
As we can not compile darwin binaries with static flags I have split the
build process into different make tasks. Now we get static linked
binaries especially for linux so that it also can run on older versions
of CenOS and so on.

Signed-off-by: Thomas Boerger <thomas@webhippie.de>
2017-03-07 21:49:24 +08:00
Mura Li 848293671b Add basic integration test infrastructure (and new endpoint `/api/v1/version` for testing it) (#741)
* Implement '/api/v1/version'

* Cleanup and various fixes

* Enhance run.sh

* Add install_test.go

* Add parameter utils.Config for testing handlers

* Re-organize TestVersion.go

* Rename functions

* handling process cleanup properly

* Fix missing function renaming

* Cleanup the 'retry' logic

* Cleanup

* Remove unneeded logging code

* Logging messages tweaking

* Logging message tweaking

* Fix logging messages

* Use 'const' instead of hardwired numbers

* We don't really need retries anymore

* Move constant ServerHttpPort to install_test.go

* Restore mistakenly removed constant

* Add required comments to make the linter happy.

* Fix comments and naming to address linter's complaints

* Detect Gitea executale version automatically

* Remove tests/run.sh, `go test` suffices.

* Make `make build` a prerequisite of `make test`

* Do not sleep before trying

* Speedup the server pinging loop

* Use defined const instead of hardwired numbers

* Remove redundant error handling

* Use a dedicated target for running code.gitea.io/tests

* Do not make 'test' depend on 'build' target

* Rectify the excluded package list

* Remove redundant 'exit 1'

* Change the API to allow passing test.T to test handlers

* Make testing.T an embedded field

* Use assert.Equal to comparing results

* Add copyright info

* Parametrized logging output

* Use tmpdir instead

* Eliminate redundant casting

* Remove unneeded variable

* Fix last commit

* Add missing copyright info

* Replace fmt.Fprintf with fmt.Fprint

* rename the xtest to integration-test

* Use Symlink instead of hard-link for cross-device linking

* Turn debugging logs on

* Follow the existing framework for APIs

* Output logs only if test.v is true

* Re-order import statements

* Enhance the error message

* Fix comment which breaks the linter's rule

* Rename 'integration-test' to 'e2e-test' for saving keystrokes

* Add comment to avoid possible confusion

* Rename tests -> integration-tests

Also change back the Makefile to use `make integration-test`.

* Use tests/integration for now

* tests/integration -> integrations

Slightly flattened directory hierarchy is better.

* Update Makefile accordingly

* Fix a missing change in Makefile

* govendor update code.gitea.io/sdk/gitea

* Fix comment of struct fields

* Fix conditional nonsense

* Fix missing updates regarding version string changes

* Make variable naming more consistent

* Check http status code

* Rectify error messages
2017-03-06 22:13:17 +08:00
Jonas a201977590 Fix for #828: Embed build tags (#1051)
* Fix for #828
Add build tags to ldflags and print in version output

Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>

* Reworked formatBuiltWith function

Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>

* Add tags to version information in admin panel

Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>

* Added new variable for use on admin page.

Signed-off-by: Jonas Östanbäck <jonas.ostanback@gmail.com>

* Fixed incorrect indentation
2017-02-28 08:40:02 +08:00
silverwind ab462fb95f Makefile: Use hash over which (#1069)
`hash` is a much faster shell-builtin alternative to `which`.
2017-02-26 16:27:45 +01:00
silverwind 5bd22a2f4a Makefile: Also redirect stderr on which calls (#1068) 2017-02-26 21:12:21 +08:00
Dan Morrill 832477b1bc Tweak docker target to work by default. (#1033)
Fix for #1013: adds "bindata" to tags by default, as without this the
resulting docker image won't start, as it doesn't contain locale files.
Verified to work even if you specify TAGS="bindata" such that it appears
twice.
2017-02-24 09:33:09 +08:00
Andrey Nering e4031b822a Makefile: install on build (#874)
This install Go package on building for caching and faster builds
2017-02-09 11:11:04 +08:00
Thomas Boerger ea8c8cdaf3 Fix master builds on mips* again (#815)
* Use local folder for xgo

* Always do crosscompile and testing to fail early

* Added mips* values for boltdb

In order to get master building again I have applied these 2 additional
files to boltdb. This should get dropped when
https://github.com/boltdb/bolt/issues/656 gets solved.
2017-02-02 11:56:08 +08:00
Thomas Boerger 369972b116 Set the ldflags to static value within makefile (#709) 2017-01-20 18:34:20 +01:00
Thomas Boerger d0ad7921f8 Enforce custom LDFLAGS within makefile (#684) 2017-01-17 14:02:44 +08:00
Andrey Nering b7e1bccc50 Makefile: on Windows, executable should have ".exe" (#550) 2017-01-01 22:18:35 +08:00
Bo-Yi Wu cb18941e63 replcae go fmt with gofmt command.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-12-30 20:41:10 +01:00
Thomas Boerger 6aacf4d2f0 Properly handle drone tags and release/* branches (#466) 2016-12-24 00:00:48 +01:00
Thomas Boerger b33078fa33 Bindata is optional and over-writable on restart (#354)
* Moved conf assets into options folder

* Dropped old bindata

* Started to integrate options bindata and accessors

* Do not enforce a builtin app.ini

* Replaced bindata calls with options

* Dropped bindata task from makefile, it's the generate task now

* Always embedd app.ini to provide sane config defaults

* Use sane defaults for the configuration

* Defined default value for SSH_KEYGEN_PATH

* Dropped "NEVER EVER MODIFY THIS FILE" header from app.ini

* Fixed new paths in latest test additions

* Drop bindata with make clean task

* Set more proper default values
2016-12-22 19:12:23 +01:00
Thomas Boerger 618407c018 Do not override the binary version name from drone (#436)
Signed-off-by: Thomas Boerger <tboerger@suse.de>
2016-12-21 20:00:15 +08:00
Thomas Boerger c6b6a61bf1 Fixing multiple docker issues (#386)
* Added stupid docker task to makefile

* Dropped unknown option PrintLastLog from docker ssh config

* OpenSSH should log to docker stdout

* Set random pw for docker git user, otherwise it is locked

* Stop using templates and public within docker
2016-12-15 17:16:55 +08:00
Kim "BKC" Carlbäcker 1d1c01875d Autogenerate Version on build (#190)
* Autogenerate Version On Build

* Fixes

* Changed Version to v0.9.0

* balls

* I hate newlines

* Don't remove .VERSION-file on `make clean`

* v0.9.0 => 1.0.0

* damn new-lines...

* Always rebuild templates/.VERSION

* Delete .VERSION

* Update Makefile
2016-12-13 12:48:58 +08:00
Kim "BKC" Carlbäcker 1b5b297c39 Actually fix 'make build' (#353)
* Actually fix bloddy 'make build'
2016-12-05 18:35:22 +01:00