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
Run crates.io inside Travis (without Docker) #1825
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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,42 @@ | ||
#! /bin/bash | ||
set -euo pipefail | ||
|
||
./script/init-local-index.sh | ||
|
||
# The below are required environment variables | ||
export SESSION_KEY=badkeyabcdefghijklmnopqrstuvwxyzabcdef | ||
export GIT_REPO_CHECKOUT=./tmp/index-co | ||
export GIT_REPO_URL=file://./tmp/index-bare | ||
export GH_CLIENT_ID= | ||
export GH_CLIENT_SECRET= | ||
|
||
./target/debug/server > backend.log & | ||
npm run start -- --proxy http://localhost:8888 > frontend.log & | ||
|
||
for i in $(seq 1 10) | ||
do | ||
set +e | ||
curl -H 'Accept: text/html' http://localhost:4200 | ||
case $? in | ||
0) | ||
break | ||
;; | ||
7) | ||
# Connection refused | ||
sleep 10 | ||
;; | ||
56) | ||
# Connection reset by peer | ||
sleep 10 | ||
;; | ||
*) | ||
exit $? | ||
esac | ||
set -e | ||
done | ||
|
||
echo FRONTEND | ||
cat frontend.log | ||
|
||
echo BACKEND | ||
cat backend.log |
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.
Even though we have
cache.cargo: true
above, it looks like this job isn't actually caching any of our Rust build artifacts. I recently realized that travis seems to use different VM images depending on the selected language type. It seems like other behavior, like caching here, must also be dependent on the language type.This brings me to a general thought. We previously run the frontend tests within our
rust: stable
job. It seems like it might be cleaner to combine these back into a single job and run any integration tests there as well. That would reduce the duplication of running the split jobs and duplicating the build work from both of those in this integration job. The downside is that I'm starting to see that Travis doesn't really seem to be set up to gracefully handle multiple languages/frameworks within the same job.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 personally prefer the separation. We tend to have either JavaScript-only or Rust-only PRs. The separation helps developers understand what's not working - and which test failures are false-positives.
Between stages, Travis doesn't share any files. Can't we have a S3 bucket to keep intermediate artifacts?
https://docs.travis-ci.com/user/build-stages/#data-persistence-between-stages-and-jobs
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 don't have access to create an S3 bucket for intermediate artifacts, but I've added it to the agenda at rust-lang/crates-io-cargo-teams#60 to discuss at the next team meeting.