Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Framework understands GALASA_HOME env var and system property. #394

Merged
merged 8 commits into from
Apr 13, 2023

Conversation

techcobweb
Copy link
Contributor

@techcobweb techcobweb commented Apr 11, 2023

Signed-off-by: Mike Cobbett 77053+techcobweb@users.noreply.github.com

This PR relates to galasa-dev/projectmanagement#1397

  • Set of mock objects capable of mocking the underside of the framework init code.
  • Broke the massive constructor (200+ lines) into smaller functions which can be unit tested in isolation.
  • Less reliance on this.xxx in all methods, which made things very interlocked.
  • Added IFileSystem to isolate the code from access to nio.filesystem. So file and folder create operations can be mocked-out.
  • Added IEnvironment to isolate the code from System.getenv() and System.getProperty() calls.

Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build failed, see http://localhost:8001/api/v1/namespaces/tekton-pipelines/services/tekton-dashboard:http/proxy/#/namespaces/galasa-build/pipelineruns/repo-framework-pr-394-9kdp5 for details. If you are unable to do so, please contact a member of the Galasa team.

Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build failed, see http://localhost:8001/api/v1/namespaces/tekton-pipelines/services/tekton-dashboard:http/proxy/#/namespaces/galasa-build/pipelineruns/repo-framework-pr-394-568dw for details. If you are unable to do so, please contact a member of the Galasa team.

@techcobweb techcobweb changed the title refactor and first unit test of framework intiakise refactor and first unit test of framework intialise Apr 11, 2023
Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build successful

Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build successful

Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build successful

@techcobweb techcobweb changed the title refactor and first unit test of framework intialise Framework understands GALASA_HOME env var and system property. Apr 12, 2023
Copy link
Member

@Jimbo4794 Jimbo4794 left a comment

Choose a reason for hiding this comment

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

Arron may have more suggestions still so dont take my approval as the only one. But looking through looks to make this a lot ore readable. As just discussed, there are a few areas like the location of Creds which could do with some more logging (trace).

But nice refactor assuming all working.

I didnt review much of the mocks but nice to see the tests

Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build successful

Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build successful

Copy link
Member

@Jimbo4794 Jimbo4794 left a comment

Choose a reason for hiding this comment

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

Approved subject to suggestions

Signed-off-by: Mike Cobbett <77053+techcobweb@users.noreply.github.com>
@galasa-team
Copy link

Build successful

@techcobweb techcobweb merged commit f18dd64 into main Apr 13, 2023
@techcobweb techcobweb deleted the mcobbett-GALASA_HOME branch June 6, 2023 08:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants