1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-05-17 06:57:40 +08:00

18 Commits

Author SHA1 Message Date
1b3e4438fc chore: upgrade OpenTelemetry dependencies (#9736) 2023-04-05 11:44:14 +00:00
d4cd414b5e test: port CircleCI to GH Actions and improve sharness reporting (#9355)
Closes https://github.com/ipfs/kubo/issues/8991
Part of https://github.com/ipfs/kubo/issues/8804
2023-01-14 00:49:52 +01:00
579175f81d feat: add basic CLI tests using Go Test
This is intended as a replacement for sharness. These are vanilla Go
tests which can be run in your IDE for quick iteration on end-to-end
CLI tests.

This also removes IPTB by duplicating its functionality in the test
harness. This isn't a big deal...IPTB's complexity is mostly around
the fact that its state needs to be saved to disk in between `iptb`
command invocations, and that it uses Go plugins to inject
functionality, neither of which are relevant here.

If we merge this, we'll have to live with bifurcated tests for a while
until they are all migrated. I'd recommend we self-enforce a rule
that, if we need to touch a sharness test, we migrate it and one more
test over to Go tests first. Then eventually we will have migrated
everything.
2022-12-12 09:43:09 -05:00
3df743ac29 fix error when computing coverage
Some packages can contain both external and internal tests. Listing these
packages twice causes us to create two targets (which fails).

Instead, use a single go list statement.
2020-10-12 16:35:31 -07:00
1e437c7e97 Fix typos and cleanup 2020-04-20 22:00:01 +03:00
f31dd2aae6 GOCC implementation & fix in make & build scripts
The usage of a native 'go' command has been replaced with a make &
environment variable $GOCC. This enables building with multiple go
versions on a single machine as documented:
  * https://golang.org/doc/install#extra_versions

This enables the usage of:
```bash
$ make install
$ # OR
$ GOCC=go1.12.3 make install
$ # OR
$ GOCC=go1.12.4 make install
```
And the build and test tools now pick up on this change

 On branch go-version-check
 Changes to be committed:
	modified:   Rules.mk
	modified:   bin/check_go_version
	modified:   bin/dist_get
	modified:   bin/maketarball.sh
	modified:   coverage/Rules.mk
	modified:   mk/golang.mk
	modified:   mk/tarball.mk
License: MIT
Signed-off-by: Chris Buesser <christopher.buesser@gmail.com>
2019-04-30 21:22:43 -04:00
061128d1d3 mk: fix make install by not setting GOBIN
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-03-06 22:21:14 +01:00
3e199ab3f7 mk: s/go-build/go-build-relative/
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-03-05 18:33:58 +01:00
16cfe4a5ea gomod: add coverage tools to go.mod
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-03-05 18:33:58 +01:00
23ddc26025 ci: Coverage and Junit xmls in one run
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2018-10-29 18:44:49 +01:00
0252710020 remove Godeps
fixes #2722

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2018-09-11 12:11:24 -07:00
3e8e03939f fix typo
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-07-14 16:46:22 +02:00
2df61862ac coverage: disable plugin tests during sharness coverage collection
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-07-14 12:18:56 +02:00
36cbfa416d coverage: add dependency on DEPS_GO for coverage
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-07-14 11:45:53 +02:00
545f03e9c3 Jenkins CI
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-02-12 01:18:41 +01:00
730896c006 make: do not run coverage file unless clean of coverage targets are run
This reduces flat make time by half

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-02-12 01:18:40 +01:00
5b4ecae946 cover: do a cross package coverage
Figured out the way to do it much more cheaply, only few % overhead over
normal coverage.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-02-12 01:18:40 +01:00
f630222580 make: rework makefiles for non-recursive make and add sharness coverage
This commit introduces non-recursive Makefile infrastructure that replaces current Makefile infrastructure.
It also generally cleanups the Makefiles, separates them into nicer sub-modules and centralizes common operations into single definitions.

It allows to depend on any target that is defined in the makefile, this means that for example `gx install` is called once when `make build test_expensive_sharness` is called instead of 4 or 5 times.

It also makes the dependencies much cleaner and allows for reuse of modules. For example sharness coverage collection (WIP) uses sharness target with amended PATH, previously it might have been possible but not without wiring in the coverage collection into sharness make runner code.

Yes, it is more complex but not much more. There are few rules that have to be followed and few complexities added but IMHO it is worth it.

How to NR-make:
1. If make is to generate some file via a target, it MUST be defined in Rules.mk file in the directory of the target.
2. `Rules.mk` file MUST have `include mk/header.mk` statement as the first line and `include mk/footer.mk` statement as the last line (apart from project root `Rules.mk`).
3. It then MUST be included by the closest `Rules.mk` file up the directory tree.
4. Inside a `Rules.mk` special variable accessed as `$(d)` is defined. Its value is current directory, use it so if the `Rules.mk` file is moved in the tree it still works without a problem. Caution: this variable is not available in the recipe part and MUST NOT be used. Use name of the target or prerequisite to extract it if you need it.
5. Make has only one global scope, this means that name conflicts are a thing. Names SHOULD  follow `VAR_NAME_$(d)` convention. There are exceptions from this rule in form of well defined global variables. Examples: General lists `TGT_BIN`, `CLEAN`; General targets: `TEST`, `COVERAGE`; General variables: `GOFLAGS`, `DEPS_GO`.
3. Any rules, definitions or variables that fit some family SHOULD be defined in `mk/$family.mk` file and included from project root `Rules.mk`

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-02-12 01:18:40 +01:00