Skip to content

Commit

Permalink
Merge branch 'master' into add-cargo-req-note
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
  • Loading branch information
zFernand0 authored Oct 30, 2023
2 parents aaddc3c + 6128204 commit f395e35
Show file tree
Hide file tree
Showing 1,461 changed files with 163,444 additions and 6,693 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jobs:
with:
node-version: lts/*

- name: Use NPM v8
id: npm8
run: npm install -g npm@^8

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

Expand All @@ -36,7 +32,7 @@ jobs:
- name: Check Daemon Vulnerabilities
working-directory: zowex
run: cargo audit --deny warnings

- name: Check Secrets SDK Vulnerabilities
working-directory: packages/secrets/src/keyring
run: cargo audit --deny warnings
4 changes: 0 additions & 4 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ jobs:
with:
node-version: lts/*

- name: Use NPM v8
id: npm8
run: npm install -g npm@^8

- name: Install Node Package Dependencies
run: npm ci

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/secrets-sdk-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
check-latest: true
cache: npm
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/secrets-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ jobs:
- host: windows-latest
target: aarch64-pc-windows-msvc
build: npm run build -- --target aarch64-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@18
name: stable - ${{ matrix.settings.target }} - node@20
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
if: ${{ !matrix.settings.docker }}
with:
node-version: 18
node-version: 20
check-latest: true
cache: npm
- name: Install
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
uses: actions/setup-node@v3
if: matrix.settings.target == 'i686-pc-windows-msvc'
with:
node-version: 18
node-version: 20
check-latest: true
cache: npm
architecture: x86
Expand Down
39 changes: 5 additions & 34 deletions .github/workflows/zowe-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ on:
description: Specify whether to run tests using the `binary` or regular `nodejs` executable
default: binary
required: false
imperative-branch:
description: Specify name of Imperative branch to checkout and build from source
required: false

jobs:
test:
Expand All @@ -38,7 +35,7 @@ jobs:
NODE: ${{ matrix.node-version }}
NODE_OPTIONS: --max_old_space_size=4096

timeout-minutes: 60
timeout-minutes: 75

concurrency:
group: ${{ matrix.os }}-node-${{ matrix.node-version }}-ci-${{ github.ref }}
Expand All @@ -63,19 +60,9 @@ jobs:
id: npm-version
run: echo "number=$(npm --version)" >> $GITHUB_OUTPUT

- name: Use NPM v8
id: npm8
run: npm install -g npm@~8.3.2

- name: Install Dependencies
run: npm ci

- name: Update Dependencies
id: npm-update
uses: zowe-actions/octorelease/script@v1
with:
script: npmUpdate

- name: Use Original NPM Version
id: original-npm-version
run: npm install -g npm@${{ steps.npm-version.outputs.number || '9' }}
Expand All @@ -85,14 +72,6 @@ jobs:
if: github.event.inputs.test-type == 'binary' || github.event_name == 'push'
uses: dtolnay/rust-toolchain@stable

- name: Checkout Imperative
id: checkout-imperative
if: github.event_name == 'workflow_dispatch' && github.event.inputs.imperative-branch != ''
run: |
cd node_modules/@zowe && npx rimraf imperative
git clone --branch ${{ github.event.inputs.imperative-branch }} --depth 1 https://github.com/zowe/imperative.git
cd imperative && npm ci --ignore-scripts && npx tsc
- name: Build Source
id: build
run: npm run build
Expand Down Expand Up @@ -154,7 +133,7 @@ jobs:

- name: Integration Tests (Daemon)
if: ${{ always() && steps.build.outcome == 'success' && (github.event.inputs.test-type == 'binary' || github.event_name == 'push') }}
run: npm run test:integration -- --runInBand
run: npm run test:integration:inband

- name: Archive Results
if: ${{ always() && steps.build.outcome == 'success' }}
Expand Down Expand Up @@ -182,23 +161,15 @@ jobs:
persist-credentials: false
ref: ${{ github.ref }}

- name: Use Node.js 18
# Use Node 20. Currently the latest.
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'

- name: Install Dependencies
run: npm ci

- name: Update Dependencies
uses: zowe-actions/octorelease/script@v1
env:
GIT_COMMITTER_NAME: ${{ secrets.ZOWE_ROBOT_USER }}
GIT_COMMITTER_EMAIL: ${{ secrets.ZOWE_ROBOT_EMAIL }}
NPM_RESOLUTIONS: ${{ needs.test.outputs.npm-resolutions }}
with:
script: npmUpdate

- name: Build Source
run: npm run build

Expand Down
16 changes: 11 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ npm-debug.log
lerna-debug.log
local.json
output/
/logs/
**/logs/*.log
CCS141/
.vscode
.idea
.npm-global
src/brightside.iml
package-lock.json
/packages/cli/npm-shrinkwrap.json
Expand Down Expand Up @@ -63,7 +64,6 @@ fabric.properties
!/.idea/artifacts/
/.idea/dictionaries/
/gui/BrightSide-win32-x64/
lib/
typings/
/gui/BrightSide-linux-x64/
/gui/BrightSide-darwin-x64/
Expand Down Expand Up @@ -93,11 +93,13 @@ imperative_debug.log
#MacOS fs
.DS_Store

/web-help/dist/

*.bat

/packages/cli/lib
# we do not commit lib files
**/lib/
# we DO commit pre-compiled plugin test modules
!/packages/imperative/__tests__/src/packages/imperative/plugins/test_plugins/*/lib/

/packages/cli/__tests__/__results__
/packages/cli/prebuilds
zowe.config.json
Expand All @@ -112,3 +114,7 @@ __tests__/__packages__/*/LICENSE
# Rust and native binaries
target/
*.node

