Skip to content

Commit 9fd926b

Browse files
stefanbotezStefan Botez
and
Stefan Botez
authored
Include GitHub action on push and pr (#3)
Co-authored-by: Stefan Botez <[email protected]>
1 parent e44fd26 commit 9fd926b

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: test-on-push-and-pr
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
env:
16+
GITHUB_WORKSPACE: /
17+
- name: Set up python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.8'
21+
- name: Run 'pr' target
22+
run: make pr

test/integration/codebuild-local/codebuild_build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ then
9595
exit 1
9696
fi
9797

98-
docker_command="docker run -it "
98+
docker_command="docker run "
9999
if isOSWindows
100100
then
101101
docker_command+="-v //var/run/docker.sock:/var/run/docker.sock -e "

test/integration/codebuild-local/test_one.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ main() {
3131
RUNTIME_VERSION="$4"
3232
EXTRA_ENV="${5-}"
3333

34-
CODEBUILD_TEMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}"codebuild."$OS_DISTRIBUTION"-"$DISTRO_VERSION"-"$RUNTIME_VERSION".XXXXXXXXXX)
34+
CODEBUILD_TEMP_DIR=$(mktemp -d codebuild."$OS_DISTRIBUTION"-"$DISTRO_VERSION"-"$RUNTIME_VERSION".XXXXXXXXXX)
3535
trap 'rm -rf $CODEBUILD_TEMP_DIR' EXIT
3636

3737
# Create an env file for codebuild_build.

test/test_bootstrap.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,13 @@ def __init__(self, message):
288288
xray_fault["exceptions"][0]["stack"][0]["label"], "raise_exception_handler"
289289
)
290290
self.assertIsInstance(xray_fault["exceptions"][0]["stack"][0]["line"], int)
291-
self.assertEqual(
292-
xray_fault["exceptions"][0]["stack"][0]["path"], os.path.realpath(__file__)
291+
self.assertTrue(
292+
xray_fault["exceptions"][0]["stack"][0]["path"].endswith(
293+
os.path.relpath(__file__)
294+
)
293295
)
294296
self.assertEqual(len(xray_fault["paths"]), 1)
295-
self.assertEqual(xray_fault["paths"][0], os.path.realpath(__file__))
297+
self.assertTrue(xray_fault["paths"][0].endswith(os.path.relpath(__file__)))
296298

297299
def test_handle_event_request_no_module(self):
298300
def unable_to_import_module(json_input, lambda_context):

0 commit comments

Comments
 (0)