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

feature: Add qa-automation orb #82

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/executors/qa-automation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker:
- image: codacy/qa-automation-test-runner:2.8.2
jonathancarvalheiro marked this conversation as resolved.
Show resolved Hide resolved
- image: selenium/standalone-chrome:3.141.0
43 changes: 43 additions & 0 deletions src/jobs/qa-automation-suite.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
executor: qa-automation

parameters:
test_path:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand what this parameter does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the path to the test suite to run, which is locate inside the docker image

Copy link
Contributor

Choose a reason for hiding this comment

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

so we have a fixed number of possibilities?
can we list them, at least in a comment?

Choose a reason for hiding this comment

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

I can provide the list:

Dev -> Suite/API/DEV.xml,Suite/WEB/DEV.xml,Suite/WEB/DEV2.xml,Suite/E2E/DEV.xml
Staging -> Suite/API/DEV.xml,Suite/WEB/STAGING.xml,Suite/WEB/STAGING.xml,Suite/E2E/STAGING.xml
Prod -> Suite/API/PROD.xml,Suite/WEB/PROD.xml,Suite/E2E/PROD.xml

Copy link
Contributor Author

@DReigada DReigada May 7, 2020

Choose a reason for hiding this comment

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

New suites can be added, it seems too cumbersome to add them here every time there's a change in the qa-automation repo.

Copy link
Contributor Author

@DReigada DReigada May 7, 2020

Choose a reason for hiding this comment

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

What I suggest doing is adding to the description a link to the qa-automation repo, where all files are located

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree into keeping this list in the qa-automation-test repository, and here we keep a link.
Works for you @jonathancarvalheiro ?

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

up to you, either way I'm good with it 👍

description: "The path to the test suite to run"
type: string
project_name:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a fixed number of option I suppose, can we list them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure. @medleycodacy @jonathancarvalheiro any idea?

Choose a reason for hiding this comment

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

@andreaTP Could not be fixed number, since you can create your specific project on RP. But we can suggest or have a default :qa-automation-tests

Copy link
Contributor

Choose a reason for hiding this comment

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

so this parameter should be called possibly:
report_portal_project_name correct?
@jonathancarvalheiro what happens if we set a name that is not "registered" already in RP?
Do we have a little description on how to "create a project" in RP?

Choose a reason for hiding this comment

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

I'll leave the description in here.
Create a project on RP.

  1. Go to the RP and login with the superadmin user (check Bitwarden for that).
  2. Click on the right top corner in the user options, and select Administrate.
  3. Click on the Add New Project button, and define the project name.

Something like this, @andreaTP ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could we add that to the docs of the qa-automation repo?
And add a link to there in this description?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes @jonathancarvalheiro but I think @DReigada suggestion stands. please.

Choose a reason for hiding this comment

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

I'll do that.

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

description: "The name of the project running the tests"
DReigada marked this conversation as resolved.
Show resolved Hide resolved
type: string
launch_name:
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a parameter for report portal? in case I suggest to call it report_portal_name or something alike

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would rather keep the name and improve the description.
By using this orb you know that you are reporting to report portal, it seems redundant to "report_portal" to the name of the variables

Copy link
Contributor

Choose a reason for hiding this comment

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

here some parameters are referring to the qa-automation-test suite itself and other to the RP integration.
At best of my knowledge you can disable the integration with report_portal (@jonathancarvalheiro can you confirm?)
so

By using this orb you know that you are reporting to report portal
is not correct

Choose a reason for hiding this comment

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

It's not configurable, the only way it's not to set the RP parameters. I'll check if the docker image works without setting the RP parameters.

Choose a reason for hiding this comment

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

So I checked, and it's mandatory to have the RP parameters defined.

Choose a reason for hiding this comment

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

I purpose to leave like it is right now, and when I put this as a configuration, I do a PR in here as well.

description: "The name to give to the test launch"
type: string
default: EXTERNAL_TEST_RUN
launch_description:
Copy link
Contributor

Choose a reason for hiding this comment

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

the comment above apply here as well

description: "The description to give to the test launch"
type: string
default: "Automated Tests Ran by CircleCI"
launch_tag:
Copy link
Contributor

Choose a reason for hiding this comment

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

as well

description: "The tags to add to the test launch (seperated by semi-colons)"
type: string
default: CIRCLECI;EXTERNAL


environment:
TEST_PATH: << parameters.test_path >>
PROJECT_NAME: << parameters.project_name >>
LAUNCH_NAME: << parameters.launch_name >>
LAUNCH_DESCRIPTION: << parameters.launch_description >>
LAUNCH_TAG: << parameters.launch_tag >>
RP_ENDPOINT: https://reportportal.dev.codacy.org
Copy link
Contributor

Choose a reason for hiding this comment

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

this URL should be a parameter, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The report portal URL is always the same, we only have one instance. Making this a parameter seems it will only increase the complexity of the parameters

Copy link
Contributor

Choose a reason for hiding this comment

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

So I think I'm outdated ... we used to have an instance per environment (@jonathancarvalheiro ?).
Since this code is public I don't know if we should keep this url hardcoded here, I think the best is to have it in env variable in the context.
We don't "publicize" our internal infrastructure urls.

Choose a reason for hiding this comment

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

@andreaTP, no we always had one instance for all environments.
But I agree as using that with an environment variable on the circle ci e.g.
There's some that we have to set on the circle ci in order for this to work:
RP_ENDPOINT; ENCRYPTION_KEY; RP_CIRCLECI_UUID
Could worth to be mentioned.

SELENIUM_DRIVER_URL: http://localhost:4444/wd/hub
HUB_URL: http://localhost:4444/wd/hub
JAVA_OPTS: -Xss256m -Xmx512m
andreaTP marked this conversation as resolved.
Show resolved Hide resolved
MAVEN_OPTS: -showversion -Xms256m -Xmx512m
andreaTP marked this conversation as resolved.
Show resolved Hide resolved

steps:
- attach_workspace:
at: ~/workdir
- deploy:
name: Run tests
command: |
export EXECUTION_TIME=`date +%F_%Hh%M-%Z`
sh /opt/tests/qa-automation-test-runner/build/run_tests.sh