Skip to content

Commit

Permalink
Merge pull request #938 from kamadorueda/main
Browse files Browse the repository at this point in the history
test(back): #919 add tests
  • Loading branch information
kamadorueda authored Sep 25, 2022
2 parents 00c0909 + a856963 commit 9ff54bd
Show file tree
Hide file tree
Showing 14 changed files with 1,354 additions and 1,065 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,23 @@ jobs:
- name: /taintTerraform/module
run: nix-env -if . && m . /taintTerraform/module

linux_testPython_cliMain:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- uses: docker://docker.io/nixos/nix@sha256:1d13ae379fb8caf3f859c5ce7ec6002643d60cf8b7b6147b949cc34880c93bac
name: /testPython/cliMain
with:
set-safe-directory: /github/workspace
args: sh -c "nix-env -if . && m . /testPython/cliMain"
macos_testPython_cliMain:
runs-on: macos-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- uses: cachix/install-nix-action@451e61183802597c1febd6ca3cf18aa163f93a06
- name: /testPython/cliMain
run: nix-env -if . && m . /testPython/cliMain

linux_testPython_example:
runs-on: ubuntu-latest
steps:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,27 @@ jobs:
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}

linux_dev_cliMain:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- uses: docker://docker.io/nixos/nix@sha256:1d13ae379fb8caf3f859c5ce7ec6002643d60cf8b7b6147b949cc34880c93bac
name: /dev/cliMain
with:
set-safe-directory: /github/workspace
args: sh -c "nix-env -if . && m . /dev/cliMain"
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
macos_dev_cliMain:
runs-on: macos-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- uses: cachix/install-nix-action@451e61183802597c1febd6ca3cf18aa163f93a06
- name: /dev/cliMain
run: nix-env -if . && m . /dev/cliMain
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}

