Skip to content

Commit

Permalink
Add Unix Stream codec, Split flow from FDK, update integration tests (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
zootalures authored Sep 19, 2018
1 parent dad6469 commit 0b7d2e6
Show file tree
Hide file tree
Showing 217 changed files with 6,310 additions and 3,723 deletions.
98 changes: 26 additions & 72 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@ version: 2
jobs:
build:
working_directory: ~/fn-java-fdk
machine:
java:
version: oraclejdk8
machine: true
environment:
# store_artifacts doesn't shell substitute so the variable
# definitions are duplicated in those steps too.
FDK_ARTIFACT_DIR: /tmp/artifacts/fdk
TEST_ARTIFACT_DIR: /tmp/artifacts/tests
STAGING_DIR: /tmp/staging-repository
REPOSITORY_LOCATION: /tmp/staging_repo
steps:
- checkout
- run:
name: Update Docker to latest
command: ./.circleci/install-docker.sh
- run:
name: Install fn binary (as it is needed for the integration tests)
command: ./.circleci/install-fn.sh
- run:
name: Install junit-merge
command: npm install -g junit-merge
- run:
name: Set release to latest branch version
command: |
Expand All @@ -22,83 +29,22 @@ jobs:
name: Determine the release version
command: ./.circleci/update-versions.sh
- run:
name: Build and deploy locally
name: Build and Test FDK
command: |
rm -rf $STAGING_DIR
mkdir -p $STAGING_DIR
mvn deploy -DaltDeploymentRepository=localStagingDir::default::file://"$STAGING_DIR"
- store_test_results:
path: runtime/target/surefire-reports
- store_test_results:
path: testing/target/surefire-reports

export FN_FDK_VERSION=$(cat ./release.version)
./build.sh
- run:
name: Copy FDK artifacts to upload folder
name: Run integration tests
command: |
mkdir -p "$FDK_ARTIFACT_DIR"
cp -a api/target/*.jar "$FDK_ARTIFACT_DIR"
cp -a runtime/target/*.jar "$FDK_ARTIFACT_DIR"
- store_artifacts:
name: Upload FDK artifacts
path: /tmp/artifacts/fdk

- run:
name: Update Docker to latest
command: ./.circleci/install-docker.sh

export FN_JAVA_FDK_VERSION=$(cat release.version)
./integration-tests/run_tests_ci.sh
timeout: 1200
- run:
name: Login to Docker
command: |
if [[ "${CIRCLE_BRANCH}" == "master" && -z "${CIRCLE_PR_REPONAME}" ]]; then
docker login -u $DOCKER_USER -p $DOCKER_PASS
fi
- run:
name: Build fn-java-fdk Docker build image
command: |
cd build-image
./docker-build.sh -t fnproject/fn-java-fdk-build:$(cat ../release.version) .
- run:
name: Build fn-java-fdk-jdk9 Docker build image
command: |
cd build-image
./docker-build.sh -f Dockerfile-jdk9 -t fnproject/fn-java-fdk-build:jdk9-$(cat ../release.version) .
- run:
name: Build fn-java-fdk Docker runtime image
command: |
cd runtime
docker build -t fnproject/fn-java-fdk:$(cat ../release.version) .
- run:
name: Build fn-java-fdk-jdk9 Docker runtime image
command: |
cd runtime
docker build -f Dockerfile-jdk9 -t fnproject/fn-java-fdk:jdk9-$(cat ../release.version) .
- run:
name: Install fn binary (as it is needed for the integration tests)
command: ./.circleci/install-fn.sh

- run:
name: Run integration tests
command: REPOSITORY_LOCATION="$STAGING_DIR" FN_JAVA_FDK_VERSION=$(cat release.version) ./integration-tests/run-local.sh
timeout: 1200

- run:
name: Copy integration test results to test artifact dir
command: |
mkdir -p "$TEST_ARTIFACT_DIR"
for test_dir in ./integration-tests/main/test-*; do
test_name="$(basename "$test_dir")"
mkdir "${TEST_ARTIFACT_DIR}/${test_name}"
cp -a $(find "$test_dir" -maxdepth 1 -type f) "${TEST_ARTIFACT_DIR}/${test_name}"
done
find "${TEST_ARTIFACT_DIR}"
when: always
- store_artifacts:
name: Upload integration test results to artifacts
path: /tmp/artifacts/tests
- deploy:
name: Release new version
command: |
Expand All @@ -108,4 +54,12 @@ jobs:
git branch --set-upstream-to=origin/${CIRCLE_BRANCH} ${CIRCLE_BRANCH}
./.circleci/release.sh
fi
- run:
name: Gather test results
when: always
command: |
junit-merge $(find . -wholename "*/target/surefire-reports/*.xml") --createDir -o test_results/merged_results.xml
- store_test_results:
when: always
path: test_results

32 changes: 0 additions & 32 deletions .circleci/install-go.sh

This file was deleted.

7 changes: 6 additions & 1 deletion .circleci/update-versions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash
#
# this is instead for the maven release plugin (which sucks) - this sets the versions across the project before a build
# for branch builds these are ignored (nothing is deployed)
# For master releases this sets the latest version that this branch would be released as
#

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

12 changes: 12 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@

<artifactId>api</artifactId>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
Expand Down
Loading

0 comments on commit 0b7d2e6

Please sign in to comment.