From 7260b5d4b1335ec06f19ed5c7b02839556780bef Mon Sep 17 00:00:00 2001 From: "nkl199@yahoo.co.uk" Date: Tue, 12 Mar 2019 10:20:24 +0000 Subject: [PATCH] [FABN-1175] Move test temp directory - Move the test directory to be under /test/temp - Add to git ignore Change-Id: I518e577851f3d6fa18192d2525375bac0ad31d52 Signed-off-by: nkl199@yahoo.co.uk --- .gitignore | 2 ++ build/tasks/test.js | 2 +- test/temp/.noignore | 0 test/unit/constants.js | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 test/temp/.noignore diff --git a/.gitignore b/.gitignore index fdf94e1ad9..8bbef81aa5 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,8 @@ tmp *.heapsnapshot #test files +test/temp/** +!test/temp/.noignore test/fixtures/crypto-material/crypto-config/ test/fixtures/crypto-material/channel-config/ test/fixtures/crypto-material/config-base/twoorgs.genesis.block diff --git a/build/tasks/test.js b/build/tasks/test.js index b407dac7c0..5be377f9a7 100644 --- a/build/tasks/test.js +++ b/build/tasks/test.js @@ -24,7 +24,7 @@ const testConstants = require('../../test/unit/constants.js'); process.env.DOCKER_DEBUG = 'INFO'; // by default for running the tests print debug to a file -const debugPath = path.join(testConstants.tempdir, 'test-log', 'debug.log'); +const debugPath = path.join(testConstants.tempdir, 'debug.log'); process.env.HFC_LOGGING = util.format('{"debug":"%s"}', escapeWindowsPath(debugPath)); function escapeWindowsPath(p) { diff --git a/test/temp/.noignore b/test/temp/.noignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/unit/constants.js b/test/unit/constants.js index 0602b36686..cb612b9d31 100644 --- a/test/unit/constants.js +++ b/test/unit/constants.js @@ -3,10 +3,10 @@ SPDX-License-Identifier: Apache-2.0 */ -const os = require('os'); const path = require('path'); -const tempdir = path.join(os.tmpdir(), 'hfc'); +// test temp directory is /fabric-sdk-node/test/temp +const tempdir = path.join(__dirname, '../temp'); const TEST_CERT_PEM = '-----BEGIN CERTIFICATE-----' + 'MIIDVDCCAvqgAwIBAgIBATAKBggqhkjOPQQDAjBOMRMwEQYDVQQKDArOoyBBY21l' +