-
Couldn't load subscription status.
- Fork 6
🐛 Test "make build" of generated service #116
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
Open
JavierGOrdonnez
wants to merge
6
commits into
master
Choose a base branch
from
work/jgo/test_make_build
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fc6da71
change to root user
998ae74
remove push GitHub action
949bc86
changed .osparc and Makefile structure to that of cookiecutter-jupyter
0f33464
new GitHub actions only (in sync w new Makefile)
165d368
wip - get stderr of make build
e3ed29c
remove dummy
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,9 @@ | |
|
|
||
| import subprocess | ||
| import sys | ||
| import os | ||
| from pathlib import Path | ||
| import datetime, time | ||
|
|
||
| from pytest_cookies.plugin import Cookies, Result | ||
| import pytest | ||
|
|
@@ -34,6 +36,7 @@ def baked_project(cookies: Cookies, request) -> Result: | |
| extra_context={ | ||
| "project_slug": "DummyProject", | ||
| "project_name": "dummy-project", | ||
| "author_email": "[email protected]", | ||
| "default_docker_registry": "test.test.com", | ||
| "docker_base": request.param, | ||
| } | ||
|
|
@@ -43,17 +46,27 @@ def baked_project(cookies: Cookies, request) -> Result: | |
| assert result.exit_code == 0 | ||
| return result | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "commands_on_baked_project", | ||
| ( | ||
| "ls -la .; make help", | ||
| # "ls -la .; make help", | ||
| # TODO: cannot use `source` to activate venvs ... not sure how to proceed here. Suggestions? | ||
| ## "make devenv; source .venv/bin/activate && make build info-build test", | ||
| # No need whatsoever, venv only needed for cookiecutter - once it is build, can use "make build" directly | ||
| "make build", | ||
| ), | ||
| ) | ||
| def test_make_workflows(baked_project: Result, commands_on_baked_project: str): | ||
| working_dir = baked_project.project_path | ||
| subprocess.run( | ||
| ["/bin/bash", "-c", commands_on_baked_project], cwd=working_dir, check=True | ||
| results = subprocess.run( | ||
| ["/bin/bash", "-c", commands_on_baked_project], cwd=working_dir, | ||
| # check=True, | ||
| capture_output=True, | ||
| ) | ||
|
|
||
| if results.returncode != 0: | ||
| current_time = datetime.datetime.now().strftime("%Y%m%d.%H%M%S%d"); time.sleep(1) # make sure not two test w same name | ||
| output_std_dir = current_dir.parent / "tmp" / "stderr" | ||
| os.makedirs(output_std_dir, exist_ok=True) | ||
| with open(output_std_dir / f"stderr_{current_time}.txt", "w+") as f: | ||
| print(results.stderr.decode(), file=f) | ||
| raise RuntimeError("Subprocess did not run correctly") | ||
53 changes: 0 additions & 53 deletions
53
{{cookiecutter.project_slug}}/.github/workflows/build-test-publish.yml
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
{{cookiecutter.project_slug}}/.github/workflows/check-image.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: Build and check image | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| verify-image-build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repo content | ||
| uses: actions/checkout@v2 | ||
| - name: ooil version | ||
| uses: docker://itisfoundation/ci-service-integration-library:v1.0.4 | ||
| with: | ||
| args: ooil --version | ||
| - name: Assemble docker compose spec | ||
| uses: docker://itisfoundation/ci-service-integration-library:v1.0.4 | ||
| with: | ||
| args: ooil compose | ||
| - name: Build all images if multiple | ||
| uses: docker://itisfoundation/ci-service-integration-library:v1.0.4 | ||
| with: | ||
| args: docker compose build | ||
| - name: test | ||
| run: make tests |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this value has to do with the ospar integration-version. It is defined on the osparc side.It defines how the catalog integrates this service. You cannot randomly change to another value!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Based on the other cookiecutter which I was using as template for the update (see my comment), that was 2.0.0, that is why I changed it. @GitHK please could you help here?