Skip to content

Commit

Permalink
tests: added missing environment variables for smoke test (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
philprime committed Feb 22, 2023
1 parent 8740e98 commit f34c644
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: 'CodeQL'

on:
push:
Expand All @@ -18,7 +12,7 @@ on:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
- cron: "24 5 * * 6"
- cron: '24 5 * * 6'

jobs:
analyze:
Expand All @@ -32,9 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
language: ['javascript']

steps:
- name: Checkout repository
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@
"devDependencies": {
"@types/jest": "^29.4.0",
"@types/node": "^16.18.1",
"@typescript-eslint/eslint-plugin": "5.42.1",
"@typescript-eslint/parser": "5.42.1",
"@vercel/ncc": "^0.36.1",
"eslint": "^8.34.0",
"jest": "^29.4.3",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"eslint-config-prettier": "8.6.0",
"eslint-config-standard": "17.0.0",
"eslint-plugin-import": "2.27.5",
Expand All @@ -49,7 +47,10 @@
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-promise": "6.1.1",
"@typescript-eslint/eslint-plugin": "5.42.1",
"@typescript-eslint/parser": "5.42.1"
"jest": "^29.4.3",
"prettier": "^2.8.4",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.5"
}
}
7 changes: 6 additions & 1 deletion src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import * as cp from 'child_process';
import * as path from 'path';
import * as process from 'process';

test('test runs', () => {
process.env['INPUT_REPOSITORY'] = 'kula-app/remove-stale-workflow-runs';
process.env['INPUT_MAX_RUNS_LIMIT'] = '5000';
process.env['INPUT_DRY_RUN'] = 'false';
const ip = path.join(__dirname, '../', 'dist', 'index.js');
const cmd = `node ${ip}`;
try {
const result = cp.execSync(cmd, { env: process.env }).toString();
console.log(result);
} catch (error) {
console.error(error);
fail(error);
console.error(error.stdout?.toString());
console.error(error.stderr?.toString());
throw error;
}
});
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3135,6 +3135,11 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@^2.8.4:
version "2.8.4"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.4.tgz#34dd2595629bfbb79d344ac4a91ff948694463c3"
integrity sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==

pretty-format@^29.0.0, pretty-format@^29.4.3:
version "29.4.3"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.4.3.tgz#25500ada21a53c9e8423205cf0337056b201244c"
Expand Down

0 comments on commit f34c644

Please sign in to comment.