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

[full-ci][tests-only]Add support to stop and start service in ociswrapper #10776

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

amrita-shrestha
Copy link
Contributor

@amrita-shrestha amrita-shrestha commented Dec 17, 2024

Description

This adds new feature on ocis wrapper to stop/ start sevices.

Related Issue

Motivation and Context

How Has This Been Tested?

  • start ocis > send api request to restart ocis service independently
    curl -XPOST 'http://localhost:5200/services/storage-users' -d'{"OCIS_LOG_LEVEL":"info"}'
  • stop service but ocis should be running without specific service
    curl -XDELETE 'http://localhost:5200/services/storage-users'
  • rollback ocis should stop all service and restart ocis with initial env
  • run tests locally
  • run on CI

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@amrita-shrestha amrita-shrestha self-assigned this Dec 17, 2024
@amrita-shrestha amrita-shrestha force-pushed the add-support-to-stop-and-start-service-in-ociswrapper branch 3 times, most recently from 2125c45 to b3c2e20 Compare December 18, 2024 11:37
@amrita-shrestha
Copy link
Contributor Author

amrita-shrestha commented Dec 30, 2024

waiting for #10808 to get merged

@amrita-shrestha amrita-shrestha force-pushed the add-support-to-stop-and-start-service-in-ociswrapper branch 5 times, most recently from cc95565 to 5f509bd Compare January 7, 2025 16:37
@amrita-shrestha amrita-shrestha force-pushed the add-support-to-stop-and-start-service-in-ociswrapper branch 3 times, most recently from 43f62bd to 27074ac Compare January 9, 2025 06:37
@amrita-shrestha amrita-shrestha marked this pull request as ready for review January 9, 2025 10:12
tests/ociswrapper/wrapper/wrapper.go Outdated Show resolved Hide resolved
tests/ociswrapper/wrapper/handlers/handler.go Outdated Show resolved Hide resolved
tests/ociswrapper/wrapper/handlers/handler.go Outdated Show resolved Hide resolved
@amrita-shrestha amrita-shrestha force-pushed the add-support-to-stop-and-start-service-in-ociswrapper branch from df7c67f to 296bdb6 Compare January 13, 2025 08:20
tests/acceptance/bootstrap/OcisConfigContext.php Outdated Show resolved Hide resolved
tests/acceptance/bootstrap/OcisConfigContext.php Outdated Show resolved Hide resolved
tests/ociswrapper/ocis/ocis.go Outdated Show resolved Hide resolved
@amrita-shrestha amrita-shrestha force-pushed the add-support-to-stop-and-start-service-in-ociswrapper branch 2 times, most recently from e78d3cc to d7778d4 Compare January 13, 2025 11:47
@amrita-shrestha amrita-shrestha force-pushed the add-support-to-stop-and-start-service-in-ociswrapper branch from 7a826fa to d7c4771 Compare January 23, 2025 10:16
serviceEnvMap = append(serviceEnvMap, fmt.Sprintf("%s=%v", key, value))
}

log.Println(fmt.Sprintf("[ociswrapper] Starting oCIS service %s......", serviceName))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests/ociswrapper/ocis/ocis.go Outdated Show resolved Hide resolved
tests/ociswrapper/ocis/ocis.go Outdated Show resolved Hide resolved
@amrita-shrestha amrita-shrestha force-pushed the add-support-to-stop-and-start-service-in-ociswrapper branch 4 times, most recently from d50e565 to 26019b2 Compare January 23, 2025 15:46
@amrita-shrestha amrita-shrestha force-pushed the add-support-to-stop-and-start-service-in-ociswrapper branch 4 times, most recently from 54d170c to 0251708 Compare January 24, 2025 11:18
@amrita-shrestha amrita-shrestha force-pushed the add-support-to-stop-and-start-service-in-ociswrapper branch from 0251708 to b8dc144 Compare January 27, 2025 06:02

@env-config
Scenario: check services health and readiness while running separately
Given the administrator has started service "audit" separately with the following config:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Given the administrator has started service "audit" separately with the following config:
Given the administrator has started service "audit" separately with the following configs:

* @return ResponseInterface
* @throws GuzzleException
*/
public static function startService(string $service, array $envs): ResponseInterface {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

env can have default value

Suggested change
public static function startService(string $service, array $envs): ResponseInterface {
public static function startService(string $service, array $envs = []): ResponseInterface {

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.

5 participants