Skip to content

Commit 0b7d2e6

Browse files
authored
Add Unix Stream codec, Split flow from FDK, update integration tests (#150)
* http input codec * add jetty-core and UDS deps * PoC jetty core UDS event codec * revise FDK contract for initial relase, split flow from fn, support new unix domain socket contract * First pass of refactor * added annotations for for features to support flow * moving flow feature to runtime package * rename flow testing and add docs, fix race in Stream testing * fixing failing tests * Update to reflect FN_ID * more integration test fixing * fix up format name * first stab at home-grown UDS implementation * docker build fix * UDS rework, remove old UDS dep and test new one * adjust permissions on file on start * new integration tests * simlify build and integration tests, add tests for http-stream * fix ci * typo * make igntests standalone * itests run 1.8 * fix itest result * env for itests * add createDir * test failures in circle * fix test interference * Use standard properties in fdk tests, fix versions in itests * hmm no entropy on circle boxes :) * use consistent properties for versions everywhere * add waits for start * this time with feeling * diagnosing timeout * close input, try more aggressive testing * C errors * fixing up accept and twiddling with integration test start * set DOCKER_LOCALHOST * integration test fixing/finessing * cludge docker localhost * no_proxy messing * set fnserver IP correctly * typo * nits in C code * review nits * more C fix nits * Make mandatory headers mandatory again * minus comment * remove Content-Length from stripped input * fix call test
1 parent dad6469 commit 0b7d2e6

File tree

217 files changed

+6310
-3723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+6310
-3723
lines changed

.circleci/config.yml

