mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-05-04 07:08:04 +08:00
Rename the prefix to be more specific
This commit is contained in:
@@ -42,13 +42,13 @@ describe('uploadChunkTimeoutEnv', () => {
|
||||
expect(config.getUploadChunkTimeout()).toBe(300000)
|
||||
})
|
||||
|
||||
it('should return value set in ACTIONS_UPLOAD_TIMEOUT_MS', () => {
|
||||
process.env.ACTIONS_UPLOAD_TIMEOUT_MS = '150000'
|
||||
it('should return value set in ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS', () => {
|
||||
process.env.ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS = '150000'
|
||||
expect(config.getUploadChunkTimeout()).toBe(150000)
|
||||
})
|
||||
|
||||
it('should throw if value set in ACTIONS_UPLOAD_TIMEOUT_MS is invalid', () => {
|
||||
process.env.ACTIONS_UPLOAD_TIMEOUT_MS = 'abc'
|
||||
it('should throw if value set in ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS is invalid', () => {
|
||||
process.env.ACTIONS_ARTIFACT_UPLOAD_TIMEOUT_MS = 'abc'
|
||||
expect(() => {
|
||||
config.getUploadChunkTimeout()
|
||||
}).toThrow()
|
||||
@@ -71,23 +71,23 @@ describe('uploadConcurrencyEnv', () => {
|
||||
expect(config.getConcurrency()).toBe(300)
|
||||
})
|
||||
|
||||
it('should return override value when ACTIONS_UPLOAD_CONCURRENCY is set', () => {
|
||||
it('should return override value when ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY is set', () => {
|
||||
;(os.cpus as jest.Mock).mockReturnValue(new Array(4))
|
||||
process.env.ACTIONS_UPLOAD_CONCURRENCY = '10'
|
||||
process.env.ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY = '10'
|
||||
expect(config.getConcurrency()).toBe(10)
|
||||
})
|
||||
|
||||
it('should throw with invalid value of ACTIONS_UPLOAD_CONCURRENCY', () => {
|
||||
it('should throw with invalid value of ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY', () => {
|
||||
;(os.cpus as jest.Mock).mockReturnValue(new Array(4))
|
||||
process.env.ACTIONS_UPLOAD_CONCURRENCY = 'abc'
|
||||
process.env.ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY = 'abc'
|
||||
expect(() => {
|
||||
config.getConcurrency()
|
||||
}).toThrow()
|
||||
})
|
||||
|
||||
it('should throw if ACTIONS_UPLOAD_CONCURRENCY is < 1', () => {
|
||||
it('should throw if ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY is < 1', () => {
|
||||
;(os.cpus as jest.Mock).mockReturnValue(new Array(4))
|
||||
process.env.ACTIONS_UPLOAD_CONCURRENCY = '0'
|
||||
process.env.ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY = '0'
|
||||
expect(() => {
|
||||
config.getConcurrency()
|
||||
}).toThrow()
|
||||
@@ -95,7 +95,7 @@ describe('uploadConcurrencyEnv', () => {
|
||||
|
||||
it('cannot go over currency cap when override value is greater', () => {
|
||||
;(os.cpus as jest.Mock).mockReturnValue(new Array(4))
|
||||
process.env.ACTIONS_UPLOAD_CONCURRENCY = '40'
|
||||
process.env.ACTIONS_ARTIFACT_UPLOAD_CONCURRENCY = '40'
|
||||
expect(config.getConcurrency()).toBe(32)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user