Skip to content

Commit 735f9ad

Browse files
committed
Fix build issues and add instructions to run locally
1 parent 1c1943f commit 735f9ad

File tree

5 files changed

+38
-28
lines changed

5 files changed

+38
-28
lines changed

contract-tests/README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ Pre-requirements:
3737
From `aws-otel-python-instrumentation/contract-tests` execute:
3838

3939
```
40-
./create-images.sh
41-
mkdir dist
42-
cd images/mock-collector
43-
python3 -m build --outdir ../../dist
44-
pip wheel --no-deps mock_collector-1.0.0.tar.gz
45-
pip install mock_collector-1.0.0-py3-none-any.whl --force-reinstall
46-
<TODO>
40+
./set-up-contract-tests.sh
41+
pytest tests
4742
```

contract-tests/create_images.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

contract-tests/images/mock-collector/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies = [
1818
]
1919

2020
[tool.hatch.build.targets.sdist]
21-
include = ["/src"]
21+
include = ["*.py"]
2222

2323
[tool.hatch.build.targets.wheel]
24-
packages = ["src/amazon"]
24+
include = ["*.py"]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cd images/mock-collector
2+
docker build . -t aws-appsignals-mock-collector-python
3+
cd ..
4+
5+
cd applications
6+
for dir in */
7+
do
8+
cd $dir
9+
docker build . -t aws-appsignals-tests-${dir%/}-app
10+
cd ..
11+
done
12+
13+
cd ../..
14+
15+
mkdir dist
16+
rm -rf dist/*
17+
cd images/mock-collector
18+
python3 -m build --outdir ../../dist --no-isolation
19+
cd ../../dist
20+
pip wheel --no-deps mock_collector-1.0.0.tar.gz
21+
pip install mock_collector-1.0.0-py3-none-any.whl --force-reinstall
22+
23+
cd ../tests
24+
python3 -m build --outdir ../dist --no-isolation
25+
cd ../dist
26+
pip wheel --no-deps contract_tests-1.0.0.tar.gz
27+
# --force-reinstall causes `ERROR: No matching distribution found for mock-collector==1.0.0`, but uninstalling and reinstalling works pretty reliably.
28+
pip uninstall contract-tests -y
29+
pip install contract_tests-1.0.0-py3-none-any.whl
30+
31+
cd ..

contract-tests/tests/pyproject.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "contract-tests"
77
description = "Contract tests for AWS OTEL Python Instrumentation"
88
version = "1.0.0"
99
license = "Apache-2.0"
10-
requires-python = ">=3.8
10+
requires-python = ">=3.8"
1111

1212
dependencies = [
1313
"opentelemetry-proto==1.22.0",
@@ -22,10 +22,7 @@ dependencies = [
2222
test = []
2323

2424
[tool.hatch.build.targets.sdist]
25-
include = [
26-
"/src",
27-
"/tests",
28-
]
25+
include = ["/test"]
2926

3027
[tool.hatch.build.targets.wheel]
31-
packages = ["src/amazon"]
28+
packages = ["test/amazon"]

0 commit comments

Comments
 (0)