# Browserified bundles and compiled JS for web help
packages/imperative/web-help/dist/css/bundle*
packages/imperative/web-help/dist/js/
4 changes: 4 additions & 0 deletions __tests__/__packages__/cli-test-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the Zowe CLI test utils package will be documented in this file.

## `7.18.9`

- Enhancement: Adds the `CLI_TEST_UTILS_USE_PROJECT_ROOT_DIR` environment variable to force the test utility to use the global project dir instead of workspace dirs if set.

## `7.16.1`

- BugFix: Don't assume that folder containing `lerna.json` is root directory unless it also contains a `__tests__` subfolder.
Expand Down
4 changes: 2 additions & 2 deletions __tests__/__packages__/cli-test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zowe/cli-test-utils",
"version": "7.18.7",
"version": "7.18.9",
"description": "Test utilities package for Zowe CLI plug-ins",
"author": "Zowe",
"license": "EPL-2.0",
Expand Down Expand Up @@ -44,7 +44,7 @@
"@types/js-yaml": "^4.0.0",
"@types/node": "^14.18.28",
"@types/uuid": "^8.3.0",
"@zowe/imperative": "5.18.2",
"@zowe/imperative": "7.18.9",
"eslint": "^8.22.0",
"typescript": "^4.0.0"
},
Expand Down
2 changes: 2 additions & 0 deletions __tests__/__packages__/cli-test-utils/src/TestConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ function projectRootDir() {
};

const testRootDir = getTestRootDir(finalProjectRootDir);

if (process.env.CLI_TEST_UTILS_USE_PROJECT_ROOT_DIR && lernaTestDirExists) { return finalProjectRootDir; }
// lernaTestDirExists == true XOR (finalProjectRootDir == testRootDir)
TEST_USING_WORKSPACE = lernaTestDirExists ? finalProjectRootDir != testRootDir : finalProjectRootDir == testRootDir;
return TEST_USING_WORKSPACE ? testRootDir : finalProjectRootDir;
Expand Down
11 changes: 11 additions & 0 deletions __tests__/__resources__/env/integration-imperative.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# environmental variable settings for integration tests

FORCE_COLOR=1
JEST_JUNIT_OUTPUT_DIR=__tests__/__results__/integration
JEST_JUNIT_OUTPUT_NAME=junit-imperative.xml
JEST_SUITE_NAME="Integration Tests"
JEST_JUNIT_ANCESTOR_SEPARATOR=" > "
JEST_JUNIT_CLASSNAME="Integration.{classname}"
JEST_JUNIT_TITLE="{title}"
JEST_STARE_RESULT_DIR=__tests__/__results__/integration/jest-stare
JEST_STARE_RESULT_HTML=index.html
1 change: 1 addition & 0 deletions __tests__/__resources__/env/unit.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# environmental variable settings for unit tests

FORCE_COLOR=1
NODE_OPTIONS=--max-old-space-size=4096
JEST_JUNIT_OUTPUT_DIR=__tests__/__results__/unit
JEST_SUITE_NAME="Unit Tests"
JEST_JUNIT_ANCESTOR_SEPARATOR=" > "
Expand Down
8 changes: 8 additions & 0 deletions __tests__/beforeTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@
*/

jest.setTimeout(60000);

// Set this to be true always in case someone runs npx jest
process.env.CLI_TEST_UTILS_USE_PROJECT_ROOT_DIR = true;

beforeAll(() => {
// If the worker runs out of memory, this needs to be reset
require('events').EventEmitter.defaultMaxListeners = Infinity;
});
14 changes: 14 additions & 0 deletions __tests__/teardown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*
*/

module.exports = async function (globalConfig, projectConfig) {
process.exitCode = 0; // Thanks Node 20
}
6 changes: 3 additions & 3 deletions __tests__/test-tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
"node",
"jest"
],
"lib": [
"esnext"
],
"target": "es2015",
"module": "commonjs",
"declaration": true,
Expand All @@ -23,6 +20,9 @@
"./**/*.ts",
"../packages/**/__tests__/**/*.ts"
],
"files": [
"../__types__/wontache.d.ts"
],
"exclude": [
"lib",
"__results__/",
Expand Down
5 changes: 5 additions & 0 deletions __types__/wontache.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Remove this file once wontache adds type definitions
declare module 'wontache' {
type CompiledTemplate = any;
type Partials = any;
}
Loading

0 comments on commit f395e35

Please sign in to comment.