Skip to content
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

Remove 'travis*' prefix #3176

Merged
merged 30 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
611756f
Remove travis from .circleci/config.yml
vkatsuba Jul 8, 2021
5b1f5b6
Remove travis from .github/workflows/ci.yml
vkatsuba Jul 8, 2021
d25d317
Remove travis from big_tests/run_common_test.erl
vkatsuba Jul 8, 2021
5568e88
Remove travis from CONTRIBUTING.md
vkatsuba Jul 8, 2021
79c2722
Remove travis from doc/advanced-configuration/database-backends-confi…
vkatsuba Jul 8, 2021
cdc2a69
Remove travis from doc/developers-guide/Testing-MongooseIM.md
vkatsuba Jul 8, 2021
5abde6b
Remove travis from doc/user-guide/Bootstrap-Scripts.md
vkatsuba Jul 8, 2021
5e0822a
Remove travis from doc/user-guide/release_config.md
vkatsuba Jul 8, 2021
7e274b7
Remove travis from src/gen_mod.erl
vkatsuba Jul 8, 2021
5a953e2
Remove travis from tools/cache-build.sh
vkatsuba Jul 8, 2021
6068bbe
Remove travis from tools/cache-certs.sh
vkatsuba Jul 8, 2021
e598a79
Remove travis from tools/cache-tests.sh
vkatsuba Jul 8, 2021
9d5487d
Remove travis from tools/setup-mssql-database.sh
vkatsuba Jul 8, 2021
cf433f9
Remove travis from tools/setup-redis.sh
vkatsuba Jul 8, 2021
98d09ea
Remove travis from tools/start-nodes.sh
vkatsuba Jul 8, 2021
4901623
Remove travis from tools/stop-nodes.sh
vkatsuba Jul 8, 2021
2cef079
Remove travis from tools/test-runner.sh
vkatsuba Jul 8, 2021
a1a8bdc
Remove travis from tools/travis-build-tests.sh
vkatsuba Jul 8, 2021
05da4df
Remove travis from tools/travis-check-tests-branch.sh
vkatsuba Jul 8, 2021
2885c9f
Remove travis from tools/travis-helpers.sh
vkatsuba Jul 8, 2021
d623629
Remove travis from tools/travis-prepare-log-dir.sh
vkatsuba Jul 8, 2021
c3b6732
Remove travis from tools/travis-publish-github-comment.sh
vkatsuba Jul 8, 2021
da37858
Remove travis from tools/travis-pull-db.sh
vkatsuba Jul 8, 2021
f3779dd
Remove travis from tools/travis-setup-db.sh
vkatsuba Jul 8, 2021
2687d38
Remove travis from tools/travis-setup-ldap.sh
vkatsuba Jul 8, 2021
ac8c3b5
Remove travis from tools/travis-setup-rmq.sh
vkatsuba Jul 8, 2021
a439b08
Remove travis from tools/travis-test.sh
vkatsuba Jul 8, 2021
7ff8bc5
Remove travis from tools/travis-upload-to-gdrive.sh
vkatsuba Jul 8, 2021
067f169
Remove travis from tools/travis-upload-to-s3.sh
vkatsuba Jul 8, 2021
9ee015a
Remove travis from all file names
vkatsuba Jul 8, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ orbs:
- run:
name: Build Big Tests
command: |
tools/travis-build-tests.sh
tools/build-tests.sh
- save_cache:
key: build-cache-{{ .Branch }}-{{ .Revision }}--{{ checksum "otp_version" }}
paths: ./
Expand All @@ -108,7 +108,7 @@ orbs:
- run:
name: Run Dialyzer
command: |
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./tools/travis-test.sh -p dialyzer_only -s false
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./tools/test.sh -p dialyzer_only -s false

small_tests:
parallelism: 1
Expand Down Expand Up @@ -139,7 +139,7 @@ orbs:
- run:
name: Run Small Tests
command: |
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./tools/travis-test.sh -p small_tests -s true -e true
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./tools/test.sh -p small_tests -s true -e true
- run:
name: Coverage
when: on_success
Expand Down Expand Up @@ -182,7 +182,7 @@ orbs:
- run:
name: Build package
command: |
KEEP_COVER_RUNNING=1 ./tools/travis-test.sh -p pkg -s false
KEEP_COVER_RUNNING=1 ./tools/test.sh -p pkg -s false