Lines changed: 26 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,24 @@ version: 2
22
jobs:
33
build:
44
working_directory: ~/fn-java-fdk
5-
machine:
6-
java:
7-
version: oraclejdk8
5+
machine: true
86
environment:
97
# store_artifacts doesn't shell substitute so the variable
108
# definitions are duplicated in those steps too.
119
FDK_ARTIFACT_DIR: /tmp/artifacts/fdk
1210
TEST_ARTIFACT_DIR: /tmp/artifacts/tests
13-
STAGING_DIR: /tmp/staging-repository
11+
REPOSITORY_LOCATION: /tmp/staging_repo
1412
steps:
1513
- checkout
14+
- run:
15+
name: Update Docker to latest
16+
command: ./.circleci/install-docker.sh
17+
- run:
18+
name: Install fn binary (as it is needed for the integration tests)
19+
command: ./.circleci/install-fn.sh
20+
- run:
21+
name: Install junit-merge
22+
command: npm install -g junit-merge
1623
- run:
1724
name: Set release to latest branch version
1825
command: |
@@ -22,83 +29,22 @@ jobs:
2229
name: Determine the release version
2330
command: ./.circleci/update-versions.sh
2431
- run:
25-
name: Build and deploy locally
32+
name: Build and Test FDK
2633
command: |
27-
rm -rf $STAGING_DIR
28-
mkdir -p $STAGING_DIR
29-
mvn deploy -DaltDeploymentRepository=localStagingDir::default::file://"$STAGING_DIR"
30-
- store_test_results:
31-
path: runtime/target/surefire-reports
32-
- store_test_results:
33-
path: testing/target/surefire-reports
34-
34+
export FN_FDK_VERSION=$(cat ./release.version)
35+
./build.sh
3536
- run:
36-
name: Copy FDK artifacts to upload folder
37+
name: Run integration tests
3738
command: |
38-
mkdir -p "$FDK_ARTIFACT_DIR"
39-
cp -a api/target/*.jar "$FDK_ARTIFACT_DIR"
40-
cp -a runtime/target/*.jar "$FDK_ARTIFACT_DIR"
41-
- store_artifacts:
42-
name: Upload FDK artifacts
43-
path: /tmp/artifacts/fdk
44-
45-
- run:
46-
name: Update Docker to latest
47-
command: ./.circleci/install-docker.sh
48-
39+
export FN_JAVA_FDK_VERSION=$(cat release.version)
40+
./integration-tests/run_tests_ci.sh
41+
timeout: 1200
4942
- run:
5043
name: Login to Docker
5144
command: |
5245
if [[ "${CIRCLE_BRANCH}" == "master" && -z "${CIRCLE_PR_REPONAME}" ]]; then
5346
docker login -u $DOCKER_USER -p $DOCKER_PASS
5447
fi
55-
56-
- run:
57-
name: Build fn-java-fdk Docker build image
58-
command: |
59-
cd build-image
60-
./docker-build.sh -t fnproject/fn-java-fdk-build:$(cat ../release.version) .
61-
62-
- run:
63-
name: Build fn-java-fdk-jdk9 Docker build image
64-
command: |
65-
cd build-image
66-
./docker-build.sh -f Dockerfile-jdk9 -t fnproject/fn-java-fdk-build:jdk9-$(cat ../release.version) .
67-
- run:
68-
name: Build fn-java-fdk Docker runtime image
69-
command: |
70-
cd runtime
71-
docker build -t fnproject/fn-java-fdk:$(cat ../release.version) .
72-
73-
- run:
74-
name: Build fn-java-fdk-jdk9 Docker runtime image
75-
command: |
76-
cd runtime
77-
docker build -f Dockerfile-jdk9 -t fnproject/fn-java-fdk:jdk9-$(cat ../release.version) .
78-
79-
- run:
80-
name: Install fn binary (as it is needed for the integration tests)
81-
command: ./.circleci/install-fn.sh
82-
83-
- run:
84-
name: Run integration tests
85-
command: REPOSITORY_LOCATION="$STAGING_DIR" FN_JAVA_FDK_VERSION=$(cat release.version) ./integration-tests/run-local.sh
86-
timeout: 1200
87-
88-
- run:
89-
name: Copy integration test results to test artifact dir
90-
command: |
91-
mkdir -p "$TEST_ARTIFACT_DIR"
92-
for test_dir in ./integration-tests/main/test-*; do
93-
test_name="$(basename "$test_dir")"
94-
mkdir "${TEST_ARTIFACT_DIR}/${test_name}"
95-
cp -a $(find "$test_dir" -maxdepth 1 -type f) "${TEST_ARTIFACT_DIR}/${test_name}"
96-
done
97-
find "${TEST_ARTIFACT_DIR}"
98-
when: always
99-
- store_artifacts:
100-
name: Upload integration test results to artifacts
101-
path: /tmp/artifacts/tests
10248
- deploy:
10349
name: Release new version
10450
command: |
@@ -108,4 +54,12 @@ jobs:
10854
git branch --set-upstream-to=origin/${CIRCLE_BRANCH} ${CIRCLE_BRANCH}
10955
./.circleci/release.sh
11056
fi
57+
- run:
58+
name: Gather test results
59+
when: always
60+
command: |
61+
junit-merge $(find . -wholename "*/target/surefire-reports/*.xml") --createDir -o test_results/merged_results.xml
62+
- store_test_results:
63+
when: always
64+
path: test_results
11165

.circleci/install-go.sh

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

.circleci/update-versions.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#!/bin/bash
2+
#
3+
# this is instead for the maven release plugin (which sucks) - this sets the versions across the project before a build
4+
# for branch builds these are ignored (nothing is deployed)
5+
# For master releases this sets the latest version that this branch would be released as
6+
#
27

38
release_version=$(cat release.version)
49
if [[ $release_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then
@@ -14,6 +19,6 @@ mvn versions:set -D newVersion=${release_version} versions:update-child-modules
1419
# We need to replace the example dependency versions also
1520
# (sed syntax for portability between MacOS and gnu)
1621
find . -name pom.xml |
17-
xargs -n 1 sed -i.bak -e "s|<fnproject\\.version>.*</fnproject\\.version>|<fnproject.version>${release_version}</fnproject.version>|"
22+
xargs -n 1 sed -i.bak -e "s|<fdk\\.version>.*</fdk\\.version>|<fdk.version>${release_version}</fdk.version>|"
1823
find . -name pom.xml.bak -delete
1924

api/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@
1111

1212
<artifactId>api</artifactId>
1313

14+
<dependencies>
15+
<dependency>
16+
<groupId>junit</groupId>
17+
<artifactId>junit</artifactId>
18+
<scope>test</scope>
19+
</dependency>
20+
<dependency>
21+
<groupId>org.assertj</groupId>
22+
<artifactId>assertj-core</artifactId>
23+
<scope>test</scope>
24+
</dependency>
25+
</dependencies>
1426
<build>
1527
<plugins>
1628
<plugin>

0 commit comments

Comments
 (0)