* fixing audit failures

* replacing lerna bootstrap with npm command

* audit fix for cache and tool-cache

* updating tunnel

* upgrading core packages

* re-adding tunnel as prod dep

* updating dependencies

* updating exec deps

* updating exec io package

* .

* Revert

* updating packages

* adding core as dep

* updating learna config

* updating lerna commands

* Removing audit failing packages in cache + tool-cache

* updating contribution bootstrap description

* updating libraries

* prettier lint

* hiding stricter rules

* updating prettier command

* Removing unknown flag

* Adding eslint prettier

* ignoring sym links

* updating ignore path

* updating prettier rules

* changing prettier + github ver

* updating ts and ignores

* Revert ts

* Adding unknown ignores

* downgrading lerna

* .

* adding nx

* Adding lint auto lint rules

* updating eslint ignore for glob packages

* Adding subdirs to ignore

* adding flag for ignore pattern in linter

* Expanding ignore regex

* Adding ignore rules

* adding another ignore pattern to tsconfig eslint

* adding ignore pattern to eslintrc

* syncing package-json

* updating traverse

* .

* test adding core and http client to base package

* running npm ci

* adding tsconfig paths

* adding base URL

* Adding explicit path to core and http-client

* editing tsc call

* updating artifact packages

* force build

* updating lock file version

* updating lock file version

* upgrading node version

* Adding babel traverse back

* fixing build issue

* fixing typescript ver

* updating package json

* Adding ignore for artifact test

* adding ignore to flags

* unlink after test completes

* cleanup

* merge + package edit
This commit is contained in:
Vallie Joseph
2023-08-03 16:36:11 -04:00
committed by Bethany
parent 1c71f655eb
commit ac336c5cf5
37 changed files with 6485 additions and 23359 deletions

View File

@@ -68,7 +68,7 @@ describe('retry-helper tests', () => {
it('all attempts fail', async () => {
let attempts = 0
let error: Error = (null as unknown) as Error
let error: Error = null as unknown as Error
try {
await retryHelper.execute(() => {
throw new Error(`some error ${++attempts}`)
@@ -87,7 +87,7 @@ describe('retry-helper tests', () => {
it('checks retryable after first attempt', async () => {
let attempts = 0
let error: Error = (null as unknown) as Error
let error: Error = null as unknown as Error
try {
await retryHelper.execute(
async () => {
@@ -105,7 +105,7 @@ describe('retry-helper tests', () => {
it('checks retryable after second attempt', async () => {
let attempts = 0
let error: Error = (null as unknown) as Error
let error: Error = null as unknown as Error
try {
await retryHelper.execute(
async () => {

View File

@@ -17,31 +17,28 @@ import * as tc from '../src/tool-cache'
const IS_WINDOWS = process.platform === 'win32'
const IS_MAC = process.platform === 'darwin'
describe('@actions/tool-cache', function() {
beforeAll(function() {
nock('http://example.com')
.persist()
.get('/bytes/35')
.reply(200, {
username: 'abc',
password: 'def'
})
describe('@actions/tool-cache', function () {
beforeAll(function () {
nock('http://example.com').persist().get('/bytes/35').reply(200, {
username: 'abc',
password: 'def'
})
setGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 0)
setGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 0)
})
beforeEach(async function() {
beforeEach(async function () {
await io.rmRF(cachePath)
await io.rmRF(tempPath)
await io.mkdirP(cachePath)
await io.mkdirP(tempPath)
})
afterEach(function() {
afterEach(function () {
setResponseMessageFactory(undefined)
})
afterAll(async function() {
afterAll(async function () {
await io.rmRF(tempPath)
await io.rmRF(cachePath)
setGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', undefined)
@@ -177,13 +174,10 @@ describe('@actions/tool-cache', function() {
})
it('has status code in exception dictionary for HTTP error code responses', async () => {
nock('http://example.com')
.persist()
.get('/bytes/bad')
.reply(400, {
username: 'bad',
password: 'file'
})
nock('http://example.com').persist().get('/bytes/bad').reply(400, {
username: 'bad',
password: 'file'
})
expect.assertions(2)
@@ -196,7 +190,7 @@ describe('@actions/tool-cache', function() {
}
})
it('works with redirect code 302', async function() {
it('works with redirect code 302', async function () {
nock('http://example.com')
.persist()
.get('/redirect-to')
@@ -295,7 +289,7 @@ describe('@actions/tool-cache', function() {
}
})
it('extract 7z using custom 7z tool', async function() {
it('extract 7z using custom 7z tool', async function () {
const tempDir = path.join(
__dirname,
'test-extract-7z-using-custom-7z-tool'
@@ -643,7 +637,7 @@ describe('@actions/tool-cache', function() {
}
)
it('installs a zip and extracts it to specified directory', async function() {
it('installs a zip and extracts it to specified directory', async function () {
const tempDir = path.join(__dirname, 'test-install-zip')
try {
await io.mkdirP(tempDir)
@@ -706,7 +700,7 @@ describe('@actions/tool-cache', function() {
}
})
it('extract zip to a directory that does not exist', async function() {
it('extract zip to a directory that does not exist', async function () {
const tempDir = path.join(__dirname, 'test-install-zip')
try {
await io.mkdirP(tempDir)
@@ -762,24 +756,16 @@ describe('@actions/tool-cache', function() {
}
})
it('works with a 502 temporary failure', async function() {
nock('http://example.com')
.get('/temp502')
.twice()
.reply(502, undefined)
nock('http://example.com')
.get('/temp502')
.reply(200, undefined)
it('works with a 502 temporary failure', async function () {
nock('http://example.com').get('/temp502').twice().reply(502, undefined)
nock('http://example.com').get('/temp502').reply(200, undefined)
const statusCodeUrl = 'http://example.com/temp502'
await tc.downloadTool(statusCodeUrl)
})
it("doesn't retry 502s more than 3 times", async function() {
nock('http://example.com')
.get('/perm502')
.times(3)
.reply(502, undefined)
it("doesn't retry 502s more than 3 times", async function () {
nock('http://example.com').get('/perm502').times(3).reply(502, undefined)
expect.assertions(1)
@@ -791,7 +777,7 @@ describe('@actions/tool-cache', function() {
}
})
it('retries 429s', async function() {
it('retries 429s', async function () {
nock('http://example.com')
.get('/too-many-requests-429')
.times(2)
@@ -808,13 +794,9 @@ describe('@actions/tool-cache', function() {
}
})
it("doesn't retry 404", async function() {
nock('http://example.com')
.get('/not-found-404')
.reply(404, undefined)
nock('http://example.com')
.get('/not-found-404')
.reply(500, undefined)
it("doesn't retry 404", async function () {
nock('http://example.com').get('/not-found-404').reply(404, undefined)
nock('http://example.com').get('/not-found-404').reply(500, undefined)
try {
const statusCodeUrl = 'http://example.com/not-found-404'
@@ -824,7 +806,7 @@ describe('@actions/tool-cache', function() {
}
})
it('supports authorization headers', async function() {
it('supports authorization headers', async function () {
nock('http://example.com', {
reqheaders: {
authorization: 'token abc123'
@@ -840,7 +822,7 @@ describe('@actions/tool-cache', function() {
)
})
it('supports custom headers', async function() {
it('supports custom headers', async function () {
nock('http://example.com', {
reqheaders: {
accept: 'application/octet-stream'
@@ -859,7 +841,7 @@ describe('@actions/tool-cache', function() {
)
})
it('supports authorization and custom headers', async function() {
it('supports authorization and custom headers', async function () {
nock('http://example.com', {
reqheaders: {
accept: 'application/octet-stream',