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

Job Services: fixtures and acceptance tests #14319

Merged
merged 26 commits into from
Aug 29, 2022

Conversation

philrenaud
Copy link
Contributor

@philrenaud philrenaud commented Aug 25, 2022

Adds Mirage fixtures and basic acceptance tests for the Job Services tab

image
image

@github-actions
Copy link

github-actions bot commented Aug 25, 2022

Ember Asset Size action

As of 48d5c42

Files that got Bigger 🚨:

File raw gzip
nomad-ui.js +1.13 kB +188 B

Files that stayed the same size 🤷‍:

File raw gzip
vendor.js 0 B 0 B
nomad-ui.css 0 B 0 B
vendor.css 0 B 0 B

@github-actions
Copy link

github-actions bot commented Aug 25, 2022

Ember Test Audit comparison

14202-scaffold-new-parent-route 6fd4c60 change
passes 1416 186 -1230
failures 3 19 +16
flaky 0 0 0
duration 000ms 000ms -000ms

@philrenaud philrenaud changed the title Group level service fixtures established Job Services: fixtures and acceptance tests Aug 25, 2022
@philrenaud philrenaud marked this pull request as ready for review August 25, 2022 17:20
Copy link
Contributor

@ChaiWithJai ChaiWithJai left a comment

Choose a reason for hiding this comment

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

LGTM


afterCreate(service, server) {
if (!service.namespace) {
const namespace = pickOne(server.db.jobs)?.namespace || 'default';
Copy link
Contributor

Choose a reason for hiding this comment

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

This is randomly going to pick a job and assign the namespace of that job to this Service instead of taking the related job's namespace. Which could cause weird test related bugs down the line.

Comment on lines +43 to +48
if (server.db.jobs.findBy({ id: 'service-haver' })) {
if (!service.jobId) {
service.update({
jobId: 'service-haver',
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this logic be tied to the namespace assignment? Will this logic mix well with allScenarios in mirage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In testing re: allScenarios, so far so good.

I don't think it should be tied to the namespace assignment; it's in the same afterCreate block but otherwise separated.

@@ -10,7 +10,7 @@ export default class JobServiceRowComponent extends Component {
if (service.provider === 'nomad') {
this.router.transitionTo('jobs.job.services.service', service.name, {
queryParams: { level: service.level },
instances: service.instances,
instances: service.instances,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Prettier side-effect; please ignore

@@ -1,10 +1,12 @@
import Route from '@ember/routing/route';

export default class JobsJobServicesServiceRoute extends Route {
model({name = "", level = ""}) {
model({ name = '', level = '' }) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Prettier side-effect; please ignore

Base automatically changed from 14202-scaffold-new-parent-route to f-ui/service-discovery August 26, 2022 03:22
@philrenaud philrenaud merged commit 9f89bab into f-ui/service-discovery Aug 29, 2022
@philrenaud philrenaud deleted the 14202-services-fixtures branch August 29, 2022 18:04
@philrenaud philrenaud mentioned this pull request Aug 29, 2022
17 tasks
philrenaud added a commit that referenced this pull request Aug 31, 2022
* Added to subnav and basic table implemented

* Existing services become service fragments, and services tab aggregated beneath job route

* Index page within jobs/job/services

* Watchable services

* Lintfixes

* Links to clients and individual services set up

* Child service route

* Keyboard shortcuts on service page

* Model that shows consul services as well, plus level and provider cols

* lintfix

* Level as query param

* Watch job for service name changes too

* Group level service fixtures established

* Progress at task level and job-linked services

* Task and group services on update

* Fixture side-effect cleanup

* Basic acceptance tests for job services

* Testmodel cleanup

* Disabled mirage logging

* New cluster type specifically for services

* Without explicit job-model binding

* Trying to isolate a tostring error

* Account for new tab in keyboardnav

* More test isolation attempts

* Remove skipped tests and link task to parent group by id

ui: add service health viz to table (#14369)

* ui: add service-status-bar

* test: service-status-bar

* refact: update component api for new data struct

* ui: format service health struct

* ui:  add service health viz to table

* temp: add placeholder to remind conditional watcher

* test: write tests for transformation algorithm

* refact: update transformation algo

* ui: conditionally long poll checks endpoint

* refact: add conditional logic for nomad provider

refact: update service-fragment model to include owner info

ui: differentiate between task and group-level in derived state comp

test: add test to document behavior

refact: update tests for api change

refact: update integration test for API change

chore: remove unsused vars

chore: elvis operator to protect mirage

refact: create refId instead of internalModel

refact: update algo

refact: update conditional template logic

refact: update test for api change:

chore: cant use if and not in hbs conditional
philrenaud added a commit that referenced this pull request Sep 7, 2022
* Added to subnav and basic table implemented

* Existing services become service fragments, and services tab aggregated beneath job route

* Index page within jobs/job/services

* Watchable services

* Lintfixes

* Links to clients and individual services set up

* Child service route

* Keyboard shortcuts on service page

* Model that shows consul services as well, plus level and provider cols

* lintfix

* Level as query param

* Watch job for service name changes too

* Group level service fixtures established

* Progress at task level and job-linked services

* Task and group services on update

* Fixture side-effect cleanup

* Basic acceptance tests for job services

* Testmodel cleanup

* Disabled mirage logging

* New cluster type specifically for services

* Without explicit job-model binding

* Trying to isolate a tostring error

* Account for new tab in keyboardnav

* More test isolation attempts

* Remove skipped tests and link task to parent group by id

ui: add service health viz to table (#14369)

* ui: add service-status-bar

* test: service-status-bar

* refact: update component api for new data struct

* ui: format service health struct

* ui:  add service health viz to table

* temp: add placeholder to remind conditional watcher

* test: write tests for transformation algorithm

* refact: update transformation algo

* ui: conditionally long poll checks endpoint

* refact: add conditional logic for nomad provider

refact: update service-fragment model to include owner info

ui: differentiate between task and group-level in derived state comp

test: add test to document behavior

refact: update tests for api change

refact: update integration test for API change

chore: remove unsused vars

chore: elvis operator to protect mirage

refact: create refId instead of internalModel

refact: update algo

refact: update conditional template logic

refact: update test for api change:

chore: cant use if and not in hbs conditional
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 28, 2022
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.

None yet

2 participants