linux_dev_example:
runs-on: ubuntu-latest
steps:
Expand Down
29 changes: 25 additions & 4 deletions makes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
fetchNixpkgs,
inputs,
outputs,
projectPath,
...
}: {
projectIdentifier = "makes-repo";
Expand Down Expand Up @@ -133,9 +134,7 @@
targets = ["/"];
};
lintPython = let
searchPaths = {
source = [outputs."/cli/env/runtime/pypi"];
};
searchPaths.source = [outputs."/cli/env/runtime"];
in {
dirsOfModules = {
makes = {
Expand Down Expand Up @@ -210,7 +209,7 @@
securePythonWithBandit = {
cli = {
python = "3.9";
target = "/src/cli";
target = "/src/cli/main";
};
};
taintTerraform = {
Expand All @@ -227,6 +226,28 @@
python = "3.9";
src = "/test/test-python";
};
cliMain = {
python = "3.9";
extraFlags = [
"--cov=main"
"--cov-branch"
"--cov-report=term-missing"
"--capture=no"
];
searchPaths = {
bin = [
inputs.nixpkgs.git
];
pythonPackage = [
(projectPath "/src/cli/main")
];
source = [
outputs."/cli/env/test"
outputs."/cli/env/runtime"
];
};
src = "/src/cli";
};
};
testTerraform = {
modules = {
Expand Down
8 changes: 8 additions & 0 deletions makes/cli/env/test/main.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-FileCopyrightText: 2022 Fluid Attacks and Makes contributors
#
# SPDX-License-Identifier: MIT
{makePythonPypiEnvironment, ...}:
makePythonPypiEnvironment {
name = "cli-env-test";
sourcesYaml = ./pypi-sources.yaml;
}
3 changes: 3 additions & 0 deletions makes/cli/env/test/pypi-deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
pytest: '*'
pytest-cov: '*'
3 changes: 3 additions & 0 deletions makes/cli/env/test/pypi-deps.yaml.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2022 Fluid Attacks and Makes contributors

SPDX-License-Identifier: MIT
102 changes: 102 additions & 0 deletions makes/cli/env/test/pypi-sources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
closure:
attrs: 22.1.0
colorama: 0.4.5
coverage: 6.4.4
iniconfig: 1.1.1
packaging: '21.3'
pluggy: 1.0.0
py: 1.11.0
pyparsing: 3.0.9
pytest: 7.1.3
pytest-cov: 3.0.0
tomli: 2.0.1
links:
- name: attrs-22.1.0-py2.py3-none-any.whl
sha256: 072mv8qgvas8sagx7f021l9yrca6ry3m8cqsylsdzwkvyq1a9vw6
url: https://files.pythonhosted.org/packages/f2/bc/d817287d1aa01878af07c19505fafd1165cd6a119e9d0821ca1d1c20312d/attrs-22.1.0-py2.py3-none-any.whl
- name: attrs-22.1.0.tar.gz
sha256: 1di2kd18bc0sdq61sa24sdr9c7xjg3g8ymkw1qfikra7aikc5b99
url: https://files.pythonhosted.org/packages/1a/cb/c4ffeb41e7137b23755a45e1bfec9cbb76ecf51874c6f1d113984ecaa32c/attrs-22.1.0.tar.gz
- name: colorama-0.4.5-py2.py3-none-any.whl
sha256: 1nlriqsqjsilvxg6pm3086z2xkjviplw3gz79a1gadryjd2g8jw5
url: https://files.pythonhosted.org/packages/77/8b/7550e87b2d308a1b711725dfaddc19c695f8c5fa413c640b2be01662f4e6/colorama-0.4.5-py2.py3-none-any.whl
- name: colorama-0.4.5.tar.gz
sha256: 195pcxlhp4qz8pq496kvw6k7vdd056j8mffr76k8h2f59wrv9ip6
url: https://files.pythonhosted.org/packages/2b/65/24d033a9325ce42ccbfa3ca2d0866c7e89cc68e5b9d92ecaba9feef631df/colorama-0.4.5.tar.gz
- name: coverage-6.4.4-cp39-cp39-macosx_10_9_x86_64.whl
sha256: 11hvxg1bvf4ycy7drqflf3cghf52c7wnrrh01bdkr2bjnplvkh4q
url: https://files.pythonhosted.org/packages/fd/1a/8b2f6aabf828e9795855001848ce72370819fffca883714eb25aa6d00b38/coverage-6.4.4-cp39-cp39-macosx_10_9_x86_64.whl
- name: coverage-6.4.4-cp39-cp39-macosx_11_0_arm64.whl
sha256: 0239l3h9d1jx0lhg529yxygcwipv76iys5sqv2hks9wvq5p0yq7w
url: https://files.pythonhosted.org/packages/ca/0e/e60fbc65bc054d904984ccd2a52c122fd291c682b5713b37dbb978f853bb/coverage-6.4.4-cp39-cp39-macosx_11_0_arm64.whl
- name: coverage-6.4.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
sha256: 0kxcbgm91gl6nwicadn7hly4ikahac64wyqcc1xc19acdnzxd63s
url: https://files.pythonhosted.org/packages/26/e7/dbbfe7288d846b372229794d7c5f48d55e519d30e1419febea7b1e71478c/coverage-6.4.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- name: coverage-6.4.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
sha256: 1wl88zmwdppglfl4f5r5j6xl9ic5x0mz88g24id71gbx15lqfxq1
url: https://files.pythonhosted.org/packages/35/3d/d79b2b927e7cb8dded2a003d22348b918509fe1238ff796a0b2fde9b3718/coverage-6.4.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
- name: coverage-6.4.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
sha256: 0n053s2h8a4pq3lminpvr1liz3s04wdhfrj1n8m5w984p5zbk86z
url: https://files.pythonhosted.org/packages/1c/59/1d3dae9d3821b81dc17b06438c6918060388457272af20856d42a8bb30b7/coverage-6.4.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- name: coverage-6.4.4-cp39-cp39-musllinux_1_1_aarch64.whl
sha256: 068a99gdns7bq0idzgl9wsvhdkdjgr8pwkbki2mzh4z0afd3vgpw
url: https://files.pythonhosted.org/packages/16/99/e69b196431c25d7fa845bdd8265a0f111d3e036c4b1cac7a98cb4e5a07b9/coverage-6.4.4-cp39-cp39-musllinux_1_1_aarch64.whl
- name: coverage-6.4.4-cp39-cp39-musllinux_1_1_i686.whl
sha256: 03bs3iln6y6f8i2y8nnzlpbi47qyzdbi91csrhnfj9727s2qvqqm
url: https://files.pythonhosted.org/packages/08/e4/9a7556b46a646520bda96f53c3fe691c9c5f7ebd0b64fc6aea8e829b75e7/coverage-6.4.4-cp39-cp39-musllinux_1_1_i686.whl
- name: coverage-6.4.4-cp39-cp39-musllinux_1_1_x86_64.whl
sha256: 06im6pvldvj8439gw67qn3mv701yihbcaf96a6r8mzyywbgds4v9
url: https://files.pythonhosted.org/packages/f9/f5/d3bea1146b7ee22323b667abc029e3be962a162e036e9d30459e6d554a8a/coverage-6.4.4-cp39-cp39-musllinux_1_1_x86_64.whl
- name: coverage-6.4.4.tar.gz
sha256: 0n0dygbm5an42whz6f1ln1593cqh7inji2zqwvhq1dxc4svlav71
url: https://files.pythonhosted.org/packages/79/f3/8c1af7233f874b5df281397e2b96bedf58dc440bd8c6fdbf93a4436c517a/coverage-6.4.4.tar.gz
- name: iniconfig-1.1.1-py2.py3-none-any.whl
sha256: 1cx8kpp3akxwadzsmv2cdnifkyzj8fki5frmv3mzcivz9g3287h1
url: https://files.pythonhosted.org/packages/9b/dd/b3c12c6d707058fa947864b67f0c4e0c39ef8610988d7baea9578f3c48f3/iniconfig-1.1.1-py2.py3-none-any.whl
- name: iniconfig-1.1.1.tar.gz
sha256: 0ckzngs3scaa1mcfmsi1w40a1l8cxxnncscrxzjjwjyisx8z0fmw
url: https://files.pythonhosted.org/packages/23/a2/97899f6bd0e873fed3a7e67ae8d3a08b21799430fb4da15cfedf10d6e2c2/iniconfig-1.1.1.tar.gz
- name: packaging-21.3-py3-none-any.whl
sha256: 08nmbgmf38nnxr99d5nlnacrr2jh1wp4xsi4ms1wgk8ryl2kw47g
url: https://files.pythonhosted.org/packages/05/8e/8de486cbd03baba4deef4142bd643a3e7bbe954a784dc1bb17142572d127/packaging-21.3-py3-none-any.whl
- name: packaging-21.3.tar.gz
sha256: 1sygirdrqgv4f1ckh9nhpcw1yfidrh3qjl86wq8vk6nq4wlw8iyx
url: https://files.pythonhosted.org/packages/df/9e/d1a7217f69310c1db8fdf8ab396229f55a699ce34a203691794c5d1cad0c/packaging-21.3.tar.gz
- name: pluggy-1.0.0-py2.py3-none-any.whl
sha256: 1lvvnc39v43v5jawq2wz0765rg9lkx8f25l4sqv1l0vz8nzln4vl
url: https://files.pythonhosted.org/packages/9e/01/f38e2ff29715251cf25532b9082a1589ab7e4f571ced434f98d0139336dc/pluggy-1.0.0-py2.py3-none-any.whl
- name: pluggy-1.0.0.tar.gz
sha256: 0n8iadlas2z1b4h0fc73b043c7iwfvx9rgvqm1azjmffmhxkf922
url: https://files.pythonhosted.org/packages/a1/16/db2d7de3474b6e37cbb9c008965ee63835bba517e22cdb8c35b5116b5ce1/pluggy-1.0.0.tar.gz
- name: py-1.11.0-py2.py3-none-any.whl
sha256: 0y5k0mjcr85i9xrd2wifc7gww596nq6dbz6d9bzpsr1jhwhm6z30
url: https://files.pythonhosted.org/packages/f6/f0/10642828a8dfb741e5f3fbaac830550a518a775c7fff6f04a007259b0548/py-1.11.0-py2.py3-none-any.whl
- name: py-1.11.0.tar.gz
sha256: 06c7m7sfcn7587xd4s2bng8m6q1gsfd3j93afhplfjq74r0mrisi
url: https://files.pythonhosted.org/packages/98/ff/fec109ceb715d2a6b4c4a85a61af3b40c723a961e8828319fbcb15b868dc/py-1.11.0.tar.gz
- name: pyparsing-3.0.9-py3-none-any.whl
sha256: 1g3b426kswh9ndjdlkpf9ba0fhwz5c2hjbxb3nvfzshfl7lvl9jh
url: https://files.pythonhosted.org/packages/6c/10/a7d0fa5baea8fe7b50f448ab742f26f52b80bfca85ac2be9d35cdd9a3246/pyparsing-3.0.9-py3-none-any.whl
- name: pyparsing-3.0.9.tar.gz
sha256: 1yvhdm0wdc1n20fzl0qly13llr0zcg9wl7mp37r8gdi1gp7hw0ib
url: https://files.pythonhosted.org/packages/71/22/207523d16464c40a0310d2d4d8926daffa00ac1f5b1576170a32db749636/pyparsing-3.0.9.tar.gz
- name: pytest-7.1.3-py3-none-any.whl
sha256: 1dqqm2yz0z63cywjjilnqwcz5z3wpdazmv2w7xgbaw3d8sivsxqk
url: https://files.pythonhosted.org/packages/e3/b9/3541bbcb412a9fd56593005ff32183825634ef795a1c01ceb6dee86e7259/pytest-7.1.3-py3-none-any.whl
- name: pytest-7.1.3.tar.gz
sha256: 0f8c31v5r2kgjixvy267n0nhc4xsy65g3n9lz1i1377z5pn5ydjg
url: https://files.pythonhosted.org/packages/a4/a7/8c63a4966935b0d0b039fd67ebf2e1ae00f1af02ceb912d838814d772a9a/pytest-7.1.3.tar.gz
- name: pytest_cov-3.0.0-py3-none-any.whl
sha256: 19m75ii6drx6x5nvpwzfknpdm7xh0mdbhf69c7wya9aamhamv3ap
url: https://files.pythonhosted.org/packages/20/49/b3e0edec68d81846f519c602ac38af9db86e1e71275528b3e814ae236063/pytest_cov-3.0.0-py3-none-any.whl
- name: pytest-cov-3.0.0.tar.gz
sha256: 0w6lfv8gc1lxmnvsz7mq5z9shxac5zz6s9mwrai108kxc6qzbw77
url: https://files.pythonhosted.org/packages/61/41/e046526849972555928a6d31c2068410e47a31fb5ab0a77f868596811329/pytest-cov-3.0.0.tar.gz
- name: tomli-2.0.1-py3-none-any.whl
sha256: 1k0fqfdylinb57s2aqwprahwbrsk3babg4gghz4g06hnlvky77ck
url: https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl
- name: tomli-2.0.1.tar.gz
sha256: 0kwazq3i18rphcr8gak4fgzdcj5w5bbn4k4j2l6ma32gj496qlny
url: https://files.pythonhosted.org/packages/c0/3f/d7af728f075fb08564c5949a9c95e44352e23dee646869fa104a3b2060a3/tomli-2.0.1.tar.gz
python: '3.9'
3 changes: 3 additions & 0 deletions makes/cli/env/test/pypi-sources.yaml.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2022 Fluid Attacks and Makes contributors

SPDX-License-Identifier: MIT
6 changes: 1 addition & 5 deletions makes/license/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ function main {
done \
&& find . "${remaining[@]}" -type f \
-exec "${license[@]}" --explicit-license {} \+ \
&& :

if test "${success}" != "true"; then
critical "Some files are missing licensing information. When this command fails it adds the propper licensing notices to the files that need it, please commit those changes."
fi
&& critical "Some files are missing licensing information. When this command fails it adds the propper licensing notices to the files that need it, please commit those changes."
}

main "${@}"
Loading

0 comments on commit 9ff54bd

Please sign in to comment.