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

Adds multi-language support to integration test workflow #79

Merged
merged 3 commits into from
Jan 13, 2023

Conversation

DavidSeptimus
Copy link
Contributor

This PR adds support for multiple languages (specifically including Python) through the following means:

  • Adding a step to detect language based on the sample app directory prefix
  • Modifying the sample app directory detection logic to include apps containing a Makefile containing an integ-test rule
  • Making language-specific steps conditionally executed
  • Adding a step to run python integraiton tests

Standard checks

  • Unit tests: Any special considerations? No
  • Docs: Do we need to update any docs, internal or public? No
  • Backwards compatibility: Will this break existing apps? If so, what would be the extra work required to keep them working? Np

- Added step to detect language from sample app directory prefix
- Added conditions for TypeScript-specific steps
- Added integ test step for python
Adds py-microservices sample app

- Added py-microservices sample app
- Added integration tests for py-microservices
@DavidSeptimus DavidSeptimus temporarily deployed to integ_test January 13, 2023 16:26 — with GitHub Actions Inactive
@DavidSeptimus DavidSeptimus temporarily deployed to integ_test January 13, 2023 16:26 — with GitHub Actions Inactive
@@ -69,7 +69,13 @@ jobs:
set -x
dirs_with_tests="$(
for d in $(find * -type d -maxdepth 0 || printf ''); do
jq &>/dev/null -e '.scripts."integ-test"' $d/package.json && echo "$d"
TESTABLE_APP=$(jq &>/dev/null -e '.scripts."integ-test"' $d/package.json && echo "$d")
if [[ ! -z $(grep "^integ-test:" "${d}/Makefile" 2> /dev/null) ]]; then
Copy link

Choose a reason for hiding this comment

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

Super minor, but in case you're interested:

  1. ! -z is aka -n
  2. you can just do if grep -q ... ; then (with no [[ ... ]]]). In that mode, grep doesn't actually output anything (to either stdout or stderr), but instead just exits with 0 iff any lines matched

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks. I used -s instead of -q to avoid printing File not found for Makefile in typescript projects.

Copy link

Choose a reason for hiding this comment

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

I didn't know about that one! nice.

@@ -166,6 +175,7 @@ jobs:
env:
KLOTHO_LOGIN: ${{ inputs.klotho-login }}
- name: typescript compilation
if: steps.get_language.outputs.language == 'ts'
Copy link

Choose a reason for hiding this comment

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

nice!

@DavidSeptimus DavidSeptimus temporarily deployed to integ_test January 13, 2023 16:46 — with GitHub Actions Inactive
@DavidSeptimus DavidSeptimus temporarily deployed to integ_test January 13, 2023 16:46 — with GitHub Actions Inactive
@DavidSeptimus DavidSeptimus temporarily deployed to integ_test January 13, 2023 16:48 — with GitHub Actions Inactive
@DavidSeptimus DavidSeptimus temporarily deployed to integ_test January 13, 2023 16:48 — with GitHub Actions Inactive
@github-actions
Copy link

Package Line Rate Health
github.com/klothoplatform/klotho/pkg/analytics 2%
github.com/klothoplatform/klotho/pkg/annotation 24%
github.com/klothoplatform/klotho/pkg/core 20%
github.com/klothoplatform/klotho/pkg/env_var 82%
github.com/klothoplatform/klotho/pkg/exec_unit 45%
github.com/klothoplatform/klotho/pkg/infra/kubernetes 58%
github.com/klothoplatform/klotho/pkg/infra/kubernetes/helm 52%
github.com/klothoplatform/klotho/pkg/input 63%
github.com/klothoplatform/klotho/pkg/lang 37%
github.com/klothoplatform/klotho/pkg/lang/dockerfile 0%
github.com/klothoplatform/klotho/pkg/lang/golang 9%
github.com/klothoplatform/klotho/pkg/lang/javascript 47%
github.com/klothoplatform/klotho/pkg/lang/python 60%
github.com/klothoplatform/klotho/pkg/lang/yaml 0%
github.com/klothoplatform/klotho/pkg/logging 7%
github.com/klothoplatform/klotho/pkg/multierr 95%
github.com/klothoplatform/klotho/pkg/provider/aws 60%
github.com/klothoplatform/klotho/pkg/runtime 75%
github.com/klothoplatform/klotho/pkg/static_unit 32%
github.com/klothoplatform/klotho/pkg/validation 73%
Summary 42% (3592 / 8587)

@DavidSeptimus DavidSeptimus merged commit 860d627 into main Jan 13, 2023
@DavidSeptimus DavidSeptimus deleted the python-integ-tests branch January 13, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants