Skip to content

Commit 861f18b

Browse files
authored
Merge pull request #1345 from zowe/next-daemon-restart
Next daemon restart
2 parents 62f3f98 + 32fffb9 commit 861f18b

File tree

8 files changed

+845
-608
lines changed

8 files changed

+845
-608
lines changed

.github/workflows/rust-cli.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
path: zowex/target/debug/zowe.tgz
4646

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

5050
build-macos:
5151
name: Build MacOS
@@ -69,7 +69,7 @@ jobs:
6969
path: zowex/target/debug/zowe.tgz
7070

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

7474
build-windows:
7575
name: Build Windows
@@ -93,4 +93,4 @@ jobs:
9393
path: zowex/target/debug/zowe.tgz
9494

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

.github/workflows/zowe-cli.yml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,29 @@ jobs:
112112
id: setup-binary
113113
run: tar -xvzf zowe.tgz -C ./__tests__/__resources__/daemon_instances
114114

115+
- name: Test Rust Linux EXE and zowe script
116+
id: test-linux-exe-and-script
117+
if: ${{ matrix.os != 'windows-latest' && steps.setup-binary.outcome == 'success' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }}
118+
run: |
119+
export PATH=$PATH:${{ github.workspace }}/__tests__/__resources__/application_instances
120+
echo "PATH = $PATH"
121+
cargo test ${{ github.event.inputs.binary-type == 'release' && '--release' || '' }} --manifest-path=zowex/Cargo.toml -- --nocapture
122+
123+
- name: Test Rust Windows EXE and zowe script
124+
id: test-win-exe-and-script
125+
if: ${{ matrix.os == 'windows-latest' && steps.setup-binary.outcome == 'success' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }}
126+
run: |
127+
# Adding to Path in GHActions is unreliable. Maybe Windows Path is too long? So we set Path in our script.
128+
$ErrorActionPreference = 'silentlycontinue'
129+
$shortPath = Split-Path (Get-Command pwsh).Path
130+
if ( $shortPath.length -le 0 ) {
131+
$shortPath = Split-Path (Get-Command Powershell).Path
132+
}
133+
$shortPath = "$shortPath;$(Split-Path (Get-Command node).Path);$(Split-Path (Get-Command cargo).Path);${{ github.workspace }}\__tests__\__resources__\application_instances"
134+
$env:Path = $shortPath
135+
echo "Path = $env:Path"
136+
cargo test ${{ github.event.inputs.binary-type == 'release' && '--release' || '' }} --manifest-path=zowex/Cargo.toml -- --nocapture
137+
115138
- name: Unit Tests
116139
id: unit
117140
if: ${{ always() && steps.build.outcome == 'success' }}
@@ -122,12 +145,20 @@ jobs:
122145
if: ${{ always() && steps.build.outcome == 'success' && matrix.os == 'ubuntu-latest' }}
123146
uses: t1m0thyj/unlock-keyring@master
124147

125-
- name: Start Daemon
148+
- name: Start Daemon on Windows only
126149
id: start-daemon
127150
if: ${{ always() && steps.build.outcome == 'success' && matrix.os == 'windows-latest' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }}
128-
run: ./__tests__/__resources__/daemon_instances/zowe
129-
env:
130-
PATH: ${{ github.workspace }}\__tests__\__resources__\application_instances;${{ env.PATH }}
151+
run: |
152+
# Adding to Path in GHActions is unreliable. Maybe Windows Path is too long? So we set Path in our script.
153+
$ErrorActionPreference = 'silentlycontinue'
154+
$shortPath = Split-Path (Get-Command pwsh).Path
155+
if ( $shortPath.length -le 0 ) {
156+
$shortPath = Split-Path (Get-Command Powershell).Path
157+
}
158+
$shortPath = "$shortPath;$(Split-Path (Get-Command node).Path);$(Split-Path (Get-Command cargo).Path);${{ github.workspace }}\__tests__\__resources__\application_instances"
159+
$env:Path = $shortPath
160+
echo "Path = $env:Path"
161+
./__tests__/__resources__/daemon_instances/zowe
131162
132163
- name: Integration Tests (Native)
133164
id: integration-native

npm-shrinkwrap.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/__tests__/daemon/__unit__/__snapshots__/DaemonClient.unit.test.ts.snap

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,3 @@ Object {
116116
},
117117
}
118118
`;
119-
120-
exports[`DaemonClient tests should shutdown when keyword is specified 1`] = `"Terminating server"`;

packages/cli/src/daemon/DaemonClient.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,13 @@ export class DaemonClient {
7070
}
7171

7272
/**
73-
* Shutdown the daemon server cleanly
73+
* Shutdown the daemon server cleanly. This is triggered when our EXE
74+
* sends Control-C in the stdin property of its request object.
7475
* @private
7576
* @memberof DaemonClient
7677
*/
7778
private shutdown() {
78-
// NOTE(Kelosky): this is not exposed yet, but will allow for a clean shut down if
79-
// undocumented `--shutdown` is written to the persistent Processor. It should be wrapped
80-
// in a new header and handled in DaemonClient.ts, e.g. x-zowe-daemon-shutdown
8179
Imperative.api.appLogger.debug("shutting down");
82-
this.mClient.write(`Terminating server`);
8380
this.mClient.end();
8481
this.mServer.close();
8582
}

zowex/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zowex/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "zowe"
3-
version = "0.8.0"
3+
version = "0.9.0"
44
authors = ["Zowe Project"]
55
edition = "2018"
66
license = "EPL-2.0"

0 commit comments

Comments
 (0)