Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(*): added tests for various components #61

Merged
merged 1 commit into from
Sep 3, 2024
Merged

Conversation

k4yt3x
Copy link
Collaborator

@k4yt3x k4yt3x commented Aug 30, 2024

🚦 Quality checklist

  • Did you add the changes in the CHANGELOG.md?
  • Did you run all the code checks? (go test)
  • Are the tests passing?

@k4yt3x k4yt3x requested a review from rios0rios0 August 30, 2024 19:13
@k4yt3x k4yt3x self-assigned this Aug 30, 2024
@k4yt3x k4yt3x marked this pull request as draft August 30, 2024 19:13
Copy link

gitguardian bot commented Aug 30, 2024

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
Once a secret has been leaked into a git repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

// Arrange
globalConfig := GlobalConfig{
Projects: []ProjectConfig{
{Path: "/home/user/test", ProjectAccessToken: "glpat-ABCDEFGHIJKLMNOPQRST"},

Check failure

Code scanning / SonarCloud

GitLab tokens should not be disclosed

<!--SONAR_ISSUE_KEY:AZGktWg6w3V8naojCthJ-->Make sure this GitLab token gets revoked, changed, and removed from the code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=rios0rios0_autobump&issues=AZGktWg6w3V8naojCthJ&open=AZGktWg6w3V8naojCthJ&pullRequest=61">SonarCloud</a></p>
},
LanguagesConfig: map[string]LanguageConfig{"Go": {}},
GpgKeyPath: "/home/user/.gnupg/autobump.asc",
GitLabAccessToken: "glpat-ABCDEFGHIJKLMNOPQRST",

Check failure

Code scanning / SonarCloud

GitLab tokens should not be disclosed

<!--SONAR_ISSUE_KEY:AZGktWg6w3V8naojCthK-->Make sure this GitLab token gets revoked, changed, and removed from the code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=rios0rios0_autobump&issues=AZGktWg6w3V8naojCthK&open=AZGktWg6w3V8naojCthK&pullRequest=61">SonarCloud</a></p>
func TestGetAuthMethods_Success(t *testing.T) {
// Arrange
globalConfig := GlobalConfig{
GitLabAccessToken: "glpat-ABCDEFGHIJKLMNOPQRST",

Check failure

Code scanning / SonarCloud

GitLab tokens should not be disclosed

<!--SONAR_ISSUE_KEY:AZGktWgaw3V8naojCtg_-->Make sure this GitLab token gets revoked, changed, and removed from the code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=rios0rios0_autobump&issues=AZGktWgaw3V8naojCtg_&open=AZGktWgaw3V8naojCtg_&pullRequest=61">SonarCloud</a></p>
GitLabAccessToken: "glpat-ABCDEFGHIJKLMNOPQRST",
}
projectConfig := ProjectConfig{
ProjectAccessToken: "glpat-ABCDEFGHIJKLMNOPQRST",

Check failure

Code scanning / SonarCloud

GitLab tokens should not be disclosed

<!--SONAR_ISSUE_KEY:AZGktWgaw3V8naojCthA-->Make sure this GitLab token gets revoked, changed, and removed from the code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=rios0rios0_autobump&issues=AZGktWgaw3V8naojCthA&open=AZGktWgaw3V8naojCthA&pullRequest=61">SonarCloud</a></p>
basicAuthFound := false
for _, authMethod := range authMethods {
if auth, ok := authMethod.(*http.BasicAuth); ok {
if auth.Password != "glpat-ABCDEFGHIJKLMNOPQRST" {

Check failure

Code scanning / SonarCloud

GitLab tokens should not be disclosed

<!--SONAR_ISSUE_KEY:AZGktWgaw3V8naojCthB-->Make sure this GitLab token gets revoked, changed, and removed from the code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=rios0rios0_autobump&issues=AZGktWgaw3V8naojCthB&open=AZGktWgaw3V8naojCthB&pullRequest=61">SonarCloud</a></p>
for _, authMethod := range authMethods {
if auth, ok := authMethod.(*http.BasicAuth); ok {
if auth.Password != "glpat-ABCDEFGHIJKLMNOPQRST" {
t.Errorf("expected password to be 'glpat-ABCDEFGHIJKLMNOPQRST', got %v", auth.Password)

Check failure

Code scanning / SonarCloud

GitLab tokens should not be disclosed

<!--SONAR_ISSUE_KEY:AZGktWgaw3V8naojCthC-->Make sure this GitLab token gets revoked, changed, and removed from the code. <p>See more on <a href="https://sonarcloud.io/project/issues?id=rios0rios0_autobump&issues=AZGktWgaw3V8naojCthC&open=AZGktWgaw3V8naojCthC&pullRequest=61">SonarCloud</a></p>
@k4yt3x k4yt3x changed the title tests: added tests for various imporant components tests(tests): added tests for config, git, project, and utils components Aug 30, 2024
@k4yt3x k4yt3x marked this pull request as ready for review August 30, 2024 22:05
@rios0rios0
Copy link
Owner

I need this PR to enter first, so we can correct Horusec and Semgrep here.

Copy link
Owner

@rios0rios0 rios0rios0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we solve the comments?

@rios0rios0
Copy link
Owner

Amazing work my friend!!!! I liked very much 💯 🥇

@k4yt3x k4yt3x changed the title tests(tests): added tests for config, git, project, and utils components tests(*): added tests for various components Aug 31, 2024
Signed-off-by: k4yt3x <i@k4yt3x.com>
Copy link

sonarqubecloud bot commented Sep 3, 2024

@rios0rios0 rios0rios0 merged commit 1feb42f into main Sep 3, 2024
9 of 11 checks passed
@rios0rios0 rios0rios0 deleted the tests/tests branch September 3, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants