You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2023/01/30 13:40:26 UTC

[incubator-devlake-website] branch main updated: Added Unit-Test file (#392)

This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 28383e738d Added Unit-Test file (#392)
28383e738d is described below

commit 28383e738ded8b303ae8b9ef0ae981efdecd732e
Author: Kelvin Parmar <94...@users.noreply.github.com>
AuthorDate: Mon Jan 30 19:10:21 2023 +0530

    Added Unit-Test file (#392)
    
    * Sources added
    
    * Sources added
    
    * added Unit-test file
    
    * Update UnitTest.md
---
 docs/DeveloperManuals/UnitTest.md     | 42 +++++++++++++++++++++++++++++++++++
 docs/UserManuals/ConfigUI/Tutorial.md |  3 ---
 docusaurus.config.js                  |  2 ++
 3 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/docs/DeveloperManuals/UnitTest.md b/docs/DeveloperManuals/UnitTest.md
new file mode 100644
index 0000000000..b7599dd26e
--- /dev/null
+++ b/docs/DeveloperManuals/UnitTest.md
@@ -0,0 +1,42 @@
+---
+title: "UnitTest Test Guide"
+description: >
+  The steps to write UnitTest tests for plugins.
+---
+
+# Introduction of UnitTest 
+
+A unit test is a type of software testing that tests individual units or components of a software application. The goal of unit testing is to validate that each unit of the software performs as expected. Unit tests are typically written by developers as they work on the code, to ensure that the code they are writing is correct and behaves as intended.
+
+Unit tests are automated and are typically written in the same programming language as the code being tested. They are usually run as part of a continuous integration process, ensuring that changes to the codebase don't break existing functionality.
+
+Unit tests are typically small and focus on a specific function or method of the code. They are usually designed to run quickly and in isolation, so that any issues that are discovered can be easily traced back to the specific code that is causing the problem.
+
+# How to write UnitTest for golang
+
+Here are some resources for writing UnitTest for golang:
+
+- [Add a test - The Go Programming Language](https://go.dev/doc/tutorial/add-a-test)
+
+- [How To Write Unit Tests in Go | DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-write-unit-tests-in-go-using-go-test-and-the-testing-package)
+
+
+# Test case examples 
+
+- [Source code](https://github.com/apache/incubator-devlake/blob/243cc8a80aa5b37828e2a142ac9f7e3269b7e1dc/backend/core/migration/migrator_test.go)
+
+# Recommended Libraries for writing UnitTest cases
+
+- [Library-1](https://github.com/stretchr/testify/tree/master/assert)
+- [Library-2](https://github.com/stretchr/testify/tree/master/mock)
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/UserManuals/ConfigUI/Tutorial.md b/docs/UserManuals/ConfigUI/Tutorial.md
index 00f29ee5e1..1478881940 100644
--- a/docs/UserManuals/ConfigUI/Tutorial.md
+++ b/docs/UserManuals/ConfigUI/Tutorial.md
@@ -68,9 +68,6 @@ In the current version, the Blueprint editing feature **allows** editing:
 - The data scope of a connection
 - The data entities of the data scope
 - The transformation rules of any data scope
-
-and currently does **NOT allow**:
-- Adding or deleting connections of an existing Blueprint (will be available in the future)
 - Editing any connections
 
 Please note: 
diff --git a/docusaurus.config.js b/docusaurus.config.js
index caa995e0b1..b60cf6d184 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -13,6 +13,7 @@ const versions = require('./versions.json');
   title: 'Apache DevLake (Incubating)',
   tagline: 'Apache DevLake is an open-source dev data platform that ingests, analyzes, and visualizes the fragmented data from DevOps tools to distill insights for engineering productivity.',
   url: 'https://devlake.apache.org',
+  
   baseUrl: '/',
   onBrokenLinks: 'throw',
   onBrokenMarkdownLinks: 'throw',
@@ -90,6 +91,7 @@ const versions = require('./versions.json');
         name: 'docusaurus-tailwindcss',
         configurePostCss(postcssOptions) {
           // Appends TailwindCSS and AutoPrefixer.
+          // @ts-ignore
           postcssOptions.plugins.push(require('tailwindcss'));
           postcssOptions.plugins.push(require('autoprefixer'));
           postcssOptions.plugins.push(require('postcss-gap-properties'));