Skip to content

Commit

Permalink
Removes references to Travis and updates some scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Nov 20, 2020
1 parent cdd4458 commit 68acab9
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 33 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This is a quick and dirty set of agreed-upon standards for contributions to the
---

### Pull requests
- It's ultimately the responsibility of the person opening the PR to keep it up to date with the codebase and fix any issues found by Travis/pointed out during review. Reviewers should be open to discussion objections/alternatives either on Discord or in the diff.
- It's ultimately the responsibility of the person opening the PR to keep it up to date with the codebase and fix any issues found by unit testing or pointed out during review. Reviewers should be open to discussion objections/alternatives either on Discord or in the diff.
- Opening a PR on behalf of someone else is not recommended unless you are willing to see it through even with changes requested, etc. Opening a PR in bad faith or to make a point is not acceptable.

#### Pull request reviews:
Expand Down
5 changes: 3 additions & 2 deletions code/__defines/~unit_testing.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/*
*
* This file is used by Travis to indicate that Unit Tests are to be ran.
* Do not add anything but the UNIT_TEST definition here as it will be overwritten by Travis when running tests.
* This file is used by the unit testing scripts to indicate that Unit Tests are to be ran.
* Do not add anything but the UNIT_TEST definition here as it will be overwritten by the
* unit test environment when running tests.
*
*
* Should you wish to edit set UNIT_TEST to 1 like so:
Expand Down
10 changes: 5 additions & 5 deletions code/_helpers/text.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
input = replace_characters(input, list("\n"=" ","\t"=" "))

if(encode)
// The below \ escapes have a space inserted to attempt to enable Travis auto-checking of span class usage. Please do not remove the space.
// The below \ escapes have a space inserted to attempt to enable unit testing of span class usage. Please do not remove the space.
//In addition to processing html, html_encode removes byond formatting codes like "\ red", "\ i" and other.
//It is important to avoid double-encode text, it can "break" quotes and some other characters.
//Also, keep in mind that escaped characters don't work in the interface (window titles, lower left corner of the main window, etc.)
Expand Down Expand Up @@ -429,8 +429,8 @@ proc/TextPreview(var/string,var/len=40)
/proc/digitalPencode2html(var/text)
text = replacetext(text, "\[pre\]", "<pre>")
text = replacetext(text, "\[/pre\]", "</pre>")
text = replacetext(text, "\[fontred\]", "<font color=\"red\">") //</font> to pass travis html tag integrity check
text = replacetext(text, "\[fontblue\]", "<font color=\"blue\">")//</font> to pass travis html tag integrity check
text = replacetext(text, "\[fontred\]", "<font color=\"red\">") //</font> to pass html tag unit test
text = replacetext(text, "\[fontblue\]", "<font color=\"blue\">")//</font> to pass html tag unit test
text = replacetext(text, "\[fontgreen\]", "<font color=\"green\">")
text = replacetext(text, "\[/font\]", "</font>")
text = replacetext(text, "\[redacted\]", "<span class=\"redacted\">R E D A C T E D</span>")
Expand All @@ -440,8 +440,8 @@ proc/TextPreview(var/string,var/len=40)
/proc/html2pencode(t)
t = replacetext(t, "<pre>", "\[pre\]")
t = replacetext(t, "</pre>", "\[/pre\]")
t = replacetext(t, "<font color=\"red\">", "\[fontred\]")//</font> to pass travis html tag integrity check
t = replacetext(t, "<font color=\"blue\">", "\[fontblue\]")//</font> to pass travis html tag integrity check
t = replacetext(t, "<font color=\"red\">", "\[fontred\]")//</font> to pass html tag unit test
t = replacetext(t, "<font color=\"blue\">", "\[fontblue\]")//</font> to pass html tag unit test
t = replacetext(t, "<font color=\"green\">", "\[fontgreen\]")
t = replacetext(t, "</font>", "\[/font\]")
t = replacetext(t, "<BR>", "\[br\]")
Expand Down
4 changes: 2 additions & 2 deletions code/unit_tests/unit_test.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var/skipped_unit_tests = 0
var/total_unit_tests = 0

// For console out put in Linux/Bash makes the output green or red.
// Should probably only be used for unit tests/Travis since some special folks use winders to host servers.
// Should probably only be used for unit tests since some special folks use winders to host servers.
// if you want plain output, use dm.sh -DUNIT_TEST -DUNIT_TEST_PLAIN nebula.dme
#ifdef UNIT_TEST_PLAIN
var/ascii_esc = ""
Expand Down Expand Up @@ -117,7 +117,7 @@ var/ascii_reset = "[ascii_esc]\[0m"

/proc/load_unit_test_changes()
/*
//This takes about 60 seconds to run on Travis and is only used for the ZAS vacume check on The Asteroid.
//This takes about 60 seconds to run during unit testing and is only used for the ZAS vacume check on The Asteroid.
if(config.generate_map != 1)
log_unit_test("Overiding Configuration option for Asteroid Generation to ENABLED")
config.generate_map = 1 // The default map requires it, the example config doesn't have this enabled.
Expand Down
2 changes: 1 addition & 1 deletion docs/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Supported Versions

This repository is built and tested against BYOND version 512.1483 at time of writing. If this version number is at odds with `BYOND_MAJOR`.`BYOND_MINOR` as defined in [.travis.yml](https://github.com/NebulaSS13/Nebula/blob/dev/.travis.yml#L8) in the repository root folder, the Travis configuration should be considered authoritative and this document should be noted as out of date. Security vulnerabilities or exploits that apply to this version should be reported so that they can be closed.
This repository is built and tested against BYOND version 512.1483 at time of writing. If this version number is at odds with `BYOND_MAJOR`.`BYOND_MINOR` as defined in [the test workflow](https://github.com/NebulaSS13/Nebula/blob/dev/.github/workflows/test.yml#L11) in the .github workflow folder, the workflow configuration should be considered authoritative and this document should be noted as out of date. Security vulnerabilities or exploits that apply to this version should be reported so that they can be closed.

## Reporting a Vulnerability

Expand Down
4 changes: 2 additions & 2 deletions maps/away/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ The game will read this to learn about your new shiny away sites, including what

### Include your .dm file in any main map file, and away sites testing

That's `maps/away_sites_testing/away_sites_testing.dm` plus your main map definition. It goes in the testing one to make sure Travis runs it through unit testing, and it goes in the primary map to make it available during real play.
That's `maps/away_sites_testing/away_sites_testing.dm` plus your main map definition. It goes in the testing one to make sure it is runs through unit testing, and it goes in the primary map to make it available during real play.

### Don't include it, or the .dmms, in the .dme

That means don't have any of your away map stuff checked in Dream Maker. It'll get included, as if by magic, via the work you did in the previous step!

That's it! You're probably done! Unless Travis explodes at you.
That's it! You're probably done! Unless the unit tests explode on you.

### Some of the stuff I put in my map isn't behaving properly!

Expand Down
17 changes: 17 additions & 0 deletions scripts/validateTestingContainsAllMaps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#! /bin/bash

cd "$(dirname "${BASH_SOURCE[0]}")"
cd ../

fail=0

for k in maps/*; do
map=${k#maps/}
if [[ -e maps/$map/$map.dm ]] && ! grep -P "map_path: \[.*(?<=\[|,)\s*$map\s*(?=\]|,).*\]" .github/workflows/test.yml > /dev/null; then
# $map is a valid map key, but unit testing isn't testing it!
fail=$((fail + 1))
echo "Map key '$map' is present in the repository, but is not listed in .github/workflows/test.yml!"
fi
done

exit $fail
17 changes: 0 additions & 17 deletions scripts/validateTravisContainsAllMaps.sh

This file was deleted.

4 changes: 2 additions & 2 deletions test/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
# groups that already exists. Add it to the relevant run_xxx_tests function, and
# if it introduces any new dependencies, add them to the check_xxx_deps
# function. Some dependencies are guaranteed to be on CI platforms by outside
# means (like .travis.yml), others will need to be installed by this script.
# means (like .github/workflows/test.yml), others will need to be installed by this script.
# You'll see plenty of examples of checking for CI and gating tests on that,
# installing instead of checking when running on CI.
#
Expand Down Expand Up @@ -193,7 +193,7 @@ function run_code_tests {
find_code_deps
setup_python3
shopt -s globstar
run_test "check travis contains all maps" "scripts/validateTravisContainsAllMaps.sh"
run_test "check test workflow contains all maps" "scripts/validateTestingContainsAllMaps.sh"
run_test_fail "maps contain no step_[xy]" "grep 'step_[xy]' maps/**/*.dmm"
run_test_fail "maps contain no layer adjustments" "grep 'layer = ' maps/**/*.dmm"
run_test_fail "maps contain no plane adjustments" "grep 'plane = ' maps/**/*.dmm"
Expand Down
2 changes: 1 addition & 1 deletion tools/TagMatcher/tag-matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def arrange_mismatches(mismatches_by_tag, mismatch_line, mismatch_counts):
for mismatch_line in sorted(set(mismatch_list)):
print('\t\tLine {0}'.format(abs(mismatch_line)))

# Simply prints the total number of mismatches found and if so returns 1 to, for example, fail Travis builds.
# Simply prints the total number of mismatches found and if so returns 1 to, for example, fail unit testing.
if(total_mismatches == 0):
print('No mismatches found.')
else:
Expand Down

0 comments on commit 68acab9

Please sign in to comment.