diff --git a/ci/start_dev_environment b/ci/start_dev_environment index 30e9249..40e1988 100755 --- a/ci/start_dev_environment +++ b/ci/start_dev_environment @@ -9,7 +9,7 @@ build_test_images start_conjur # Runs the cflinux4 image in interactive mode with the project files mounted -docker-compose \ +docker compose \ -f "$DOCKER_COMPOSE_FILE" \ run --rm \ -e BUILDPACK_BUILD_DIR="/cyberark/cloudfoundry-conjur-buildpack/conjur_buildpack" \ diff --git a/ci/test_e2e b/ci/test_e2e index a91ba35..3fc1f18 100755 --- a/ci/test_e2e +++ b/ci/test_e2e @@ -54,7 +54,7 @@ popd announce 'Running Cucumber tests...' # Run tests against latest build of buildpack (including integration tests against remote foundation) -docker-compose \ +docker compose \ -f "$DOCKER_COMPOSE_FILE" \ run --rm \ -w "$CONTAINER_FEATURES_DIR" \ diff --git a/ci/test_integration b/ci/test_integration index 048e8ce..3334a97 100755 --- a/ci/test_integration +++ b/ci/test_integration @@ -23,7 +23,7 @@ start_conjur [[ -z $JENKINS_HOME ]] && package_and_unpack_buildpack announce 'Running Cucumber tests...' -docker-compose \ +docker compose \ -f "$DOCKER_COMPOSE_FILE" \ run --rm \ -w "$CONTAINER_FEATURES_DIR" \ diff --git a/ci/utils b/ci/utils index 45dba29..4dcab15 100755 --- a/ci/utils +++ b/ci/utils @@ -13,7 +13,7 @@ function announce { function finish { announce 'Removing environment...' - docker-compose -f "$DOCKER_COMPOSE_FILE" down -v + docker compose -f "$DOCKER_COMPOSE_FILE" down -v } function package_and_unpack_buildpack { @@ -36,14 +36,14 @@ function setup_env { function build_test_images { announce 'Building test images...' - docker-compose -f "$DOCKER_COMPOSE_FILE" build + docker compose -f "$DOCKER_COMPOSE_FILE" build } function start_conjur { announce 'Waiting for Conjur to start...' - docker-compose -f "$DOCKER_COMPOSE_FILE" up -d conjur + docker compose -f "$DOCKER_COMPOSE_FILE" up -d conjur - docker-compose -f "$DOCKER_COMPOSE_FILE" exec -T conjur conjurctl wait -r 45 -p 80 + docker compose -f "$DOCKER_COMPOSE_FILE" exec -T conjur conjurctl wait -r 45 -p 80 } diff --git a/conjur-env/docker-compose.yml b/conjur-env/docker-compose.yml index 08d782a..a78b275 100644 --- a/conjur-env/docker-compose.yml +++ b/conjur-env/docker-compose.yml @@ -1,7 +1,7 @@ -version: '2.1' services: conjur-env-builder: - build: "" + build: + context: . environment: - GOOS=linux - GOARCH=amd64 diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index e6e2c43..a81b22f 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -1,4 +1,3 @@ -version: '2' services: tester: build: . diff --git a/tests/integration/apps/ruby/Gemfile b/tests/integration/apps/ruby/Gemfile index d7336e8..8114b04 100644 --- a/tests/integration/apps/ruby/Gemfile +++ b/tests/integration/apps/ruby/Gemfile @@ -5,5 +5,5 @@ ruby '~> 3.2' gem 'conjur-api' gem 'conjur-cli' -gem 'thin' +gem 'puma' gem 'roda' diff --git a/tests/integration/apps/ruby/Gemfile.lock b/tests/integration/apps/ruby/Gemfile.lock index 93938dd..b5c1e2b 100644 --- a/tests/integration/apps/ruby/Gemfile.lock +++ b/tests/integration/apps/ruby/Gemfile.lock @@ -23,11 +23,9 @@ GEM netrc (~> 0.10) table_print (~> 1.5) xdg (= 2.2.3) - daemons (1.4.1) deep_merge (1.2.2) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - eventmachine (1.2.7) gli (2.21.0) highline (2.1.0) http-accept (1.7.0) @@ -40,7 +38,10 @@ GEM mime-types-data (3.2023.0218.1) minitest (5.18.0) netrc (0.11.0) + nio4r (2.7.0) public_suffix (5.0.1) + puma (6.4.0) + nio4r (~> 2.0) rack (3.0.1) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) @@ -50,10 +51,6 @@ GEM roda (3.68.0) rack table_print (1.5.7) - thin (1.8.2) - daemons (~> 1.0, >= 1.0.9) - eventmachine (~> 1.0, >= 1.0.4) - rack (>= 1, < 3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unf (0.1.4) @@ -68,8 +65,8 @@ PLATFORMS DEPENDENCIES conjur-api conjur-cli + puma roda - thin RUBY VERSION ruby 3.2.2p53 diff --git a/tests/integration/apps/ruby/Procfile b/tests/integration/apps/ruby/Procfile new file mode 100644 index 0000000..5d48018 --- /dev/null +++ b/tests/integration/apps/ruby/Procfile @@ -0,0 +1 @@ +web: bundle exec puma -b tcp://0.0.0.0:8080 \ No newline at end of file diff --git a/tests/integration/features/integration.feature b/tests/integration/features/integration.feature index e7b504d..8f44b1e 100644 --- a/tests/integration/features/integration.feature +++ b/tests/integration/features/integration.feature @@ -26,8 +26,8 @@ Feature: Integrations Tests for remote TAS foundation When I push a "java" app with the "offline" buildpack Then the secrets.yml values are available in the app -# # The online buildpack tests are only valid if the latest commits -# # are push to the Github remote branch. + # The online buildpack tests are only valid if the latest commits + # are push to the Github remote branch. Scenario: Python online buildpack integration When I push a "python" app with the "online" buildpack Then the secrets.yml values are available in the app diff --git a/tests/integration/features/step_definitions/integration_steps.rb b/tests/integration/features/step_definitions/integration_steps.rb index 4358880..538a2df 100644 --- a/tests/integration/features/step_definitions/integration_steps.rb +++ b/tests/integration/features/step_definitions/integration_steps.rb @@ -24,7 +24,7 @@ else create_offline_app_manifest end - ShellSession.execute("cf push #{@app_name} --random-route") + ShellSession.execute("cf push #{@app_name} --random-route; cf logs #{@app_name} --recent") end end diff --git a/tests/retrieve-secrets/README.md b/tests/retrieve-secrets/README.md index 03be222..706caf2 100644 --- a/tests/retrieve-secrets/README.md +++ b/tests/retrieve-secrets/README.md @@ -49,7 +49,7 @@ environment, then assert upon the output. BATS offers the `$output` variable, w contains the output from the previous command executed using the `run` prefix. ### `stop` -Removes existing docker-compose containers +Removes existing Docker Compose environment ### Configuration diff --git a/tests/retrieve-secrets/docker-compose.yml b/tests/retrieve-secrets/docker-compose.yml index cef7d8b..d236183 100644 --- a/tests/retrieve-secrets/docker-compose.yml +++ b/tests/retrieve-secrets/docker-compose.yml @@ -1,7 +1,7 @@ -version: '2.1' services: mock-conjur-env-builder: - build: "" + build: + context: . volumes: - .:/mock-conjur-env - ../../tmp/vendor:/pkg diff --git a/tests/retrieve-secrets/start b/tests/retrieve-secrets/start index b25ef94..f9e16b1 100755 --- a/tests/retrieve-secrets/start +++ b/tests/retrieve-secrets/start @@ -10,13 +10,13 @@ mkdir -p temp_clone_dir git clone https://github.com/ztombol/bats-support temp_clone_dir/bats-support git clone https://github.com/ztombol/bats-assert temp_clone_dir/bats-assert -docker-compose build -docker-compose run --rm mock-conjur-env-builder +docker compose build +docker compose run --rm mock-conjur-env-builder echo "Starting tests for 0001_retrieve-secrets.sh..." # Uncomment when running locally -# docker-compose run --rm tester --formatter tap ./test +# docker compose run --rm tester --formatter tap ./test # Comment out when running locally -docker-compose run --rm tester --formatter junit ./test +docker compose run --rm tester --formatter junit ./test diff --git a/tests/retrieve-secrets/stop b/tests/retrieve-secrets/stop index 9cc9f94..356cea7 100755 --- a/tests/retrieve-secrets/stop +++ b/tests/retrieve-secrets/stop @@ -4,7 +4,7 @@ function finish { echo 'Removing environment...' rm -rf temp_clone_dir - docker-compose down -v + docker compose down -v } finish