Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement missing unit tests #5068

Open
yurishkuro opened this issue Jan 2, 2024 · 15 comments · Fixed by #5119
Open

Implement missing unit tests #5068

yurishkuro opened this issue Jan 2, 2024 · 15 comments · Fixed by #5119
Labels
good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement

Comments

@yurishkuro
Copy link
Member

Our CI enforces that all packages with .go files must have at least one _test.go file, to ensure the package is included in the code coverage, OR that it has a .nocover file when testing it is very difficult (e.g. requires external DB connection).

However, we somewhat abused the .nocover capability and have a bunch of packages that could have tests with high coverage. This ticket is about incrementally fixing those, which is a good first issue since the changes can be reasonably small if scoped to one package.

To see which packages need these tests, run make nocover.

Regarding ./examples/, where lots of .nocover files are found today, I think we can replace them with empty_test.go as we do in some other dirs, because examples will still be excluded from the overall coverage percentage, so there's no need to be excluding them via .nocover mechanism (it just creates noise).

@yurishkuro yurishkuro added help wanted Features that maintainers are willing to accept but do not have cycles to implement good first issue Good for beginners labels Jan 2, 2024
@chirag-ghosh
Copy link
Contributor

I would like to work on this

@yurishkuro
Copy link
Member Author

@chirag-ghosh thanks. I suggest you pick one of the packages and maybe post here that you're working on it, in case someone else also wants to pick another package. Don't combine multiple packages in one PR.

@chirag-ghosh
Copy link
Contributor

Sure. Since I'm new to the project, I'll first setup it in my local and the comment the package I'm working on ASAP.

@chirag-ghosh
Copy link
Contributor

@akagami-harsh
Copy link
Member

working on cmd/jeager/internal

@Pushkarm029
Copy link
Member

Pushkarm029 commented Jan 3, 2024

working on ./pkg/version/ & adding empty tests for ./examples/

yurishkuro added a commit to Pushkarm029/jaeger that referenced this issue Jan 3, 2024
yurishkuro added a commit that referenced this issue Jan 3, 2024
## Which problem is this PR solving?
- Part of #5068 

## Description of the changes
- added some missing unit tests in /pkg/version

## How was this change tested?
- go test

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
yurishkuro pushed a commit that referenced this issue Jan 4, 2024
## Which problem is this PR solving?
- Part of #5068 

## Description of the changes
- Added Empty Tests for `./examples` to reduce noise in `make nocover`.

## How was this change tested?
- go test

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
yurishkuro added a commit that referenced this issue Jan 10, 2024
## Which problem is this PR solving?
- Part of #5068 

## Description of the changes
- Add tests to storageexporter package

## How was this change tested?
- CI

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Chirag Ghosh <cghosh828049@gmail.com>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Co-authored-by: Yuri Shkuro <github@ysh.us>
@chirag-ghosh
Copy link
Contributor

Working on jaegerstorage

@tarhphilomina
Copy link
Contributor

working on Jaeger/plugin/

yurishkuro pushed a commit that referenced this issue Jan 18, 2024
## Which problem is this PR solving?
Part of  #5068 

## Description of the changes
- Added test to adaptive sampling plugin options

## How was this change tested?
- make test

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: tarhphilomina <156124227+tarhphilomina@users.noreply.github.com>
yurishkuro added a commit that referenced this issue Jan 18, 2024
## Which problem is this PR solving?
- #5068 

## Description of the changes
-  Add unit tests for jaegerstorage

## How was this change tested?
- 

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Chirag Ghosh <cghosh828049@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
yurishkuro added a commit that referenced this issue Jan 19, 2024
## Which problem is this PR solving?
- part of #5068 

## Description of the changes
- added missing unit test in cmd/jeager/internal and also added a
goroutine check for that package

## How was this change tested?
- go test

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`

---------

Signed-off-by: Harshvir Potpose <hpotpose62@gmail.com>
Signed-off-by: Harshvir Potpose <122517264+akagami-harsh@users.noreply.github.com>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Co-authored-by: Yuri Shkuro <github@ysh.us>
@VaibhavMalik4187
Copy link
Contributor

I'd like to work on internal/tracegen

VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 19, 2024
- part of jaegertracing#5068

- This commit adds tests for the `Run` function defined in the
  `internal/tracegen` package.

- make test

- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`

---------

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 19, 2024
- Partially Fixes jaegertracing#5068

- This commit adds tests for the `Run` function defined in the
  `internal/tracegen` package.

- make test

- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`

---------

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 19, 2024
- Partially fixes jaegertracing#5068

- This commit adds tests for the `Run` function defined in the `internal/tracegen` package.

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
@VaibhavMalik4187
Copy link
Contributor

VaibhavMalik4187 commented Jan 19, 2024

I'm working on the cmd/jaeger/internal/extension/jaegerquery/ package.

VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 20, 2024
- Partially fixes jaegertracing#5068

- This commit adds tests for the `Run` function defined in the `internal/tracegen` package.

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 20, 2024
- Partially fixes jaegertracing#5068

- This commit adds tests for the `Run` function defined in the `internal/tracegen` package.

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 20, 2024
- Partially fixes jaegertracing#5068

- This commit adds tests for the `Run` function defined in the `internal/tracegen` package.

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 20, 2024
- Partially fixes jaegertracing#5068

- This commit adds tests for the `Run` function defined in the `internal/tracegen` package.

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 20, 2024
- Partially fixes jaegertracing#5068

- This commit adds tests for the `Run` function defined in the `internal/tracegen` package.

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 21, 2024
- Partially fixes jaegertracing#5068

- This commit adds tests for the `Run` function defined in the `internal/tracegen` package.

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 21, 2024
Partially Addresses: jaegertracing#5068

- This commit adds tests for the
  `cmd/jaeger/internal/extension/jaegerquery` package. It brings the
  code coverage of the package to 84%

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 21, 2024
- Partially fixes jaegertracing#5068

- This commit adds tests tests in the `internal/tracegen` package,
  bringing the package coverage to 97%.

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
yurishkuro pushed a commit that referenced this issue Jan 21, 2024
## Which problem is this PR solving?
- Partially fixes #5068 

## Description of the changes
- This commit adds tests for the `internal/tracegen` package.

## How was this change tested?
- make test

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 21, 2024
Partially Addresses: jaegertracing#5068

- This commit adds tests for the
  `cmd/jaeger/internal/extension/jaegerquery` package. It brings the
  code coverage of the package to 84%

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
@yurishkuro yurishkuro reopened this Jan 21, 2024
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 23, 2024
Partially Addresses: jaegertracing#5068

- This commit adds tests for the
  `cmd/jaeger/internal/extension/jaegerquery` package. It brings the
  code coverage of the package to 84%

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 23, 2024
Partially Addresses: jaegertracing#5068

- This commit adds tests for the
  `cmd/jaeger/internal/extension/jaegerquery` package. It brings the
  code coverage of the package to 84%

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
VaibhavMalik4187 added a commit to VaibhavMalik4187/jaeger that referenced this issue Jan 23, 2024
Partially Addresses: jaegertracing#5068

- This commit adds tests for the
  `cmd/jaeger/internal/extension/jaegerquery` package. It brings the
  code coverage of the package to 84%

- make test

- [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
@prakrit55
Copy link
Contributor

I will cover ./cmd/anonymizer/app/query/ @yurishkuro

@Wise-Wizard
Copy link
Contributor

Hi @yurishkuro, Can I work on writing the test of cmd/jaeger/internal/extension/jaegerquery/?

yurishkuro pushed a commit that referenced this issue Jan 30, 2024
**Which problem is this PR solving?**

This PR addresses a part of the issue
[#5068](#5068) by adding
tests for the `pkg/cassandra/gocql/testutils` package.

**Description of the changes**

The commit introduces tests for the `pkg/cassandra/gocql/testutils`
package to ensure the correctness of the User Defined Type (UDT)
functionality. These tests cover the `MarshalUDT` and `UnmarshalUDT`
methods of the `CustomUDT` type.

**How was this change tested?**

The changes were tested by running the following command:

```bash
make test
```

**Checklist**

- [x] I have read
[CONTRIBUTING_GUIDELINES.md](https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md)
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - `for jaeger: make lint test`
  - `for jaeger-ui: yarn lint` and `yarn test`

---------

Signed-off-by: Wise-Wizard <saransh.shankar@gmail.com>
@Wise-Wizard
Copy link
Contributor

Hi @VaibhavMalik4187, do you plan on completing the PR regarding tests for JaegerQuery or I can go ahead and complete the remaining requirements?

@h4shk4t
Copy link
Contributor

h4shk4t commented Feb 3, 2024

I'd like to work on cmd/anonymizer/app/writer/

@zedGGs
Copy link

zedGGs commented Feb 5, 2024

Heey @yurishkuro, I can add tests too, what do u suggest is priority at the moment ?

yurishkuro added a commit that referenced this issue Feb 9, 2024
## Which problem is this PR solving?
- Part of [#5068](#5068)

## Description of the changes
- Added unit tests for `cmd/anonymizer/app/writer/`

## How was this change tested?
- `go test -cover -v ./cmd/anonymizer/app/writer`
- `make lint test`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Ashutosh Srivastava <ashutosh3002@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
yurishkuro added a commit that referenced this issue May 8, 2024
## Which problem is this PR solving?
- Part of #5068

## Description of the changes
- This commit adds tests for the
`cmd/jaeger/internal/extension/jaegerquery` package.

## How was this change tested?
- make test

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Co-authored-by: Yuri Shkuro <github@ysh.us>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement
Projects
None yet
10 participants