big_tests:
parallelism: 1
Expand Down Expand Up @@ -238,14 +238,14 @@ orbs:
- run:
name: Setup database
command: |
tools/travis-setup-db.sh
if [ $PRESET = ldap_mnesia ]; then sudo tools/travis-setup-ldap.sh; fi
sudo tools/travis-setup-rmq.sh; tools/setup-redis.sh
tools/setup-db.sh
if [ $PRESET = ldap_mnesia ]; then sudo tools/setup-ldap.sh; fi
sudo tools/setup-rmq.sh; tools/setup-redis.sh
echo '127.0.0.1 muc.localhost' | sudo tee -a /etc/hosts
- run:
name: Run Big Tests
command: |
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./tools/travis-test.sh -p $PRESET -s false
SKIP_AUTO_COMPILE=true KEEP_COVER_RUNNING=1 ./tools/test.sh -p $PRESET -s false
no_output_timeout: 40m
- run:
name: Coverage
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: create certificates
run: make certs
- name: run test
run: tools/travis-test.sh -p $PRESET -s true -e true
run: tools/test.sh -p $PRESET -s true -e true
- name: prepare coverage report
run: ./rebar3 codecov analyze --lcov --json false
- name: report coverage
Expand Down Expand Up @@ -71,11 +71,11 @@ jobs:
- name: build releases
run: tools/build-releases.sh
- name: build big tests
run: tools/travis-build-tests.sh
run: tools/build-tests.sh
- name: start backends
run: tools/travis-setup-db.sh
run: tools/setup-db.sh
- name: run test
run: tools/travis-test.sh -p $PRESET -s false -e false
run: tools/test.sh -p $PRESET -s false -e false
- name: prepare coverage report
run: ./rebar3 codecov analyze --lcov --json false
- name: report coverage
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
- uses: ErlGang/setup-erlang@v1.0.0
with:
otp-version: ${{matrix.otp}}
- run: tools/travis-test.sh -p dialyzer_only
- run: tools/test.sh -p dialyzer_only

pkg:
name: ${{matrix.pkg}} package
Expand All @@ -120,4 +120,4 @@ jobs:
pkg_PLATFORM: ${{matrix.pkg}}
steps:
- uses: actions/checkout@v2
- run: tools/travis-test.sh -p pkg
- run: tools/test.sh -p pkg
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Fix all issues Elvis reports, otherwise your build will fail.
### Push

Then push the changes and create a pull request to master, following the PR description template.
Make sure all Travis tests pass (if only some jobs fail it is advisable to restart them, since they sometimes
Make sure all GitHub Actions tests pass (if only some jobs fail it is advisable to restart them, since they sometimes
fail at random).

If tests fail, see why here: http://mongooseim-ct-results.s3-website-eu-west-1.amazonaws.com/ and resolve any issues.
Expand Down
22 changes: 11 additions & 11 deletions big_tests/run_common_test.erl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
%% During dev you would use something similar to:
%% TEST_HOSTS="mim" ./tools/travis-test.sh -c false -s false -p odbc_mssql_mnesia
%% TEST_HOSTS="mim" ./tools/test.sh -c false -s false -p odbc_mssql_mnesia
%%
%% If you also want to start just mim1 node use:
%% DEV_NODES="mim1" TEST_HOSTS="mim" ./tools/travis-test.sh -c false -s false -p odbc_mssql_mnesia
%% DEV_NODES="mim1" TEST_HOSTS="mim" ./tools/test.sh -c false -s false -p odbc_mssql_mnesia
%%
%% TEST_HOSTS variable contains host names from hosts in big_tests/test.config.
%% DEV_NODES variable contains release names from profiles in rebar.config.
Expand All @@ -12,7 +12,7 @@
%% Valid DEV_NODES are mim1, mim2, mim3, fed1, reg1.
%%
%% Example with two nodes:
%% DEV_NODES="mim1 mim2" TEST_HOSTS="mim mim2" ./tools/travis-test.sh -c false -s false -p odbc_mssql_mnesia
%% DEV_NODES="mim1 mim2" TEST_HOSTS="mim mim2" ./tools/test.sh -c false -s false -p odbc_mssql_mnesia
%%
%% Environment variable PRESET_ENABLED is true by default.
%% PRESET_ENABLED=false disables preset application and forces to run
Expand Down Expand Up @@ -254,7 +254,7 @@ enable_preset(Props, Name, PresetVars, N, Tests) ->
[N, Tests, Name]).

