Code Monkey home page Code Monkey logo

Comments (6)

cohix avatar cohix commented on September 13, 2024 3

@MacklinEngineering yep, that's what the C in CI stands for (continuous) 🙂

See the .github folder which describes the CI workflow, it runs go test -v ./..., which runs all tests in the project.

from e2core.

MacklinEngineering avatar MacklinEngineering commented on September 13, 2024

Tests:
If any tests do not return 200s, fail the test (CoNNOR WILL SHOW ME)
RECREATE ALL TESTS IN GOLANG

/hello
Make a request to each of the handlpoints and check its results.
Sendpost request to /hello and should get "hello my fired" back.
curl -d 'my friend' localhost:8080/hello

/fetch:
Testing use of State- modifyurl function adds /suborbital and fetch test takes that url and makes a request to that url. Make request to /fetch and body of request will be HTTPS.github.com- modify url will ......... (14.29)

curl -d 'https://github.com' localhost:8080/fetch | grep "atmo"

Strings.contains (bullion go func)

/set/key and /get/key Botha re testing cache. (won't return any data for SET)- for check: ONLY checking that status code =200)
pass variable into :key (like /set/name - Connor for example, and then /get as its the same to

first request should have 200 response code and second has 200 and exact same value.

/set/:key
curl -d 'nyah' localhost:8080/set/name the you pass data- curl defaults to POST
/get/:key
curl localhost:8080/get/name

/file
curl localhost:8080/file/main.md will return contents of main.md #### hello%

make a request to each file in Static directory (main.css, main.js, static.md) and should return contents of the files. Compare return values of each return request to ensure it matches.

  • = path, : = one element
    like: /file/css/main.css

CHECK THE RUNNABLES FOR EACH HANDLER

/github: uses graphql function (LEAVE FOR NOW)- come back to because requires

Ignore: /user--> (requires db) and /stream --> (requires web socket).

from e2core.

MacklinEngineering avatar MacklinEngineering commented on September 13, 2024

//I think the easiest way would be to make a single Atmo method that does everything Start() does but instead looks something like func (a *Atmo) testStart() (*vk.Server, err), and then you can call that method from your atmo_test.go tests

//Create an Atmo object
// func New(opts ...options.Modifier) *Atmo {
// options.UseBundlePath(path),

// }

// Just call: New Method which creates a new atmo server and object

//and give it this option.

// UseBundlePath("./example-project/runnables.wasm.zip")
/*
Tests:
If any tests do not return 200s, fail the test (CoNNOR WILL SHOW ME)
RECREATE ALL TESTS IN GOLANG

/hello ****** curl -d 'my friend' localhost:8080/hello *********
Make a request to each of the handlpoints and check its results.
Sendpost request to /hello and should get "hello my friend" back (if you send my friend in post).

/fetch: ******* curl -d 'https://github.com' localhost:8080/fetch | grep "atmo" ********
Testing use of State- modifyurl function - adds /suborbital onto end of url and fetch test function takes that url and makes a request to that url.
Make request to /fetch and body of request will be HTTPS.github.com- modify url will change that to github.com/suborbital and fetchtest will make a request to github.com/suborbital and then it will downtload the html of our suborbital github page.
SO. POST REQUEST to /fetch
Body of post request should be HTTPS github.com
Response will be HTML, but search through the string to see if Vektor, Grav, and Atmo are there, that is the correct page.
The HTML will come back as a string.
Strings.contains() --> built in go function. ......... (14.29)

/set/:key and /get/:key

^^ to test: first request should have 200 response code and second has 200 and exact same value. /set/name and /get/name Botha re testing cache. (won't return any data for SET)- for check: ONLY checking that status code =200)
pass variable into :key (like /set/name - Connor for example, and then /get as its the same to

/set/:key ********* curl -d 'nyah' localhost:8080/set/name ***************. Does not return anything- on a 200 response it doesn't return any day (this POSt request does not return data). Just check that the status code is 200.

/get/:key ********* curl localhost:8080/get/name *********** Should return name from above.

/file/*file - "testing fetching a file from the static directory" ****** curl localhost:8080/file/main.md ********* will return contents of main.md *****
RETURNS: [contents of main.md file] which is in this case: hello%

Or: [other file example]
curl localhost:8080/file/css/main.css
RETURNS:
.classname {
color: aliceblue;
}%

make a request to each file in Static directory (/css/main.css, /js/app/main.js, /main.md) and should return contents of the files.
Compare return values of each return request to ensure it matches the contents of the file that you are asking for. Can jsut copy contents of file and read test or READ file (more automated).

  • = entire path (like /file/{css/main.css}), : = one element (vs /file/{main.css}) _ you can only have one element at the latter
    like: /file/css/main.css
    You can peek at each runnable that each fo these is using just to see how the runnable is writtena nd what APIs its using for general knowledge about atmo.

/github: uses graphql function (LEAVE FOR NOW)- come back to because requires

Ignore: /user--> (requires db) and /stream --> (requires web socket).

*/
//curl -d 'my friend' localhost:8080/hello
//send post request to endpoint
//should return "hello my friend"

// 3 test important notes:
// Method has to start w Test405Request
// Param has to be (t *testing.T)
// file name has to be _test.go

// /hello ****** curl -d 'my friend' localhost:8080/hello *********

from e2core.

MacklinEngineering avatar MacklinEngineering commented on September 13, 2024

DONT FORGET: AFTER WRITE A SCRIPT THAT RUNS ALL THE TESTS

MAYBE WE CAN SET THAT SCRIPT TO RUN EVERYTIME SOMETHING ELSE IS SET FOR ATMO- LIKE WHEN A RELEASE PR IS CREATED or something similar (will have kinks but just thinking this through).

from e2core.

cohix avatar cohix commented on September 13, 2024

@MacklinEngineering your tests are already being run, it's built into CI already :)

https://github.com/suborbital/atmo/runs/5029200425?check_suite_focus=true#step:5:17

from e2core.

MacklinEngineering avatar MacklinEngineering commented on September 13, 2024

Oh that is dope!! Wait, so CI will automatically run these tests on all atmo code that is pushed up?

from e2core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.