-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write a script to run e2e test #237
Open
nprizal
wants to merge
1
commit into
main
Choose a base branch
from
create_script_for_e2e_test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script is used to run bktec against the sample project for the given test runner. | ||
# Sample project can be found in internal/runner/testdata/<test-runner> | ||
# | ||
# Usage: ./bin/e2e <test-runner> <parallel-job> | ||
# | ||
# Note: you need to manually set the following environment variables | ||
# - BUILDKITE_ORGANIZATION_SLUG | ||
# - BUILDKITE_TEST_ENGINE_API_ACCESS_TOKEN | ||
# - BUILDKITE_TEST_ENGINE_SUITE_SLUG | ||
|
||
export BUILDKITE_BUILD_ID=$(uuidgen) | ||
export BUILDKITE_PARALLEL_JOB=${2:-0} | ||
export BUILDKITE_PARALLEL_JOB_COUNT=2 | ||
export BUILDKITE_STEP_ID=$BUILDKITE_TEST_ENGINE_TEST_RUNNER | ||
export BUILDKITE_TEST_ENGINE_RESULT_PATH="${BUILDKITE_TEST_ENGINE_TEST_RUNNER}-result.json" | ||
export BUILDKITE_TEST_ENGINE_TEST_RUNNER=${1:-rspec} | ||
|
||
# Override the following variables to the default value, in case they are set somewhere else | ||
export BUILDKITE_TEST_ENGINE_TEST_CMD="" | ||
export BUILDKITE_TEST_ENGINE_TEST_FILE_PATTERN="" | ||
|
||
# Extra configuration for playwright | ||
if [ "$BUILDKITE_TEST_ENGINE_TEST_RUNNER" == "playwright" ]; then | ||
# We need to tell bktec to use playwright's result path configured in playwright.config.js | ||
export BUILDKITE_TEST_ENGINE_RESULT_PATH="test-results/results.json" | ||
# error.spec.js will prevent other tests from running, so we exclude it | ||
export BUILDKITE_TEST_ENGINE_TEST_FILE_EXCLUDE_PATTERN="**/*/error.spec.js" | ||
fi | ||
|
||
cd ./internal/runner/testdata/$BUILDKITE_TEST_ENGINE_TEST_RUNNER | ||
|
||
go run ../../../../main.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "rspec" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
diff-lcs (1.5.1) | ||
rspec (3.13.0) | ||
rspec-core (~> 3.13.0) | ||
rspec-expectations (~> 3.13.0) | ||
rspec-mocks (~> 3.13.0) | ||
rspec-core (3.13.2) | ||
rspec-support (~> 3.13.0) | ||
rspec-expectations (3.13.3) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.13.0) | ||
rspec-mocks (3.13.2) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.13.0) | ||
rspec-support (3.13.2) | ||
|
||
PLATFORMS | ||
arm64-darwin-23 | ||
ruby | ||
|
||
DEPENDENCIES | ||
rspec | ||
|
||
BUNDLED WITH | ||
2.5.16 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this so we can run
bktec
from this project using the default commandbundle exec rspec ...