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

Add integraton tests #316

Merged
merged 5 commits into from
Sep 7, 2023
Merged

Add integraton tests #316

merged 5 commits into from
Sep 7, 2023

Conversation

afritzler
Copy link
Member

@afritzler afritzler commented Aug 22, 2023

Proposed Changes

  • Start a ceph cluster using microceph inside GH runner instance
  • Instanciate GRPC server
  • Instanciate ORI client
  • Ensure the correct behaviour by calling the corresponding ORI methods
  • Ensure that the resources have been correctly created using the ceph-go rados client
  • Bump onmetal-api deps

The integration workflow only runs when the integration-tests label is added to a PR.

The integration package contains a test suite and a first integration test for the Volume creation flow. The basic idea is to call ORI volume provided methods and ensure via a ceph client that the resources have been correctly created in the cluster.

To run the integration tests locally you need to pass the integration label to ginkgo:

go test ./... -ginkgo.label-filter="integration"

Fixes #315

@afritzler afritzler requested a review from a team as a code owner August 22, 2023 14:54
@github-actions github-actions bot added size/L enhancement New feature or request labels Aug 22, 2023
@afritzler afritzler added integration-tests and removed enhancement New feature or request size/L labels Aug 22, 2023
@github-actions github-actions bot added enhancement New feature or request size/L labels Aug 22, 2023
@afritzler afritzler force-pushed the enh/integration-tests branch 6 times, most recently from deff90b to 535d3c7 Compare August 23, 2023 07:59
@afritzler
Copy link
Member Author

@lukasfrank currently the Quantity in the Pool stats is hard coded and needs to be fixed.

@afritzler
Copy link
Member Author

@adracus I am using go build tags to separate the integration tests from other unit tests. I am not sure if that is the most elegant way to do that. Maybe you have a better idea on how to do that.

@afritzler afritzler force-pushed the enh/integration-tests branch from 7fbed2a to 282f625 Compare September 7, 2023 08:40
- Start a ceph cluster using microceph inside GH runner instance
- Instanciate GRPC server
- Instanciate ORI client
- Ensure the correct behaviour by calling the corresponding ORI methods
- Ensure that the resources have been correctly created using the
  ceph-go rados client
- Modify the `integration-tests` target in the `Makefile` to use the `-- -ginkgo.label-filter="integration"` flag
- Remove the `//go:build integration` and `// +build integration` comments from the `integration_suite_test.go` file
- Modify the `TestIntegration_GRPCServer` function in the `integration_suite_test.go` file to include the `Label("integration")` option when calling `RunSpecs`
- Remove the `//go:build integration` and `// +build integration` comments from the `volume_craete_integration_test.go` file

Signed-off-by: Andreas Fritzler <[email protected]>
- Modify the test command to include a ginkgo label filter to exclude integration tests

Signed-off-by: Andreas Fritzler <[email protected]>
@afritzler afritzler force-pushed the enh/integration-tests branch 3 times, most recently from 6318f34 to a889c77 Compare September 7, 2023 08:49
@lukasfrank
Copy link
Member

lukasfrank commented Sep 7, 2023

@lukasfrank currently the Quantity in the Pool stats is hard coded and needs to be fixed.

For now we share the Quantity across all the announced classes. Currently, we read the total available storage of the ceph cluster and return it. I propose to tune this later once we learned how the utilisation influences the performance.

@afritzler afritzler force-pushed the enh/integration-tests branch 3 times, most recently from 26defba to ce3486a Compare September 7, 2023 09:16
@afritzler afritzler force-pushed the enh/integration-tests branch 7 times, most recently from adfcc27 to b92b2b3 Compare September 7, 2023 11:23
- Add an `integration-tests` label to the `release-drafter.yml` file
- Add a file matching pattern for integration tests in the `release-drafter.yml` file
- Remove an unnecessary line of code in the `volume_craete_integration_test.go` file

Signed-off-by: Andreas Fritzler <[email protected]>
@afritzler afritzler force-pushed the enh/integration-tests branch from b92b2b3 to 022a96d Compare September 7, 2023 11:41
@afritzler afritzler merged commit 0fc5541 into main Sep 7, 2023
@afritzler afritzler deleted the enh/integration-tests branch September 7, 2023 11:58
lukas016 pushed a commit to opensovereigncloud/ceph-provider that referenced this pull request May 23, 2024
* Add integraton tests

- Start a ceph cluster using microceph inside GH runner instance
- Instanciate GRPC server
- Instanciate ORI client
- Ensure the correct behaviour by calling the corresponding ORI methods
- Ensure that the resources have been correctly created using the
  ceph-go rados client

* Bump onmetal-api

* test: refactor integration testing configuration and annotations

- Modify the `integration-tests` target in the `Makefile` to use the `-- -ginkgo.label-filter="integration"` flag
- Remove the `//go:build integration` and `// +build integration` comments from the `integration_suite_test.go` file
- Modify the `TestIntegration_GRPCServer` function in the `integration_suite_test.go` file to include the `Label("integration")` option when calling `RunSpecs`
- Remove the `//go:build integration` and `// +build integration` comments from the `volume_craete_integration_test.go` file

Signed-off-by: Andreas Fritzler <[email protected]>

* test: exclude integration tests from the test command

- Modify the test command to include a ginkgo label filter to exclude integration tests

Signed-off-by: Andreas Fritzler <[email protected]>

* refactor release-drafter.yml and integration tests configuration

- Add an `integration-tests` label to the `release-drafter.yml` file
- Add a file matching pattern for integration tests in the `release-drafter.yml` file
- Remove an unnecessary line of code in the `volume_craete_integration_test.go` file

Signed-off-by: Andreas Fritzler <[email protected]>

---------

Signed-off-by: Andreas Fritzler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup Mini Ceph Environment in Github Runner
2 participants