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

end2end localdb tests #6839

Merged
merged 1 commit into from Nov 22, 2019
Merged

end2end localdb tests #6839

merged 1 commit into from Nov 22, 2019

Conversation

n1zea144
Copy link
Contributor

@n1zea144 n1zea144 commented Nov 20, 2019

Fix #3850

Copy link
Member

@inodb inodb left a comment

Choose a reason for hiding this comment

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

Nice start! Minor comment on the yarn job

paths:
- cbioportal-frontend

install_yarn:
Copy link
Member

Choose a reason for hiding this comment

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

Once the e2e tests are using the backend of this PR the install_yarn job prolly won't be necessary anymore because the frontend artifacts are already in the war. No need to recompile them

Copy link
Contributor Author

@n1zea144 n1zea144 Nov 20, 2019

Choose a reason for hiding this comment

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

Hi @inodb Unless I'm misunderstanding something, it is already using the backend.

I checkout the frontend code so I can run the end-2-end test scripts. By setting the BACKEND var, I thought the end2end tests build the proper backend (using the user/HASH of the PR).

Copy link
Member

Choose a reason for hiding this comment

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

Good point - so it looks like it's pretty much working then 🎉. My point was mostly regarding some minor optimization. I think currently the localdb test tries to mount the frontend inside the war. That's why you need these steps of yarn run build etc. On the frontend e2e tests that makes sense cause you need to test against that frontend code in the PR. On the backend it's redundant b/c the war already contains the compiled frontend.

Another minor thing is that in the localdb tests the backend code gets pulled from GitHub again and the docker image is made. An optimization would be to create the image before running these tests and using it subsequently in the localdb tests ( to avoid the extra pull). You can then extend it with things like: only rebuild the image when the code has changed.

But yeah we can skip these optimizations for now I think, better to have something working in master branch.

Maybe just double check the backend of the PR is actually being used e.g. by introducing an error or something. And check it is properly creating the new backend image when you add a new commit in the pr to fix 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.

It is true that the only use of the backend checkout right now is to get the version of the frontend to checkout. I explored the idea of creating an image from the checkout step done by the pull_frontend_codebase job. In one scenario, it may just involve the modification of build_portal_image.sh, maybe with some additional args passed to setup_docker_containers.sh (called by the circle-ci config). @pvannierop any thoughts on this?

I did see from the circle-ci page that my hash was being used during the Setup docker images and containers step. I went ahead and introduced an error as you suggested to confirm the error and fix on revert. This looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@inodb I have a further thought on this - maybe I could add a check to see what files have changed after checkout and then short circuit the rest of the script when code files haven't changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@inodb based on what I've discovered and communicated to you during our conversation this morning, I'm going to drop the effort to optimize the current configuration. I'll merge this PR once you give the approval. cc @pvannierop

@n1zea144 n1zea144 force-pushed the fix-3850 branch 17 times, most recently from 948a1d9 to c6419ad Compare November 21, 2019 19:16
@n1zea144 n1zea144 force-pushed the fix-3850 branch 8 times, most recently from 1b07a6c to 07e93c1 Compare November 21, 2019 21:15
Copy link
Member

@inodb inodb left a comment

Choose a reason for hiding this comment

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

Good stuff! As discussed in person: let's go with this implementation and optimize later if necessary. The extra pull etc is negligible compared to actually running the tests

@inodb
Copy link
Member

inodb commented Nov 21, 2019

Small note: we should prolly update this once this one is fixed: #6844

@n1zea144 n1zea144 marked this pull request as ready for review November 22, 2019 01:43
@n1zea144 n1zea144 merged commit 648ce81 into cBioPortal:master Nov 22, 2019
@inodb inodb added the devops label Nov 22, 2019
@inodb inodb changed the title On the road to end2end localdb tests end2end localdb tests Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run frontend localdb end2end tests in backend repo
2 participants