Skip to content

Commit

Permalink
Merge pull request #1345 from zowe/next-daemon-restart
Browse files Browse the repository at this point in the history
Next daemon restart
  • Loading branch information
gejohnston authored Mar 23, 2022
2 parents 62f3f98 + 32fffb9 commit 861f18b
Show file tree
Hide file tree
Showing 8 changed files with 845 additions and 608 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rust-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
path: zowex/target/debug/zowe.tgz

- name: Run tests
run: cargo test --verbose --manifest-path=zowex/Cargo.toml
run: cargo test unit --verbose --manifest-path=zowex/Cargo.toml

build-macos:
name: Build MacOS
Expand All @@ -69,7 +69,7 @@ jobs:
path: zowex/target/debug/zowe.tgz

- name: Run tests
run: cargo test --verbose --manifest-path=zowex/Cargo.toml
run: cargo test unit --verbose --manifest-path=zowex/Cargo.toml

build-windows:
name: Build Windows
Expand All @@ -93,4 +93,4 @@ jobs:
path: zowex/target/debug/zowe.tgz

- name: Run tests
run: cargo test --verbose --manifest-path=zowex/Cargo.toml
run: cargo test unit --verbose --manifest-path=zowex/Cargo.toml
39 changes: 35 additions & 4 deletions .github/workflows/zowe-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,29 @@ jobs:
id: setup-binary
run: tar -xvzf zowe.tgz -C ./__tests__/__resources__/daemon_instances

- name: Test Rust Linux EXE and zowe script
id: test-linux-exe-and-script
if: ${{ matrix.os != 'windows-latest' && steps.setup-binary.outcome == 'success' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }}
run: |
export PATH=$PATH:${{ github.workspace }}/__tests__/__resources__/application_instances
echo "PATH = $PATH"
cargo test ${{ github.event.inputs.binary-type == 'release' && '--release' || '' }} --manifest-path=zowex/Cargo.toml -- --nocapture
- name: Test Rust Windows EXE and zowe script
id: test-win-exe-and-script
if: ${{ matrix.os == 'windows-latest' && steps.setup-binary.outcome == 'success' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }}
run: |
# Adding to Path in GHActions is unreliable. Maybe Windows Path is too long? So we set Path in our script.
$ErrorActionPreference = 'silentlycontinue'
$shortPath = Split-Path (Get-Command pwsh).Path
if ( $shortPath.length -le 0 ) {
$shortPath = Split-Path (Get-Command Powershell).Path
}
$shortPath = "$shortPath;$(Split-Path (Get-Command node).Path);$(Split-Path (Get-Command cargo).Path);${{ github.workspace }}\__tests__\__resources__\application_instances"
$env:Path = $shortPath
echo "Path = $env:Path"
cargo test ${{ github.event.inputs.binary-type == 'release' && '--release' || '' }} --manifest-path=zowex/Cargo.toml -- --nocapture
- name: Unit Tests
id: unit
if: ${{ always() && steps.build.outcome == 'success' }}
Expand All @@ -122,12 +145,20 @@ jobs:
if: ${{ always() && steps.build.outcome == 'success' && matrix.os == 'ubuntu-latest' }}
uses: t1m0thyj/unlock-keyring@master

- name: Start Daemon
- name: Start Daemon on Windows only
id: start-daemon
if: ${{ always() && steps.build.outcome == 'success' && matrix.os == 'windows-latest' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }}
run: ./__tests__/__resources__/daemon_instances/zowe
env:
PATH: ${{ github.workspace }}\__tests__\__resources__\application_instances;${{ env.PATH }}
run: |
# Adding to Path in GHActions is unreliable. Maybe Windows Path is too long? So we set Path in our script.
$ErrorActionPreference = 'silentlycontinue'
$shortPath = Split-Path (Get-Command pwsh).Path
if ( $shortPath.length -le 0 ) {
$shortPath = Split-Path (Get-Command Powershell).Path
}
$shortPath = "$shortPath;$(Split-Path (Get-Command node).Path);$(Split-Path (Get-Command cargo).Path);${{ github.workspace }}\__tests__\__resources__\application_instances"
$env:Path = $shortPath
echo "Path = $env:Path"
./__tests__/__resources__/daemon_instances/zowe
- name: Integration Tests (Native)
id: integration-native
Expand Down
12 changes: 6 additions & 6 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,3 @@ Object {
},
}
`;

exports[`DaemonClient tests should shutdown when keyword is specified 1`] = `"Terminating server"`;
7 changes: 2 additions & 5 deletions packages/cli/src/daemon/DaemonClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,13 @@ export class DaemonClient {
}

/**
* Shutdown the daemon server cleanly
* Shutdown the daemon server cleanly. This is triggered when our EXE
* sends Control-C in the stdin property of its request object.
* @private
* @memberof DaemonClient
*/
private shutdown() {
// NOTE(Kelosky): this is not exposed yet, but will allow for a clean shut down if
// undocumented `--shutdown` is written to the persistent Processor. It should be wrapped
// in a new header and handled in DaemonClient.ts, e.g. x-zowe-daemon-shutdown
Imperative.api.appLogger.debug("shutting down");
this.mClient.write(`Terminating server`);
this.mClient.end();
this.mServer.close();
}
Expand Down
2 changes: 1 addition & 1 deletion zowex/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion zowex/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "zowe"
version = "0.8.0"
version = "0.9.0"
authors = ["Zowe Project"]
edition = "2018"
license = "EPL-2.0"
Expand Down
Loading

0 comments on commit 861f18b

Please sign in to comment.