Initial commit
Some checks failed
CI-integ-test-full / caching-integ-tests (push) Failing after 32s
CI-integ-test-full / other-integ-tests (push) Failing after 29m15s
Update Wrapper checksums file / Update checksums (push) Failing after 1m50s
CI-codeql / Analyze (javascript-typescript) (push) Failing after 1m22s
Some checks failed
CI-integ-test-full / caching-integ-tests (push) Failing after 32s
CI-integ-test-full / other-integ-tests (push) Failing after 29m15s
Update Wrapper checksums file / Update checksums (push) Failing after 1m50s
CI-codeql / Analyze (javascript-typescript) (push) Failing after 1m22s
This commit is contained in:
35
sources/test/jest/cache-debug.test.ts
Normal file
35
sources/test/jest/cache-debug.test.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import * as path from 'path'
|
||||
import * as fs from 'fs'
|
||||
import {GradleUserHomeCache} from "../../src/caching/gradle-user-home-cache"
|
||||
import {CacheConfig} from "../../src/configuration"
|
||||
|
||||
const testTmp = 'test/jest/tmp'
|
||||
fs.rmSync(testTmp, {recursive: true, force: true})
|
||||
|
||||
describe("--info and --stacktrace", () => {
|
||||
describe("will be created", () => {
|
||||
it("when gradle.properties does not exists", async () => {
|
||||
const emptyGradleHome = `${testTmp}/empty-gradle-home`
|
||||
fs.mkdirSync(emptyGradleHome, {recursive: true})
|
||||
|
||||
const stateCache = new GradleUserHomeCache("ignored", emptyGradleHome, new CacheConfig())
|
||||
stateCache.configureInfoLogLevel()
|
||||
|
||||
expect(fs.readFileSync(path.resolve(emptyGradleHome, "gradle.properties"), 'utf-8'))
|
||||
.toBe("org.gradle.logging.level=info\norg.gradle.logging.stacktrace=all\n")
|
||||
})
|
||||
})
|
||||
describe("will be added", () => {
|
||||
it("and gradle.properties does exists", async () => {
|
||||
const existingGradleHome = `${testTmp}/existing-gradle-home`
|
||||
fs.mkdirSync(existingGradleHome, {recursive: true})
|
||||
fs.writeFileSync(path.resolve(existingGradleHome, "gradle.properties"), "org.gradle.logging.level=debug\n")
|
||||
|
||||
const stateCache = new GradleUserHomeCache("ignored", existingGradleHome, new CacheConfig())
|
||||
stateCache.configureInfoLogLevel()
|
||||
|
||||
expect(fs.readFileSync(path.resolve(existingGradleHome, "gradle.properties"), 'utf-8'))
|
||||
.toBe("org.gradle.logging.level=info\norg.gradle.logging.stacktrace=all\n\norg.gradle.logging.level=debug\n")
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user