-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dapr stop -f fix and E2E tests for dapr stop and list (#1181)
* E2E tests for dapr stop and list Signed-off-by: Pravin Pushkar <[email protected]> * cmdstop to cmdStopWithAppID Signed-off-by: Pravin Pushkar <[email protected]> * review comments Signed-off-by: Pravin Pushkar <[email protected]> * stop all started processes for dapr apps with kill process group Signed-off-by: Pravin Pushkar <[email protected]> * stop all apps in run template test Signed-off-by: Pravin Pushkar <[email protected]> * fix tests Signed-off-by: Pravin Pushkar <[email protected]> * separating os syscall and renaming file Signed-off-by: Pravin Pushkar <[email protected]> * moving syscall.go to pkg/syscall Signed-off-by: Pravin Pushkar <[email protected]> * name change Signed-off-by: Pravin Pushkar <[email protected]> * fixed windows error Signed-off-by: Pravin Pushkar <[email protected]> * use syscall.kill Signed-off-by: Pravin Pushkar <[email protected]> * review comments Signed-off-by: Pravin Pushkar <[email protected]> --------- Signed-off-by: Pravin Pushkar <[email protected]> Co-authored-by: Mukundan Sundararajan <[email protected]>
- Loading branch information
1 parent
b2daa8d
commit 778b2a5
Showing
17 changed files
with
229 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 1 addition & 21 deletions
22
pkg/standalone/testdata/runfileconfig/test_run_config_empty_app_dir.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,5 @@ | ||
version: 1 | ||
common: | ||
resourcesPath: ./app/resources | ||
appProtocol: HTTP | ||
appHealthProbeTimeout: 10 | ||
env: | ||
- name: DEBUG | ||
value: false | ||
- name: tty | ||
value: sts | ||
apps: | ||
- appDirPath: ./webapp/ | ||
resourcesPath: ./resources | ||
configFilePath: ./config.yaml | ||
appPort: 8080 | ||
appHealthProbeTimeout: 1 | ||
command: ["python3", "app.py"] | ||
- appID: backend | ||
appProtocol: GRPC | ||
appPort: 3000 | ||
unixDomainSocket: /tmp/test-socket | ||
env: | ||
- name: DEBUG | ||
value: true | ||
command: ["./backend"] | ||
- appID: backend |
22 changes: 1 addition & 21 deletions
22
pkg/standalone/testdata/runfileconfig/test_run_config_invalid_path.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,6 @@ | ||
version: 1 | ||
common: | ||
resourcesPath: ./app/resources | ||
appProtocol: HTTP | ||
appHealthProbeTimeout: 10 | ||
env: | ||
- name: DEBUG | ||
value: false | ||
- name: tty | ||
value: sts | ||
apps: | ||
- appDirPath: ./webapp/ | ||
resourcesPath: ./resources | ||
configFilePath: ./config.yaml | ||
appPort: 8080 | ||
appHealthProbeTimeout: 1 | ||
command: ["python3", "app.py"] | ||
- appID: backend | ||
appDirPath: ./invalid_backend/ | ||
appProtocol: GRPC | ||
appPort: 3000 | ||
unixDomainSocket: /tmp/test-socket | ||
env: | ||
- name: DEBUG | ||
value: true | ||
command: ["./backend"] | ||
appDirPath: ./invalid_backend/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//go:build !windows | ||
// +build !windows | ||
|
||
/* | ||
Copyright 2021 The Dapr Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package syscall | ||
|
||
import ( | ||
"os" | ||
"os/signal" | ||
"syscall" | ||
|
||
"github.com/dapr/cli/pkg/print" | ||
) | ||
|
||
func SetupShutdownNotify(sigCh chan os.Signal) { | ||
signal.Notify(sigCh, syscall.SIGTERM, syscall.SIGINT) | ||
} | ||
|
||
// CreateProcessGroupID creates a process group ID for the current process. | ||
// Reference - https://man7.org/linux/man-pages/man2/setpgid.2.html. | ||
func CreateProcessGroupID() { | ||
// Below is some excerpt from the above link Setpgid() - | ||
// setpgid() sets the PGID of the process specified by pid to pgid. | ||
// If pid is zero, then the process ID of the calling process is | ||
// used. If pgid is zero, then the PGID of the process specified by | ||
// pid is made the same as its process ID. | ||
if err := syscall.Setpgid(0, 0); err != nil { | ||
print.WarningStatusEvent(os.Stdout, "Failed to create process group id: %s", err.Error()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.