%% Specify just some nodes to run the tests on:
%% TEST_HOSTS="mim" ./tools/travis-test.sh -p odbc_mssql_mnesia
%% TEST_HOSTS="mim" ./tools/test.sh -p odbc_mssql_mnesia
maybe_enable_preset_on_node(Node, PresetVars, HostVars, HostName) ->
case is_test_host_enabled(HostName) of
true ->
Expand Down Expand Up @@ -356,7 +356,7 @@ maybe_compile_cover(Nodes) ->
NotOk = Results -- Ok,
#{ok => length(Ok), failed => NotOk}
end),
travis_fold("cover compiled output", fun() ->
github_actions_fold("cover compiled output", fun() ->
io:format("cover: compiled ~p~n", [Compiled])
end),
report_progress("~nCover compilation took ~ts~n", [microseconds_to_string(Time)]),
Expand All @@ -380,7 +380,7 @@ analyze(_Props, CoverOpts, Nodes) ->
report_time("Export merged cover data", fun() ->
cover:export("/tmp/mongoose_combined.coverdata")
end),
case os:getenv("TRAVIS_JOB_ID") of
case os:getenv("GITHUB_RUN_ID") of
false ->
make_html(modules_to_analyze(CoverOpts));
_ ->
Expand Down Expand Up @@ -568,19 +568,19 @@ microseconds_to_string(Microseconds) ->
SecondsFloat = Milliseconds / 1000,
io_lib:format("~.3f seconds", [SecondsFloat]).

%% Writes onto travis console directly
%% Writes onto GitHub actions console directly
report_progress(Format, Args) ->
Message = io_lib:format(Format, Args),
file:write_file("/tmp/progress", Message, [append]).

travis_fold(Description, Fun) ->
case os:getenv("TRAVIS_JOB_ID") of
github_actions_fold(Description, Fun) ->
case os:getenv("GITHUB_RUN_ID") of
false ->
Fun();
_ ->
io:format("travis_fold:start:~ts~n", [Description]),
io:format("github_actions_fold:start:~ts~n", [Description]),
Result = Fun(),
io:format("travis_fold:end:~ts~n", [Description]),
io:format("github_actions_fold:end:~ts~n", [Description]),
Result
end.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
MongooseIM can work with several databases, both RDBMS (SQL) and NOSQL ones.
Some of them require extra work before they can be used.
For example the SQL databases require defining a schema.
MongooseIM is tested with TravisCI, so the travis scripts can be used as a reference.
MongooseIM is tested with CI, so the CI scripts can be used as a reference.

## A Brief Overview

Expand Down
8 changes: 4 additions & 4 deletions doc/developers-guide/Testing-MongooseIM.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ $ sudo yum install freetds
$ brew install freetds
```

In case you are using an operating system different from Ubuntu or MacOS or have a custom FreeTDS installation,
you may have to modify the `tools/travis-setup-db.sh` script to use the proper paths.
In case you are using an operating system different from Ubuntu or MacOS or have a custom FreeTDS installation,
you may have to modify the `tools/setup-db.sh` script to use the proper paths.
Find a configuration block starting with `[mongoose-mssql]` and change the `Driver` and `Setup`.
For example, for CentOS change them to `/usr/lib64/libtdsodbc.so.0` and `/usr/lib64/libtdsS.so` respectively.

Expand Down Expand Up @@ -370,11 +370,11 @@ There are many more options available.
One of them is sequentially testing a number of preset configurations - we do it every day on CircleCI, testing MongooseIM with various OTP versions and database backends.
Altogether, we have eight preset configuration.

If you want to dig deeper, consult `.circleci/config.yml`, `.github/workflows/ci.yml` and `tools/travis-test.sh`, everything we do is there.
If you want to dig deeper, consult `.circleci/config.yml`, `.github/workflows/ci.yml` and `tools/test.sh`, everything we do is there.

#### Gathering test reports from tests

If you test your MongooseIM fork on Travis or other CI provider, you might want to access test reports (which also include node logs and crash dumps) that are created by the test runner.
If you test your MongooseIM fork on GitHub Actions or other CI provider, you might want to access test reports (which also include node logs and crash dumps) that are created by the test runner.

##### Uploading reports to S3

Expand Down
2 changes: 1 addition & 1 deletion doc/user-guide/Bootstrap-Scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ tools/pkg/scripts/smoke_templates.escript
Testing command:

```bash
PRESET=pkg pkg_PLATFORM=centos_7 ESL_ERLANG_PKG_VER=22.1.8-2 ./tools/travis-test.sh
PRESET=pkg pkg_PLATFORM=centos_7 ESL_ERLANG_PKG_VER=22.1.8-2 ./tools/test.sh
```
2 changes: 1 addition & 1 deletion doc/user-guide/release_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
It's now possible to install MongooseIM from source in two modes:

* `system` - it's used internally to generate Linux packages (.deb, .rpm)
* `user` - which is the default mode and used for testing on travis and
* `user` - which is the default mode and used for testing on GitHub Actions and
in development

You can also build OS specific packages by using the tools in `[MongooseIM repo root]/tools/pkg` - refer to `README.md` therein.
Expand Down
4 changes: 2 additions & 2 deletions src/gen_mod.erl
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ start_module_for_host_type(HostType, Module, Opts0) ->
false ->
%% TODO: grepping for "fail_ci_build=true" is bad option
%% for ci testing, rework this.
TravisInfo = "fail_ci_build=true ",
CIInfo = "fail_ci_build=true ",
%% Note for programmers:
%% Never call start_link directly from your_module:start/2 function!
%% The process will be killed if we start modules remotely or in shell
?LOG_ERROR(#{what => unexpected_links, travis_info => TravisInfo,
?LOG_ERROR(#{what => unexpected_links, ci_info => CIInfo,
links_before => LinksBefore, links_after => LinksAfter})
end,
?LOG_DEBUG(#{what => module_started, module => Module, host_type => HostType}),
Expand Down
5 changes: 2 additions & 3 deletions tools/travis-build-tests.sh → tools/build-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
# Env variables:
# BUILD_TESTS - disable the script

source tools/travis-common-vars.sh
source tools/common-vars.sh

# rebar doesn't like Unicode in commit messages #1674
# So, we unset commit message env variable
# TODO: Remove it when we switch to rebar3 for big tests.
export TRAVIS_COMMIT_MESSAGE=no_message
export CI_COMMIT_MESSAGE=no_message

if [ "$BUILD_TESTS" != "false" ]; then
cd ${BASE}/big_tests && make prepare
fi

2 changes: 1 addition & 1 deletion tools/cache-build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Travis packs all cache directories into one archive for caching.
# CI packs all cache directories into one archive for caching.
# So, we put files into tar, not tar.gz to improve compression
# (because the files are shared between mongooseim and big_tests)

Expand Down
2 changes: 1 addition & 1 deletion tools/cache-certs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Travis packs all cache directories into one archive for caching.
# CI packs all cache directories into one archive for caching.
# So, we put files into tar, not tar.gz to improve compression
# (because the files are shared between mongooseim and big_tests)

Expand Down
2 changes: 1 addition & 1 deletion tools/cache-tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Travis packs all cache directories into one archive for caching.
# CI packs all cache directories into one archive for caching.
# So, we put files into tar, not tar.gz to improve compression
# (because the files are shared between mongooseim and big_tests)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

G_API="https://api.github.com"

echo "pull request: ${TRAVIS_PULL_REQUEST}"
if [ ${TRAVIS_PULL_REQUEST} != "false" ]; then
# @TODO CI:
# CI_PULL_REQUEST: ${{ github.event.pull_request.number }}
echo "pull request: ${CI_PULL_REQUEST}"
if [ ${CI_PULL_REQUEST} != "false" ]; then
wget http://stedolan.github.io/jq/download/linux64/jq
chmod +x jq
JQ='./jq -a -M'
PULL_REQ_FILE="/tmp/mongoose_pull_req"
MONGOOSE_REPO_URL="${G_API}/repos/esl/MongooseIM"
curl ${MONGOOSE_REPO_URL}/pulls/${TRAVIS_PULL_REQUEST} > ${PULL_REQ_FILE}
curl ${MONGOOSE_REPO_URL}/pulls/${CI_PULL_REQUEST} > ${PULL_REQ_FILE}
M_PULL_USER=`${JQ} '.head.user.login' ${PULL_REQ_FILE}`
M_PULL_USER=${M_PULL_USER//\"/}
M_PULL_BRANCH=`${JQ} '.head.ref' ${PULL_REQ_FILE}`
Expand All @@ -25,11 +27,11 @@ if [ ${TRAVIS_PULL_REQUEST} != "false" ]; then
sed "s/{ejabberd_tests.*/${NEW_TEST_LINE}/" rebar.tests.config > rebar.tests.config2
mv rebar.tests.config2 rebar.tests.config
M_COMMENTS_FILE="/tmp/pull_comments"
M_PULL_COMMENTS_URL="${MONGOOSE_REPO_URL}/issues/${TRAVIS_PULL_REQUEST}/comments"
M_PULL_COMMENTS_URL="${MONGOOSE_REPO_URL}/issues/${CI_PULL_REQUEST}/comments"
curl ${M_PULL_COMMENTS_URL} > ${M_COMMENTS_FILE}
MY_COMMENTS=`${JQ} 'map(select(.user.login == "mongoose-travis-commenter" // .user.login == "mongoose-im")) | length' ${M_COMMENTS_FILE}`
MY_COMMENTS=`${JQ} 'map(select(.user.login == "mongoose-commenter" // .user.login == "mongoose-im")) | length' ${M_COMMENTS_FILE}`
if [ ${MY_COMMENTS} = 0 ]; then
M_PULL_COMMENT="travis is using test branch \`${M_PULL_BRANCH}\` from https://github.com/${M_PULL_USER}/ejabberd_tests/tree/${M_PULL_BRANCH}"
M_PULL_COMMENT="CI is using test branch \`${M_PULL_BRANCH}\` from https://github.com/${M_PULL_USER}/ejabberd_tests/tree/${M_PULL_BRANCH}"
curl -H "Authorization: token ${GITHUB_TOKEN}" \
-X POST -d "{\"body\":\"${M_PULL_COMMENT}\"" \
${M_PULL_COMMENTS_URL}
Expand Down
File renamed without changes.
File renamed without changes.
14 changes: 10 additions & 4 deletions tools/travis-helpers.sh → tools/helpers.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
ct_reports_dir() {
local BUILD_NO=${TRAVIS_BUILD_NUMBER:-ct_reports}
local BUILD_NO=${GITHUB_RUN_NUMBER:-ct_reports}
local PRESET_NAME=${PRESET:-default}
local ERLANG=${TRAVIS_OTP_RELEASE:-default}
# @TODO CI:
# CI_OTP_RELEASE: ${{ matrix.otp }}
local ERLANG=${CI_OTP_RELEASE:-default}
local CT_REPORTS="${BUILD_NO}/${PRESET_NAME}.${ERLANG}"
local BRANCH=${TRAVIS_BRANCH:-master}
local PR=${TRAVIS_PULL_REQUEST:-false}
# @TODO CI:
# CI_BRANCH: $(echo ${GITHUB_REF##*/})
local BRANCH=${CI_BRANCH:-master}
# @TODO CI:
# CI_PULL_REQUEST: ${{ github.event.pull_request.number }}
local PR=${CI_PULL_REQUEST:-false}

if [ ${PR} == false ]; then
echo "branch/${BRANCH}/${CT_REPORTS}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

source tools/travis-helpers.sh
source tools/helpers.sh

set -euo pipefail
IFS=$'\n\t'
Expand Down
Loading