summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/run-frontend-unittests.sh
diff options
context:
space:
mode:
authorStephan Müller <smueller@suse.com>2018-06-01 17:11:35 +0200
committerStephan Müller <smueller@suse.com>2018-06-08 14:50:25 +0200
commit7253b97d42aa78ef43257bb84b29be74fee322c4 (patch)
tree4a91d6a049d35e3467da9e19ee78fb3dcbf2a361 /src/pybind/mgr/dashboard/run-frontend-unittests.sh
parentMerge pull request #22453 from tspmelo/fix-pool-usage (diff)
downloadceph-7253b97d42aa78ef43257bb84b29be74fee322c4.tar.xz
ceph-7253b97d42aa78ef43257bb84b29be74fee322c4.zip
mgr/dashboard: Resolve TestBed performance issue
With this helper function you can easily resolve the TestBed resetting performance issue. If more tests exists in a test suite, it makes sense to configure TestBed only once if you are not doing a lot of TestBed specific stuff (haven't hit the limitation). It will reduce the test run time by around $tests * 50 %. In my case it was a test suite with 47 tests with a run time of over 30s after using the static test bed method it ran in 1.2s. The run time was reduced to 0.04 %! This is equivalent to a speed increase of 2500% (100/0.04)! For our own security the normal way will be taken if you not set the _DEV_ configuration variable to true. It will be false when "run-frontend-unittests.sh" is run. Signed-off-by: Stephan Müller <smueller@suse.com>
Diffstat (limited to 'src/pybind/mgr/dashboard/run-frontend-unittests.sh')
-rwxr-xr-xsrc/pybind/mgr/dashboard/run-frontend-unittests.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/run-frontend-unittests.sh b/src/pybind/mgr/dashboard/run-frontend-unittests.sh
index ea7522e4c73..010dc83ab97 100755
--- a/src/pybind/mgr/dashboard/run-frontend-unittests.sh
+++ b/src/pybind/mgr/dashboard/run-frontend-unittests.sh
@@ -4,10 +4,21 @@ set -e
cd $CEPH_ROOT/src/pybind/mgr/dashboard/frontend
+config='src/unit-test-configuration.ts'
+if [ -e $config ]; then
+ mv $config ${config}_old
+fi
+cp ${config}.sample $config
+
. $CEPH_ROOT/build/src/pybind/mgr/dashboard/node-env/bin/activate
npm run build -- --prod
npm run test:ci
npm run lint
+rm $config
+if [ -e ${config}_old ]; then
+ mv ${config}_old $config
+fi
+
deactivate