From f1cdb895c144cc2d0caa2d0625e36c27cdca21df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A4ser?= Date: Thu, 2 Feb 2023 14:02:04 +0100 Subject: [PATCH 01/14] test: add custom script sh --- analysis.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 analysis.sh diff --git a/analysis.sh b/analysis.sh new file mode 100644 index 0000000..2a3c82f --- /dev/null +++ b/analysis.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +source /etc/profile.d/sonar-scanner.sh +cd apps/website +sonar-scanner -X Dsonar.login=b6b66f8b798b46b693cc19f788215111871d5287 From 79285e82fb395c998d87759f51952882db652146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A4ser?= Date: Thu, 2 Feb 2023 14:08:49 +0100 Subject: [PATCH 02/14] update mode --- analysis.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 analysis.sh diff --git a/analysis.sh b/analysis.sh old mode 100644 new mode 100755 From 478f2cfa8f3886fa56c3c769c7707dd8853373dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A4ser?= Date: Thu, 2 Feb 2023 14:20:22 +0100 Subject: [PATCH 03/14] test: update script analysis.sh --- analysis.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) mode change 100755 => 100644 analysis.sh diff --git a/analysis.sh b/analysis.sh old mode 100755 new mode 100644 index 2a3c82f..68cfa3d --- a/analysis.sh +++ b/analysis.sh @@ -1,5 +1,8 @@ #!/bin/sh -source /etc/profile.d/sonar-scanner.sh +apt install wget +wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856-linux.zip +unzip sonar-scanner-cli-4.8.0.2856-linux.zip +mv sonar-scanner-cli-4.8.0.2856-linux sonarscanner cd apps/website -sonar-scanner -X Dsonar.login=b6b66f8b798b46b693cc19f788215111871d5287 +../../sonarscanner/bin/sonar-scanner -X Dsonar.login=b6b66f8b798b46b693cc19f788215111871d5287 From 652bedd65d2807ea5af423f844d96be95d8aa4a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A4ser?= Date: Thu, 2 Feb 2023 14:20:44 +0100 Subject: [PATCH 04/14] update mode --- analysis.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 analysis.sh diff --git a/analysis.sh b/analysis.sh old mode 100644 new mode 100755 From a180b69fcea951fe7cdc9f236cadc9815a00ddeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A4ser?= Date: Thu, 2 Feb 2023 14:32:10 +0100 Subject: [PATCH 05/14] test: update script analysis.sh --- analysis.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/analysis.sh b/analysis.sh index 68cfa3d..7348c58 100755 --- a/analysis.sh +++ b/analysis.sh @@ -3,6 +3,7 @@ apt install wget wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856-linux.zip unzip sonar-scanner-cli-4.8.0.2856-linux.zip -mv sonar-scanner-cli-4.8.0.2856-linux sonarscanner +ls -la +mv ./sonar-scanner-4.8.0.2856-linux ./sonarscanner cd apps/website ../../sonarscanner/bin/sonar-scanner -X Dsonar.login=b6b66f8b798b46b693cc19f788215111871d5287 From c6d0f7db9fa6a03993cab9718c4534e6f94cbc34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A4ser?= Date: Thu, 2 Feb 2023 14:35:36 +0100 Subject: [PATCH 06/14] test: update script analysis.sh --- analysis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analysis.sh b/analysis.sh index 7348c58..948cf59 100755 --- a/analysis.sh +++ b/analysis.sh @@ -6,4 +6,4 @@ unzip sonar-scanner-cli-4.8.0.2856-linux.zip ls -la mv ./sonar-scanner-4.8.0.2856-linux ./sonarscanner cd apps/website -../../sonarscanner/bin/sonar-scanner -X Dsonar.login=b6b66f8b798b46b693cc19f788215111871d5287 +../../sonarscanner/bin/sonar-scanner -X -Dsonar.login=b6b66f8b798b46b693cc19f788215111871d5287 From e633ccc293ad8af1f621c108f58cb58b487ffaf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A4ser?= Date: Thu, 2 Feb 2023 14:39:06 +0100 Subject: [PATCH 07/14] test: update sonarqube URL --- apps/website/sonar-project.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/website/sonar-project.properties b/apps/website/sonar-project.properties index c706ee5..2df3117 100644 --- a/apps/website/sonar-project.properties +++ b/apps/website/sonar-project.properties @@ -1,3 +1,4 @@ +sonar.host.url=http://192.168.1.33:9000/ sonar.projectKey=david:guitar-apps sonar.sources=./ sonar.coverage.exclusions=.next/,.eslintrc.json,config.ts,index.d.ts,jest.config.ts,next.config.js,postcss.config.js,tailwind.config.js,with-nx.js From 7fb96c3ca5cb4bced3bf88d00dc2ac4195d3147a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A4ser?= Date: Thu, 2 Feb 2023 14:54:55 +0100 Subject: [PATCH 08/14] test: add exclusions into sonar-project.properties --- apps/website/sonar-project.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/website/sonar-project.properties b/apps/website/sonar-project.properties index 2df3117..88ca6bb 100644 --- a/apps/website/sonar-project.properties +++ b/apps/website/sonar-project.properties @@ -1,6 +1,7 @@ sonar.host.url=http://192.168.1.33:9000/ sonar.projectKey=david:guitar-apps sonar.sources=./ +sonar.exclusions=.next/,.eslintrc.json,config.ts,index.d.ts,jest.config.ts,next.config.js,postcss.config.js,tailwind.config.js,with-nx.js,**/*.css,**/*.scss sonar.coverage.exclusions=.next/,.eslintrc.json,config.ts,index.d.ts,jest.config.ts,next.config.js,postcss.config.js,tailwind.config.js,with-nx.js sonar.language=ts sonar.tests=./ From 38fd5a1abedf00b5de59c97fceeeaf93f273f585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A4ser?= Date: Thu, 2 Feb 2023 15:05:59 +0100 Subject: [PATCH 09/14] test: move tests into folder and add test files in exclude list --- apps/website/components/footer/footer.spec.tsx | 10 ---------- apps/website/components/seo-config/seo-config.spec.tsx | 10 ---------- apps/website/sonar-project.properties | 4 ++-- .../{components/carousel => tests}/carousel.spec.tsx | 2 +- apps/website/tests/footer.spec.tsx | 10 ++++++++++ .../{components/header => tests}/header.spec.tsx | 5 ++--- apps/website/{pages => tests}/index.spec.tsx | 0 .../{components/layout => tests}/layout.spec.tsx | 8 ++++---- apps/website/tests/seo-config.spec.tsx | 10 ++++++++++ 9 files changed, 29 insertions(+), 30 deletions(-) delete mode 100644 apps/website/components/footer/footer.spec.tsx delete mode 100644 apps/website/components/seo-config/seo-config.spec.tsx rename apps/website/{components/carousel => tests}/carousel.spec.tsx (79%) create mode 100644 apps/website/tests/footer.spec.tsx rename apps/website/{components/header => tests}/header.spec.tsx (83%) rename apps/website/{pages => tests}/index.spec.tsx (100%) rename apps/website/{components/layout => tests}/layout.spec.tsx (75%) create mode 100644 apps/website/tests/seo-config.spec.tsx diff --git a/apps/website/components/footer/footer.spec.tsx b/apps/website/components/footer/footer.spec.tsx deleted file mode 100644 index 97c820b..0000000 --- a/apps/website/components/footer/footer.spec.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { render } from '@testing-library/react'; - -import Footer from './footer'; - -describe('Footer', () => { - it('should render successfully', () => { - const { baseElement } = render(