From d8b0880692b976301e9c59df94d8083d58ea663c Mon Sep 17 00:00:00 2001 From: Ambhrin Dhar Date: Wed, 3 Apr 2024 17:08:56 -0500 Subject: [PATCH 1/5] Add test data and excluded that from secureli scan --- .secureli.yaml | 1 + .../test-data/CloudFormation_Sample/main.yaml | 5 +++++ .../end-to-end/test-data/Csharp_Sample/src/Program.cs | 9 +++++++++ tests/end-to-end/test-data/Go_Sample/src/main.go | 7 +++++++ .../test-data/JavaScript_Sample/public/index.html | 11 +++++++++++ .../test-data/JavaScript_Sample/src/index.js | 1 + tests/end-to-end/test-data/Kotlin_Sample/src/Main.kt | 1 + tests/end-to-end/test-data/Python_Sample/main.py | 1 + .../test-data/Swift_Sample/Sources/main.swift | 1 + tests/end-to-end/test-data/Terraform_Sample/main.tf | 1 + .../test-data/TypeScript_Sample/src/index.ts | 1 + 11 files changed, 39 insertions(+) create mode 100644 tests/end-to-end/test-data/CloudFormation_Sample/main.yaml create mode 100644 tests/end-to-end/test-data/Csharp_Sample/src/Program.cs create mode 100644 tests/end-to-end/test-data/Go_Sample/src/main.go create mode 100644 tests/end-to-end/test-data/JavaScript_Sample/public/index.html create mode 100644 tests/end-to-end/test-data/JavaScript_Sample/src/index.js create mode 100644 tests/end-to-end/test-data/Kotlin_Sample/src/Main.kt create mode 100644 tests/end-to-end/test-data/Python_Sample/main.py create mode 100644 tests/end-to-end/test-data/Swift_Sample/Sources/main.swift create mode 100644 tests/end-to-end/test-data/Terraform_Sample/main.tf create mode 100644 tests/end-to-end/test-data/TypeScript_Sample/src/index.ts diff --git a/.secureli.yaml b/.secureli.yaml index 542f0dc6..f349d78c 100644 --- a/.secureli.yaml +++ b/.secureli.yaml @@ -3,6 +3,7 @@ echo: repo_files: exclude_file_patterns: - .idea/ + - tests/end-to-end/test-data/ ignored_file_extensions: - .pyc - .drawio diff --git a/tests/end-to-end/test-data/CloudFormation_Sample/main.yaml b/tests/end-to-end/test-data/CloudFormation_Sample/main.yaml new file mode 100644 index 00000000..2c796de6 --- /dev/null +++ b/tests/end-to-end/test-data/CloudFormation_Sample/main.yaml @@ -0,0 +1,5 @@ +Resources: + HelloWorld: + Type: AWS::S3::Bucket + Properties: + BucketName: "hello-world-bucket" diff --git a/tests/end-to-end/test-data/Csharp_Sample/src/Program.cs b/tests/end-to-end/test-data/Csharp_Sample/src/Program.cs new file mode 100644 index 00000000..39ce3bde --- /dev/null +++ b/tests/end-to-end/test-data/Csharp_Sample/src/Program.cs @@ -0,0 +1,9 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + Console.WriteLine("Hello, World!"); + } +} diff --git a/tests/end-to-end/test-data/Go_Sample/src/main.go b/tests/end-to-end/test-data/Go_Sample/src/main.go new file mode 100644 index 00000000..ef25884d --- /dev/null +++ b/tests/end-to-end/test-data/Go_Sample/src/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello, world!") +} diff --git a/tests/end-to-end/test-data/JavaScript_Sample/public/index.html b/tests/end-to-end/test-data/JavaScript_Sample/public/index.html new file mode 100644 index 00000000..080cb0eb --- /dev/null +++ b/tests/end-to-end/test-data/JavaScript_Sample/public/index.html @@ -0,0 +1,11 @@ + + + + + + JavaScript_Sample + + + + + diff --git a/tests/end-to-end/test-data/JavaScript_Sample/src/index.js b/tests/end-to-end/test-data/JavaScript_Sample/src/index.js new file mode 100644 index 00000000..a8141d3b --- /dev/null +++ b/tests/end-to-end/test-data/JavaScript_Sample/src/index.js @@ -0,0 +1 @@ +console.log("Hello, world!"); diff --git a/tests/end-to-end/test-data/Kotlin_Sample/src/Main.kt b/tests/end-to-end/test-data/Kotlin_Sample/src/Main.kt new file mode 100644 index 00000000..d113eced --- /dev/null +++ b/tests/end-to-end/test-data/Kotlin_Sample/src/Main.kt @@ -0,0 +1 @@ +fun main() { println("Hello, world!") } diff --git a/tests/end-to-end/test-data/Python_Sample/main.py b/tests/end-to-end/test-data/Python_Sample/main.py new file mode 100644 index 00000000..f7cf60e1 --- /dev/null +++ b/tests/end-to-end/test-data/Python_Sample/main.py @@ -0,0 +1 @@ +print("Hello, world!") diff --git a/tests/end-to-end/test-data/Swift_Sample/Sources/main.swift b/tests/end-to-end/test-data/Swift_Sample/Sources/main.swift new file mode 100644 index 00000000..f7cf60e1 --- /dev/null +++ b/tests/end-to-end/test-data/Swift_Sample/Sources/main.swift @@ -0,0 +1 @@ +print("Hello, world!") diff --git a/tests/end-to-end/test-data/Terraform_Sample/main.tf b/tests/end-to-end/test-data/Terraform_Sample/main.tf new file mode 100644 index 00000000..69b152ca --- /dev/null +++ b/tests/end-to-end/test-data/Terraform_Sample/main.tf @@ -0,0 +1 @@ +output "hello_world" { value = "Hello, world!" } diff --git a/tests/end-to-end/test-data/TypeScript_Sample/src/index.ts b/tests/end-to-end/test-data/TypeScript_Sample/src/index.ts new file mode 100644 index 00000000..a8141d3b --- /dev/null +++ b/tests/end-to-end/test-data/TypeScript_Sample/src/index.ts @@ -0,0 +1 @@ +console.log("Hello, world!"); From 85f418aa87cfd945a70f2510196cc15ef5fd70f2 Mon Sep 17 00:00:00 2001 From: Ambhrin Dhar Date: Wed, 3 Apr 2024 17:19:39 -0500 Subject: [PATCH 2/5] WIP-partial-test --- tests/end-to-end/test-language-detect.bats | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/end-to-end/test-language-detect.bats diff --git a/tests/end-to-end/test-language-detect.bats b/tests/end-to-end/test-language-detect.bats new file mode 100644 index 00000000..10795615 --- /dev/null +++ b/tests/end-to-end/test-language-detect.bats @@ -0,0 +1,12 @@ +setup() { + load "${BATS_LIBS_ROOT}/bats-support/load" + load "${BATS_LIBS_ROOT}/bats-assert/load" +} + +@test "can detect language" { + #cd tests/end-to-end/test-data/Csharp_Sample/ + run python secureli/main.py init -ry + assert_output --partial 'Hooks successfully updated to latest version' + assert_output --partial 'seCureLI has been installed successfully' +} + From fe8cfd87a75514c2da063a23bf863b28b8616e9e Mon Sep 17 00:00:00 2001 From: Ambhrin Dhar Date: Sun, 7 Apr 2024 22:49:45 -0500 Subject: [PATCH 3/5] added test code to cover all languages --- tests/end-to-end/test-language-detect.bats | 57 +++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/tests/end-to-end/test-language-detect.bats b/tests/end-to-end/test-language-detect.bats index 10795615..ec4050fc 100644 --- a/tests/end-to-end/test-language-detect.bats +++ b/tests/end-to-end/test-language-detect.bats @@ -3,10 +3,65 @@ setup() { load "${BATS_LIBS_ROOT}/bats-assert/load" } -@test "can detect language" { +@test "can detect C# language" { #cd tests/end-to-end/test-data/Csharp_Sample/ run python secureli/main.py init -ry assert_output --partial 'Hooks successfully updated to latest version' assert_output --partial 'seCureLI has been installed successfully' } +@test "can detect Go language" { + #cd tests/end-to-end/test-data/Go_Sample/ + run python secureli/main.py init -ry + assert_output --partial 'Hooks successfully updated to latest version' + assert_output --partial 'seCureLI has been installed successfully' +} + +@test "can detect Javascript language" { + #cd tests/end-to-end/test-data/JavaScript_Sample/ + run python secureli/main.py init -ry + assert_output --partial 'Hooks successfully updated to latest version' + assert_output --partial 'seCureLI has been installed successfully' +} + +@test "can detect Kotlin language" { + #cd tests/end-to-end/test-data/Kotlin_Sample/ + run python secureli/main.py init -ry + assert_output --partial 'Hooks successfully updated to latest version' + assert_output --partial 'seCureLI has been installed successfully' +} + +@test "can detect Python language" { + #cd tests/end-to-end/test-data/Python_Sample/ + run python secureli/main.py init -ry + assert_output --partial 'Hooks successfully updated to latest version' + assert_output --partial 'seCureLI has been installed successfully' +} + +@test "can detect Swift language" { + #cd tests/end-to-end/test-data/Swift_Sample/ + run python secureli/main.py init -ry + assert_output --partial 'Hooks successfully updated to latest version' + assert_output --partial 'seCureLI has been installed successfully' +} + +@test "can detect Terraform language" { + #cd tests/end-to-end/test-data/Terraform_Sample/ + run python secureli/main.py init -ry + assert_output --partial 'Hooks successfully updated to latest version' + assert_output --partial 'seCureLI has been installed successfully' +} + +@test "can detect Typescript language" { + #cd tests/end-to-end/test-data/Typescript_Sample/ + run python secureli/main.py init -ry + assert_output --partial 'Hooks successfully updated to latest version' + assert_output --partial 'seCureLI has been installed successfully' +} + +@test "can detect Cloudformation language" { + #cd tests/end-to-end/test-data/CloudFormation_Sample/ + run python secureli/main.py init -ry + assert_output --partial 'Hooks successfully updated to latest version' + assert_output --partial 'seCureLI has been installed successfully' +} \ No newline at end of file From 4818b2f213fab65d2b0218c63bdf61134ee39db3 Mon Sep 17 00:00:00 2001 From: Ambhrin Dhar Date: Tue, 9 Apr 2024 14:54:54 -0500 Subject: [PATCH 4/5] test repos --- .secureli/.pre-commit-config.yaml | 152 ++++++++++++++++-- .../test-data/CloudFormation_Sample/main.yaml | 5 + tests/test-data/Csharp_Sample/src/Program.cs | 9 ++ tests/test-data/Go_Sample/src/main.go | 7 + .../JavaScript_Sample/public/index.html | 11 ++ .../test-data/JavaScript_Sample/src/index.js | 1 + tests/test-data/Kotlin_Sample/src/Main.kt | 1 + tests/test-data/Python_Sample/main.py | 1 + .../test-data/Swift_Sample/Sources/main.swift | 1 + tests/test-data/Terraform_Sample/main.tf | 1 + .../test-data/TypeScript_Sample/src/index.ts | 1 + 11 files changed, 173 insertions(+), 17 deletions(-) create mode 100644 tests/test-data/CloudFormation_Sample/main.yaml create mode 100644 tests/test-data/Csharp_Sample/src/Program.cs create mode 100644 tests/test-data/Go_Sample/src/main.go create mode 100644 tests/test-data/JavaScript_Sample/public/index.html create mode 100644 tests/test-data/JavaScript_Sample/src/index.js create mode 100644 tests/test-data/Kotlin_Sample/src/Main.kt create mode 100644 tests/test-data/Python_Sample/main.py create mode 100644 tests/test-data/Swift_Sample/Sources/main.swift create mode 100644 tests/test-data/Terraform_Sample/main.tf create mode 100644 tests/test-data/TypeScript_Sample/src/index.ts diff --git a/.secureli/.pre-commit-config.yaml b/.secureli/.pre-commit-config.yaml index b369b74d..5e3db8f2 100644 --- a/.secureli/.pre-commit-config.yaml +++ b/.secureli/.pre-commit-config.yaml @@ -1,18 +1,136 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: check-added-large-files -- repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.3.0 - hooks: - - id: black -- repo: https://github.com/yelp/detect-secrets - rev: v1.4.0 - hooks: - - id: detect-secrets +- hooks: + - id: python-use-type-annotations + repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.9.0 +- hooks: + - args: + - --exclude + - tests/ + - --severity-level + - medium + id: bandit + repo: https://github.com/PyCQA/bandit + rev: 1.7.4 +- hooks: + - id: black + repo: https://github.com/psf/black + rev: 22.10.0 +- hooks: + - entry: dotnet format --include + id: dotnet-format + language: system + name: dotnet-format + types: + - c# + repo: local +- hooks: + - id: golangci-lint + repo: https://github.com/golangci/golangci-lint + rev: v1.53.3 +- hooks: + - additional_dependencies: + - eslint@8.42.0 + - eslint-plugin-prettier@4.2.1 + args: + - --config + - javascript.eslintrc.yaml + - --fix + files: \.[j]sx?$ + id: eslint + types: + - file + repo: https://github.com/pre-commit/mirrors-eslint + rev: v8.42.0 +- hooks: + - args: + - --single-quote + - --trailing-comma + - all + id: prettier + types_or: + - css + - javascript + repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.7.1 +- hooks: + - id: detekt + repo: https://github.com/quwac/pre-commit-detekt + rev: v1.23.4 +- hooks: + - args: + - --autofix + id: pretty-format-kotlin + repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.12.0 +- hooks: + - exclude: .xcscheme$ + id: detect-secrets + repo: https://github.com/Yelp/detect-secrets + rev: v1.4.0 +- hooks: + - id: swiftlint + repo: https://github.com/realm/SwiftLint + rev: 0.52.2 +- hooks: + - id: detect-secrets + repo: https://github.com/Yelp/detect-secrets + rev: v1.4.0 +- hooks: + - id: terraform_tflint + repo: https://github.com/antonbabenko/pre-commit-terraform + rev: v1.77.0 +- hooks: + - additional_dependencies: + - eslint@8.42.0 + - '@typescript-eslint/eslint-plugin@5.59.11' + - '@typescript-eslint/parser@5.59.11' + - typescript@5.1.3 + - eslint-config-prettier@8.8.0 + - eslint-plugin-prettier@4.2.1 + args: + - --config + - typescript.eslintrc.yaml + - --fix + files: \.[t]sx?$ + id: eslint + types: + - file + repo: https://github.com/pre-commit/mirrors-eslint + rev: v8.42.0 +- hooks: + - args: + - --single-quote + - --trailing-comma + - all + id: prettier + repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.7.1 +- hooks: + - id: check-added-large-files + - id: check-ast + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + - id: check-merge-conflict + - id: check-toml + - id: check-json + - id: check-xml + - id: check-yaml + - id: debug-statements + - args: + - --allow-missing-credentials + id: detect-aws-credentials + - id: detect-private-key + - args: + - --pytest-test-first + id: name-tests-test + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 +- hooks: + - id: detect-secrets + repo: https://github.com/Yelp/detect-secrets + rev: v1.4.0 diff --git a/tests/test-data/CloudFormation_Sample/main.yaml b/tests/test-data/CloudFormation_Sample/main.yaml new file mode 100644 index 00000000..2c796de6 --- /dev/null +++ b/tests/test-data/CloudFormation_Sample/main.yaml @@ -0,0 +1,5 @@ +Resources: + HelloWorld: + Type: AWS::S3::Bucket + Properties: + BucketName: "hello-world-bucket" diff --git a/tests/test-data/Csharp_Sample/src/Program.cs b/tests/test-data/Csharp_Sample/src/Program.cs new file mode 100644 index 00000000..6e1130f5 --- /dev/null +++ b/tests/test-data/Csharp_Sample/src/Program.cs @@ -0,0 +1,9 @@ +using System; + +class Program +{ + static void Main(string[] args) + { + Console.WriteLine("Hello, world!"); + } +} diff --git a/tests/test-data/Go_Sample/src/main.go b/tests/test-data/Go_Sample/src/main.go new file mode 100644 index 00000000..ef25884d --- /dev/null +++ b/tests/test-data/Go_Sample/src/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello, world!") +} diff --git a/tests/test-data/JavaScript_Sample/public/index.html b/tests/test-data/JavaScript_Sample/public/index.html new file mode 100644 index 00000000..080cb0eb --- /dev/null +++ b/tests/test-data/JavaScript_Sample/public/index.html @@ -0,0 +1,11 @@ + + + + + + JavaScript_Sample + + + + + diff --git a/tests/test-data/JavaScript_Sample/src/index.js b/tests/test-data/JavaScript_Sample/src/index.js new file mode 100644 index 00000000..a8141d3b --- /dev/null +++ b/tests/test-data/JavaScript_Sample/src/index.js @@ -0,0 +1 @@ +console.log("Hello, world!"); diff --git a/tests/test-data/Kotlin_Sample/src/Main.kt b/tests/test-data/Kotlin_Sample/src/Main.kt new file mode 100644 index 00000000..d113eced --- /dev/null +++ b/tests/test-data/Kotlin_Sample/src/Main.kt @@ -0,0 +1 @@ +fun main() { println("Hello, world!") } diff --git a/tests/test-data/Python_Sample/main.py b/tests/test-data/Python_Sample/main.py new file mode 100644 index 00000000..f7cf60e1 --- /dev/null +++ b/tests/test-data/Python_Sample/main.py @@ -0,0 +1 @@ +print("Hello, world!") diff --git a/tests/test-data/Swift_Sample/Sources/main.swift b/tests/test-data/Swift_Sample/Sources/main.swift new file mode 100644 index 00000000..f7cf60e1 --- /dev/null +++ b/tests/test-data/Swift_Sample/Sources/main.swift @@ -0,0 +1 @@ +print("Hello, world!") diff --git a/tests/test-data/Terraform_Sample/main.tf b/tests/test-data/Terraform_Sample/main.tf new file mode 100644 index 00000000..69b152ca --- /dev/null +++ b/tests/test-data/Terraform_Sample/main.tf @@ -0,0 +1 @@ +output "hello_world" { value = "Hello, world!" } diff --git a/tests/test-data/TypeScript_Sample/src/index.ts b/tests/test-data/TypeScript_Sample/src/index.ts new file mode 100644 index 00000000..a8141d3b --- /dev/null +++ b/tests/test-data/TypeScript_Sample/src/index.ts @@ -0,0 +1 @@ +console.log("Hello, world!"); From 5b5e9a1cb49594ec74549f5815710fee843755e1 Mon Sep 17 00:00:00 2001 From: Ambhrin Dhar Date: Mon, 15 Apr 2024 09:57:56 -0500 Subject: [PATCH 5/5] complete test --- .secureli/.pre-commit-config.yaml | 24 ++++++------- tests/end-to-end/test-language-detect.bats | 34 +++++++++---------- .../test-data/CloudFormation_Sample/main.yaml | 5 --- tests/test-data/Csharp_Sample/src/Program.cs | 9 ----- tests/test-data/Go_Sample/src/main.go | 7 ---- .../JavaScript_Sample/public/index.html | 11 ------ .../test-data/JavaScript_Sample/src/index.js | 1 - tests/test-data/Kotlin_Sample/src/Main.kt | 1 - tests/test-data/Python_Sample/main.py | 1 - .../test-data/Swift_Sample/Sources/main.swift | 1 - tests/test-data/Terraform_Sample/main.tf | 1 - .../test-data/TypeScript_Sample/src/index.ts | 1 - 12 files changed, 28 insertions(+), 68 deletions(-) delete mode 100644 tests/test-data/CloudFormation_Sample/main.yaml delete mode 100644 tests/test-data/Csharp_Sample/src/Program.cs delete mode 100644 tests/test-data/Go_Sample/src/main.go delete mode 100644 tests/test-data/JavaScript_Sample/public/index.html delete mode 100644 tests/test-data/JavaScript_Sample/src/index.js delete mode 100644 tests/test-data/Kotlin_Sample/src/Main.kt delete mode 100644 tests/test-data/Python_Sample/main.py delete mode 100644 tests/test-data/Swift_Sample/Sources/main.swift delete mode 100644 tests/test-data/Terraform_Sample/main.tf delete mode 100644 tests/test-data/TypeScript_Sample/src/index.ts diff --git a/.secureli/.pre-commit-config.yaml b/.secureli/.pre-commit-config.yaml index 5e3db8f2..ecff9309 100644 --- a/.secureli/.pre-commit-config.yaml +++ b/.secureli/.pre-commit-config.yaml @@ -2,7 +2,7 @@ repos: - hooks: - id: python-use-type-annotations repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 - hooks: - args: - --exclude @@ -11,11 +11,11 @@ repos: - medium id: bandit repo: https://github.com/PyCQA/bandit - rev: 1.7.4 + rev: 1.7.8 - hooks: - id: black repo: https://github.com/psf/black - rev: 22.10.0 + rev: 24.3.0 - hooks: - entry: dotnet format --include id: dotnet-format @@ -27,7 +27,7 @@ repos: - hooks: - id: golangci-lint repo: https://github.com/golangci/golangci-lint - rev: v1.53.3 + rev: v1.57.2 - hooks: - additional_dependencies: - eslint@8.42.0 @@ -41,7 +41,7 @@ repos: types: - file repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.42.0 + rev: v9.0.0 - hooks: - args: - --single-quote @@ -52,7 +52,7 @@ repos: - css - javascript repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 + rev: v4.0.0-alpha.8 - hooks: - id: detekt repo: https://github.com/quwac/pre-commit-detekt @@ -62,7 +62,7 @@ repos: - --autofix id: pretty-format-kotlin repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.12.0 + rev: v2.13.0 - hooks: - exclude: .xcscheme$ id: detect-secrets @@ -71,7 +71,7 @@ repos: - hooks: - id: swiftlint repo: https://github.com/realm/SwiftLint - rev: 0.52.2 + rev: 0.54.0 - hooks: - id: detect-secrets repo: https://github.com/Yelp/detect-secrets @@ -79,7 +79,7 @@ repos: - hooks: - id: terraform_tflint repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.77.0 + rev: v1.88.4 - hooks: - additional_dependencies: - eslint@8.42.0 @@ -97,7 +97,7 @@ repos: types: - file repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.42.0 + rev: v9.0.0 - hooks: - args: - --single-quote @@ -105,7 +105,7 @@ repos: - all id: prettier repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 + rev: v4.0.0-alpha.8 - hooks: - id: check-added-large-files - id: check-ast @@ -129,7 +129,7 @@ repos: - id: end-of-file-fixer - id: check-yaml repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.6.0 - hooks: - id: detect-secrets repo: https://github.com/Yelp/detect-secrets diff --git a/tests/end-to-end/test-language-detect.bats b/tests/end-to-end/test-language-detect.bats index ec4050fc..47173708 100644 --- a/tests/end-to-end/test-language-detect.bats +++ b/tests/end-to-end/test-language-detect.bats @@ -6,62 +6,60 @@ setup() { @test "can detect C# language" { #cd tests/end-to-end/test-data/Csharp_Sample/ run python secureli/main.py init -ry - assert_output --partial 'Hooks successfully updated to latest version' - assert_output --partial 'seCureLI has been installed successfully' + assert_output --partial '[seCureLI] The following language(s) support secrets detection: C#' + assert_output --partial '[seCureLI] - C#: 100%' } @test "can detect Go language" { #cd tests/end-to-end/test-data/Go_Sample/ run python secureli/main.py init -ry - assert_output --partial 'Hooks successfully updated to latest version' - assert_output --partial 'seCureLI has been installed successfully' + assert_output --partial '[seCureLI] - Go: 100%' + assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): Go.' } @test "can detect Javascript language" { #cd tests/end-to-end/test-data/JavaScript_Sample/ run python secureli/main.py init -ry - assert_output --partial 'Hooks successfully updated to latest version' - assert_output --partial 'seCureLI has been installed successfully' + assert_output --partial '[seCureLI] - JavaScript: 100%' + assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): JavaScript.' } @test "can detect Kotlin language" { #cd tests/end-to-end/test-data/Kotlin_Sample/ run python secureli/main.py init -ry - assert_output --partial 'Hooks successfully updated to latest version' - assert_output --partial 'seCureLI has been installed successfully' + assert_output --partial '[seCureLI] - Kotlin: 100%' + assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): Kotlin.' } @test "can detect Python language" { #cd tests/end-to-end/test-data/Python_Sample/ run python secureli/main.py init -ry - assert_output --partial 'Hooks successfully updated to latest version' - assert_output --partial 'seCureLI has been installed successfully' + assert_output --partial '[seCureLI] - Python: 100%' + assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): Python.' } @test "can detect Swift language" { #cd tests/end-to-end/test-data/Swift_Sample/ run python secureli/main.py init -ry - assert_output --partial 'Hooks successfully updated to latest version' - assert_output --partial 'seCureLI has been installed successfully' + assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): Swift.' + assert_output --partial '[seCureLI] - Swift: 100%' } @test "can detect Terraform language" { #cd tests/end-to-end/test-data/Terraform_Sample/ run python secureli/main.py init -ry - assert_output --partial 'Hooks successfully updated to latest version' - assert_output --partial 'seCureLI has been installed successfully' + assert_output --partial '[seCureLI] - Terraform: 100%' + assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): Terraform.' } @test "can detect Typescript language" { #cd tests/end-to-end/test-data/Typescript_Sample/ run python secureli/main.py init -ry - assert_output --partial 'Hooks successfully updated to latest version' - assert_output --partial 'seCureLI has been installed successfully' + assert_output --partial '[seCureLI] - TypeScript: 100%' + assert_output --partial '[seCureLI] seCureLI has been installed successfully for the following language(s): TypeScript.cd ..' } @test "can detect Cloudformation language" { #cd tests/end-to-end/test-data/CloudFormation_Sample/ run python secureli/main.py init -ry - assert_output --partial 'Hooks successfully updated to latest version' - assert_output --partial 'seCureLI has been installed successfully' } \ No newline at end of file diff --git a/tests/test-data/CloudFormation_Sample/main.yaml b/tests/test-data/CloudFormation_Sample/main.yaml deleted file mode 100644 index 2c796de6..00000000 --- a/tests/test-data/CloudFormation_Sample/main.yaml +++ /dev/null @@ -1,5 +0,0 @@ -Resources: - HelloWorld: - Type: AWS::S3::Bucket - Properties: - BucketName: "hello-world-bucket" diff --git a/tests/test-data/Csharp_Sample/src/Program.cs b/tests/test-data/Csharp_Sample/src/Program.cs deleted file mode 100644 index 6e1130f5..00000000 --- a/tests/test-data/Csharp_Sample/src/Program.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -class Program -{ - static void Main(string[] args) - { - Console.WriteLine("Hello, world!"); - } -} diff --git a/tests/test-data/Go_Sample/src/main.go b/tests/test-data/Go_Sample/src/main.go deleted file mode 100644 index ef25884d..00000000 --- a/tests/test-data/Go_Sample/src/main.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("Hello, world!") -} diff --git a/tests/test-data/JavaScript_Sample/public/index.html b/tests/test-data/JavaScript_Sample/public/index.html deleted file mode 100644 index 080cb0eb..00000000 --- a/tests/test-data/JavaScript_Sample/public/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - JavaScript_Sample - - - - - diff --git a/tests/test-data/JavaScript_Sample/src/index.js b/tests/test-data/JavaScript_Sample/src/index.js deleted file mode 100644 index a8141d3b..00000000 --- a/tests/test-data/JavaScript_Sample/src/index.js +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello, world!"); diff --git a/tests/test-data/Kotlin_Sample/src/Main.kt b/tests/test-data/Kotlin_Sample/src/Main.kt deleted file mode 100644 index d113eced..00000000 --- a/tests/test-data/Kotlin_Sample/src/Main.kt +++ /dev/null @@ -1 +0,0 @@ -fun main() { println("Hello, world!") } diff --git a/tests/test-data/Python_Sample/main.py b/tests/test-data/Python_Sample/main.py deleted file mode 100644 index f7cf60e1..00000000 --- a/tests/test-data/Python_Sample/main.py +++ /dev/null @@ -1 +0,0 @@ -print("Hello, world!") diff --git a/tests/test-data/Swift_Sample/Sources/main.swift b/tests/test-data/Swift_Sample/Sources/main.swift deleted file mode 100644 index f7cf60e1..00000000 --- a/tests/test-data/Swift_Sample/Sources/main.swift +++ /dev/null @@ -1 +0,0 @@ -print("Hello, world!") diff --git a/tests/test-data/Terraform_Sample/main.tf b/tests/test-data/Terraform_Sample/main.tf deleted file mode 100644 index 69b152ca..00000000 --- a/tests/test-data/Terraform_Sample/main.tf +++ /dev/null @@ -1 +0,0 @@ -output "hello_world" { value = "Hello, world!" } diff --git a/tests/test-data/TypeScript_Sample/src/index.ts b/tests/test-data/TypeScript_Sample/src/index.ts deleted file mode 100644 index a8141d3b..00000000 --- a/tests/test-data/TypeScript_Sample/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello, world!");