Skip to content
Snippets Groups Projects
Unverified Commit 04fd4de9 authored by Michael Kriese's avatar Michael Kriese Committed by GitHub
Browse files

test: fix macos terraform tests (#11204)

parent fa2317ed
No related branches found
Tags 35.124.0
No related merge requests found
...@@ -20,14 +20,12 @@ const log = logger.logger as jest.Mocked<Logger>; ...@@ -20,14 +20,12 @@ const log = logger.logger as jest.Mocked<Logger>;
describe(getName(), () => { describe(getName(), () => {
let cacheDir: DirectoryResult; let cacheDir: DirectoryResult;
beforeAll(async () => { beforeEach(async () => {
cacheDir = await dir({ unsafeCleanup: true }); cacheDir = await dir({ unsafeCleanup: true });
setAdminConfig({ cacheDir: cacheDir.path }); setAdminConfig({ cacheDir: cacheDir.path });
}); });
beforeEach(() => jest.resetAllMocks()); afterEach(() => cacheDir.cleanup());
afterAll(() => cacheDir.cleanup());
it('returns null if getBuilds returns null', async () => { it('returns null if getBuilds returns null', async () => {
httpMock httpMock
......
...@@ -27,9 +27,7 @@ export class TerraformProviderHash { ...@@ -27,9 +27,7 @@ export class TerraformProviderHash {
// a sha256sum displayed as lowercase hex string to root hash // a sha256sum displayed as lowercase hex string to root hash
const fileBuffer = await fs.readFile(file); const fileBuffer = await fs.readFile(file);
hash.update(fileBuffer); hash.update(fileBuffer);
hash.end(); rootHash.update(hash.digest('hex'));
const data = hash.read();
rootHash.update(data.toString('hex'));
// add double space, the filename and a new line char // add double space, the filename and a new line char
rootHash.update(' '); rootHash.update(' ');
...@@ -38,10 +36,7 @@ export class TerraformProviderHash { ...@@ -38,10 +36,7 @@ export class TerraformProviderHash {
rootHash.update('\n'); rootHash.update('\n');
} }
rootHash.end(); return rootHash.digest('base64');
const rootData = rootHash.read();
const result: string = rootData.toString('base64');
return result;
} }
static async hashOfZipContent( static async hashOfZipContent(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment